Mercurial > libervia-web
comparison src/browser/sat_browser/richtext.py @ 763:7390cba0bb44
browser_side: display tags with nice icons like for the static blog
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 25 Nov 2015 00:22:41 +0100 |
parents | 34f066ed3b23 |
children | a55df9c37d0e |
comparison
equal
deleted
inserted
replaced
762:8eeb98659de2 | 763:7390cba0bb44 |
---|---|
321 def setDisplayContent(self): | 321 def setDisplayContent(self): |
322 """Set the content of the editor_widget.HTMLTextEditor which is used for display/wysiwyg""" | 322 """Set the content of the editor_widget.HTMLTextEditor which is used for display/wysiwyg""" |
323 content = self._original_content | 323 content = self._original_content |
324 text = content['text'] | 324 text = content['text'] |
325 if 'title' in content and content['title']: | 325 if 'title' in content and content['title']: |
326 text = '<h1>%s</h1>%s' % (html_tools.html_sanitize(content['title']), text) | 326 title = '<h1>%s</h1>' % html_tools.html_sanitize(content['title']) |
327 tags = list(common.dict2iter('tag', content)) | 327 |
328 if tags: # FIXME: display it more beautiful | 328 tags = "" |
329 text = '%s<h3>%s %s</h3>' % (text, _("Tags:"), html_tools.html_sanitize(", ".join(tags))) | 329 for tag in common.dict2iter('tag', content): |
330 self.display.setContent({'text': text}) | 330 tags += "<li><a>%s</a></li>" % html_tools.html_sanitize(tag) |
331 if tags: | |
332 tags = '<ul class="mblog_tags">%s</ul>' % tags | |
333 | |
334 self.display.setContent({'text': "%s%s%s" % (title, tags, text)}) | |
331 | 335 |
332 def setFocus(self, focus): | 336 def setFocus(self, focus): |
333 self.textarea.setFocus(focus) | 337 self.textarea.setFocus(focus) |
334 | 338 |
335 def abortEdition(self, content): | 339 def abortEdition(self, content): |