Mercurial > libervia-templates
view sat_templates/templates/default/blog/item.html @ 166:178f55b825b7
small refactoring/redesign, better BEM integration:
- blog has been redesigned, and almost all blog CSS has been made generic and moved to main styles.css file.
- better noscript handling, dynamic elements are created using "magic" classes (dom_update.js)
- using better icons for older/newer messages
- better state handling, classes now use "state_XXX"
- more classes now use BEM convention
- menu labels have been moved to a separate template (components/menu_labels.html), so it can be overriden easily by other sites
- better styles.css organisation
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 03 Oct 2018 21:00:24 +0200 |
parents | e9f0a4215e46 |
children | 3195484abd82 |
line wrap: on
line source
{# display a blog item which can be expanded/retracted by clicking on it if the locale differs from item language, it will be totally reduced, and will need a click to be displayed @variable item(data_object.BlogItem): item to display @variable identities(data_object.Identities): identities which can be used to display info on item author @variable dates_format(unicode): format of the date to use (see date_fmt filter) #} {% block item %} {% if item.language and locale and locale.language != item.language %} {# we may display items in different language in a specific way #} {% set other_lang = " other_lang" if expanded else " other_lang state_init" %} {% endif %} <article id="{{item.id}}" class="box {{"box--comment" if comment else "box--large"}} {{"" if (expanded or comment) else "box--expand"}}{{other_lang}}" > {# following message is displayed if item lang is different from page locale #} {% if other_lang is defined %} <div class="info show_if_parent_init"><p>{% trans language=locale.language_name %}This message is not in {{language}}, click to display anyway{% endtrans %}</p></div> {% endif %} <header> {% block header %} {# 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 %} <div class="blog__title"> {% block blog_title scoped %} {% set title = item.title_xhtml or item.title or '' %} {% if item_http_uri %} <a href="{{item_http_uri}}">{{title}}</a> {% else %} {{title}} {% endif %} {% endblock %} </div> {% block metadata scoped %} <div class="blog__metadata"> {% if identities is defined %} {% if avatar is defined %} {{ avatar.avatar(item.author_jid, "avatar--float-left") }} {% endif %} <span class="blog__author">{{identities[item.author_jid].nick | default(item.author)}}</span> {% else %} <span class="blog__author">{{item.author}}</span> {% endif %} {% set published = item.published|date_fmt(fmt=dates_format) %} {% if item_http_uri %} <span class="blog__date"><a href="{{item_http_uri}}">{{published}}</a></span> {% else %} {{- published -}} {% endif %} </div> {% if item.tags %} <div class="labels"> {% 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 %} {% endblock header %} </header> <div class="box__content{{' box__content--plaintext' if not item.content_xhtml}}"> {% block content %} {{- item.content_xhtml or item.content|urlize or '' -}} {% endblock content %} </div> </article> {% endblock item %}