Mercurial > libervia-templates
changeset 99:609c66552ba0
blog/item: handle new tags_http_uri variable to make tags clickable
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 21 Jan 2018 20:25:24 +0100 (2018-01-21) |
parents | 2dd56fd2e9c9 |
children | 61bf2ae16577 |
files | default/blog/item.html default/static/blog.css |
diffstat | 2 files changed, 33 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/default/blog/item.html Sun Jan 21 10:09:05 2018 +0100 +++ b/default/blog/item.html Sun Jan 21 20:25:24 2018 +0100 @@ -59,9 +59,15 @@ </div> {% if item.tags %} <div class="labels"> - {% for tag in item.tags %} - <span>{{tag}}</span> - {% endfor %} + {% if tags_http_uri is defined %} + {% for tag in item.tags %} + <a href="{{tags_http_uri[tag]}}"><span>{{tag}}</span></a> + {% endfor %} + {% else %} + {% for tag in item.tags %} + <span>{{tag}}</span> + {% endfor %} + {% endif %} </div> {% endif %} {% endblock metadata %}
--- a/default/static/blog.css Sun Jan 21 10:09:05 2018 +0100 +++ b/default/static/blog.css Sun Jan 21 20:25:24 2018 +0100 @@ -41,12 +41,26 @@ text-align: right; } +.labels a { + text-decoration: none; + color: inherit; +} + .labels span { - font-variant: small-caps; - font-size: 0.8rem; - background-color: #ddd; - border-radius: 0.4em; - padding: 0 0.5em; + font-variant: small-caps; + font-size: 0.8rem; + background-color: #ddd; + border-radius: 0.4em; + padding: 0 0.5em; + transition: all 0.5s; +} + +.labels a>span { + cursor: pointer; +} + +.labels a>span:hover { + box-shadow: 0px 0px 6px 1px #000; } @@ -70,7 +84,7 @@ /** navigation links **/ .bottom_links ul { - list-style: none; + list-style: none; display: flex; padding: 0 2em; margin: 0; @@ -95,10 +109,10 @@ } .bottom_links a { - display: inline-block; - text-decoration: None; - color: inherit; - font-variant: small-caps; + display: inline-block; + text-decoration: None; + color: inherit; + font-variant: small-caps; } .bottom_links a:hover {