diff src/browser/sat_browser/menu.py @ 788:7ebde6d1a4bd

browser side: fixed public blog menu (moved temporarily to frontend side)
author Goffi <goffi@goffi.org>
date Wed, 02 Dec 2015 11:15:58 +0100
parents 627b9073a2ec
children f2a76ee020f6
line wrap: on
line diff
--- a/src/browser/sat_browser/menu.py	Wed Dec 02 11:15:55 2015 +0100
+++ b/src/browser/sat_browser/menu.py	Wed Dec 02 11:15:58 2015 +0100
@@ -32,6 +32,7 @@
 import contact_group
 import base_menu
 from sat_browser import html_tools
+from sat_browser import web_widget
 
 
 unicode = str  # FIXME: pyjamas workaround
@@ -163,3 +164,13 @@
         body.setCloseCb(_dialog.close)
         _dialog.setWidth('40%')
         _dialog.show()
+
+    def onPublicBlog(self, contact_box, data,  profile):
+        # FIXME: Q&D way to check domain, need to be done in a cleaner way
+        if contact_box.jid.domain != self.host._defaultDomain:
+            self.host.showDialog(u"Public blogs from other domains are not managed yet", "Can't show public blog", "error")
+            return
+
+        url = '{}/blog/{}'.format(self.host.base_location, contact_box.jid.node)
+        widget = self.host.displayWidget(web_widget.WebWidget, url, show_url=False)
+        self.host.setSelected(widget)