Mercurial > libervia-web
diff 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 |
line wrap: on
line diff
--- a/src/browser/sat_browser/richtext.py Tue Nov 24 23:28:55 2015 +0100 +++ b/src/browser/sat_browser/richtext.py Wed Nov 25 00:22:41 2015 +0100 @@ -323,11 +323,15 @@ content = self._original_content text = content['text'] if 'title' in content and content['title']: - text = '<h1>%s</h1>%s' % (html_tools.html_sanitize(content['title']), text) - tags = list(common.dict2iter('tag', content)) - if tags: # FIXME: display it more beautiful - text = '%s<h3>%s %s</h3>' % (text, _("Tags:"), html_tools.html_sanitize(", ".join(tags))) - self.display.setContent({'text': text}) + title = '<h1>%s</h1>' % html_tools.html_sanitize(content['title']) + + tags = "" + for tag in common.dict2iter('tag', content): + tags += "<li><a>%s</a></li>" % html_tools.html_sanitize(tag) + if tags: + tags = '<ul class="mblog_tags">%s</ul>' % tags + + self.display.setContent({'text': "%s%s%s" % (title, tags, text)}) def setFocus(self, focus): self.textarea.setFocus(focus)