view sat_templates/templates/bulma/blog/item.html @ 245:10278ba367a2

bulma (photo/discover): design for the new theme + create button + delete button
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 17:57:13 +0200
parents 0e69b5843c2f
children 1928ba66c194
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 %}

{% 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 %}
    <article id="{{item.id}}" class="media has-background-white has-padding-1" >
        {% if identities is defined %}
            {% if avatar is defined %}
                <div class="media-left">
                    {{ avatar.avatar(item.author_jid) }}
                </div>
            {% endif %}
        {% endif %}
        <div class="media-content">
            {% set title = item.title_xhtml or item.title%}
            {% if title %}
                <h4 class="title is-4">{{title}}</h1>
            {% endif %}
            <div class="content">
                <p class="subtitle is-6 has-text-grey">
                    {% set published = item.published|date_fmt(fmt=dates_format) %}
                    <strong>{{item.author}}</strong> <small>{{published}}</small>
                    {% if item.tags %}
                        <small class="labels">
                            {% if tags_http_uri is defined %}
                                {% for tag in item.tags %}
                                    <a href="{{tags_http_uri[tag]}}"><span class="tag is-rounded">{{tag}}</span></a>
                                {% endfor %}
                            {% else %}
                                {% for tag in item.tags %}
                                    <span class="tag">{{tag}}</span>
                                {% endfor %}
                            {% endif %}
                        </small>
                    {% endif %}
                </p>
                <p>
                    {{- item.content_xhtml or item.content|urlize or '' -}}
                </p>
                {% for comments_items in item.comments_items_list %}
                    {% for item in comments_items %}
                        {% include 'blog/item.html' %}
                    {% endfor %}
                    {% if allow_commenting and item_level == 1 %}
                        <div class="comment_post">
                            {{- textbox.comment(service=comments_items.service, node=comments_items.node) -}}
                        </div>
                    {% endif %}
                {% endfor %}

            </div>
        </div>
    </article>

{% endblock item %}