# HG changeset patch # User Goffi # Date 1516382397 -3600 # Node ID 94b5806b9e2f6e281aa0331d112e0f661d3127ce # Parent e4ffb56efd4e961773e9cba3e7e00da980c59ac3 blog/item: various improvments: - title and publication date are now clickable if HTTP link of item is set - show labels (aka tags/categories) - text only content in body is urlized diff -r e4ffb56efd4e -r 94b5806b9e2f default/blog/item.html --- a/default/blog/item.html Fri Jan 19 18:17:06 2018 +0100 +++ b/default/blog/item.html Fri Jan 19 18:19:57 2018 +0100 @@ -30,24 +30,47 @@
{% block header %} -
{% block blog_title %}{{ item.title_xhtml or item.title or '' }}{% endblock %}
- {% block metadata %} + {# title and publication date link to a HTTP page if items_http_uri is set #} + {% set item_http_uri = items_http_uri.get(item.id) if items_http_uri is defined else none %} + +
+ {% block blog_title scoped %} + {% set title = item.title_xhtml or item.title or '' %} + {% if item_http_uri %} + {{title}} + {% else %} + {{title}} + {% endif %} + {% endblock %} +
+ {% block metadata scoped %} - + {% if item.tags %} +
+ {% for tag in item.tags %} + {{tag}} + {% endfor %} +
+ {% endif %} {% endblock metadata %} {% endblock header %}
{% block content %} - {{- item.content_xhtml or item.content or '' -}} + {{- item.content_xhtml or item.content|urlize or '' -}} {% endblock content %}
diff -r e4ffb56efd4e -r 94b5806b9e2f default/static/blog.css --- a/default/static/blog.css Fri Jan 19 18:17:06 2018 +0100 +++ b/default/static/blog.css Fri Jan 19 18:19:57 2018 +0100 @@ -18,6 +18,11 @@ /** header **/ +header a { + color: inherit; + text-decoration: inherit; +} + header .metadata { text-align: right; } @@ -30,6 +35,20 @@ content: ", "; } +/*** labels ***/ + +.labels { + text-align: right; +} + +.labels span { + font-variant: small-caps; + font-size: 0.8rem; + background-color: #ddd; + border-radius: 0.4em; + padding: 0 0.5em; +} + /** content **/