comparison src/browser/sat_browser/blog.py @ 767:063385cbbfc2

browser_side (blog): display author_jid in addition to author
author souliane <souliane@mailoo.org>
date Wed, 25 Nov 2015 16:49:31 +0100
parents 8eeb98659de2
children 6c89dfdba563
comparison
equal deleted inserted replaced
766:dd70db1c48dc 767:063385cbbfc2
104 self._setIcons() 104 self._setIcons()
105 105
106 def _setHeader(self): 106 def _setHeader(self):
107 """Set the entry header.""" 107 """Set the entry header."""
108 if not self.new: 108 if not self.new:
109 author = html_tools.html_sanitize(unicode(self.item.author))
110 author_jid = html_tools.html_sanitize(unicode(self.item.author_jid))
111 if author_jid and not self.item.author_verified:
112 author_jid += u' <span style="color=red; font-weight: bold;">⚠</span>'
113 if author:
114 author += " &lt;%s&gt;" % author_jid
115 elif author_jid:
116 author = author_jid
117 else:
118 author = _("<unknown author>")
119
109 update_text = u" — ✍ " + "<span class='mb_entry_timestamp'>%s</span>" % datetime.fromtimestamp(self.item.updated) 120 update_text = u" — ✍ " + "<span class='mb_entry_timestamp'>%s</span>" % datetime.fromtimestamp(self.item.updated)
110 self.header.add(HTML("""<span class='mb_entry_header_info'> 121 self.header.add(HTML("""<span class='mb_entry_header_info'>
111 <span class='mb_entry_author'>%(author)s</span> on 122 <span class='mb_entry_author'>%(author)s</span> on
112 <span class='mb_entry_timestamp'>%(published)s</span>%(updated)s 123 <span class='mb_entry_timestamp'>%(published)s</span>%(updated)s
113 </span>""" % {'author': html_tools.html_sanitize(unicode(self.item.author)), 124 </span>""" % {'author': author,
114 'published': datetime.fromtimestamp(self.item.published) if self.item.published is not None else '', 125 'published': datetime.fromtimestamp(self.item.published) if self.item.published is not None else '',
115 'updated': update_text if self.item.published != self.item.updated else '' 126 'updated': update_text if self.item.published != self.item.updated else ''
116 })) 127 }))
117 if self.item.comments: 128 if self.item.comments:
118 self.show_comments_link = HTML('') 129 self.show_comments_link = HTML('')