diff sat_templates/templates/bulma/blog/item.html @ 230:0e69b5843c2f

theme: bulma theme first draft: This theme uses the Bulma CSS framework, Brython to handle the menu on touch devices, and Sass to customize Bulma. CSS default fallbacks are disabled as Bulma uses its own naming conventions, and default fallbacks would lead to hard to debug conflicts. `common.js` has been slightly improved to handle custom classed in `tab_select` The theme is not complete yet, but it is functional.
author Goffi <goffi@goffi.org>
date Tue, 19 May 2020 00:02:34 +0200
parents
children 1928ba66c194
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sat_templates/templates/bulma/blog/item.html	Tue May 19 00:02:34 2020 +0200
@@ -0,0 +1,67 @@
+{# 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 %}