# HG changeset patch # User souliane # Date 1448121826 -3600 # Node ID 916075bd0356aa10188315f120fedbb1c43586e3 # Parent d123e27fc386e9a73ea47b69fc1e73b0da128681 server_side: display tags in static blogs diff -r d123e27fc386 -r 916075bd0356 src/server/blog.py --- a/src/server/blog.py Sat Nov 21 14:34:36 2015 +0100 +++ b/src/server/blog.py Sat Nov 21 17:03:46 2015 +0100 @@ -35,6 +35,7 @@ import re import os +from sat_frontends.quick_frontend import quick_blog from libervia.server.html_tools import sanitizeHtml, convertNewLinesToXHTML from libervia.server.constants import Const as C @@ -468,6 +469,7 @@ self.author = ' ' self.url = (u"%s/%s" % (base_url, entry['id'])) self.title = self.getText(entry, 'title') + self.tags = quick_blog.mbdata2tags(entry) count_text = lambda count: D_('comments') if count > 1 else D_('comment') diff -r d123e27fc386 -r 916075bd0356 themes/default/static_blog.html --- a/themes/default/static_blog.html Sat Nov 21 14:34:36 2015 +0100 +++ b/themes/default/static_blog.html Sat Nov 21 17:03:46 2015 +0100 @@ -39,8 +39,15 @@ {% endif %} - {% if entry.message_title %} -

{{entry.title}}

+ {% if entry.title %} +

{{entry.title}}

+ {% endif %} + {% if entry.tags %} + {% endif %} {{entry.content}}
diff -r d123e27fc386 -r 916075bd0356 themes/default/styles/blog.css --- a/themes/default/styles/blog.css Sat Nov 21 14:34:36 2015 +0100 +++ b/themes/default/styles/blog.css Sat Nov 21 17:03:46 2015 +0100 @@ -116,6 +116,29 @@ padding: 0px 0px 0px 18px; } +/* START TAGS: styles are adapted from Dotclear */ +.mblog_tags { + background: #fbfbfb none repeat scroll 0% 0%; + padding: 5px; + margin: 8px 0px 0px; + overflow: hidden; +} + +.mblog_tags li { + display: inline; + font-size: small; +} + +.mblog_tags li a { + float: left; + padding: 2px 8px 2px 18px; + white-space: nowrap; + color: #005D99; + text-decoration: none; + background: transparent url("../images/blueSilence/tag.png") no-repeat scroll 0px 0px; +} +/* END TAGS */ + .mblog_content { display: block; padding-top: 5px; @@ -174,7 +197,7 @@ .mblog_entry h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration: none; - color: rgb(51, 51, 51); + color: #666; } img { @@ -187,4 +210,4 @@ vertical-align: middle; margin-right: 10px; border-radius: 5px; -} \ No newline at end of file +}