{# 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 %} {% set item_level = (item_level or 0) + 1 %} {% 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 %}
{% if identities is defined %} {% if avatar is defined %}
{{ avatar.avatar(item.author_jid) }}
{% endif %} {% endif %}
{% set title = item.title_xhtml|safe or item.title%} {% set item_http_uri = items_http_uri.get(item.id) if items_http_uri is defined else none %} {% if title %}

{% if item_http_uri %} {{title}} {% else %} {{title}} {% endif %}

{% endif %}

{% set published = item.published|date_fmt(fmt=dates_format) %} {% if Identities is defined %} {{identities[item.author_jid].nicknames[0] if identities[item.author_jid].nicknames else item.author}} {% else %} {{item.author}} {% endif %} {% if item_http_uri %} {{published}} {% else %} {{published}} {% endif %} {% if item.tags %} {% if tags_http_uri is defined %} {% for tag in item.tags %} {{tag}} {% endfor %} {% else %} {% for tag in item.tags %} {{tag}} {% endfor %} {% endif %} {% endif %}

{% if item.content_xhtml is defined %} {{item.content_xhtml|safe}} {% else %}

{{- item.content|urlize -}}

{% endif %} {% for comments_data in item.comments %} {% for item in comments_data['items'] %} {% include 'blog/item.html' %} {% endfor %} {% if allow_commenting and item_level == 1 %}
{{- textbox.comment(service=comments_data.service, node=comments_data.node) -}}
{% endif %} {% endfor %}
{% endblock item %}