comparison sat_templates/default/blog/item.html @ 147:33c7ce833d3f

install: setup.py fix + moved "default" dir in a "sat_templates" dir: the merge request at https://bugs.goffi.org/mr/view/3 was a good basis, but not fully working ("default" dir was removed), this patch fixes it, and do some improvments: - moved "default" in "sat_templates" dir, which correspond to the python module, so it can be found easily from python - added VERSION, and mercurial hash detection, in the same way as for Cagou and backend - slight modification of classifiers - replaces tabs coming from MR by spaces
author Goffi <goffi@goffi.org>
date Sat, 02 Jun 2018 17:25:43 +0200
parents default/blog/item.html@988a1c0e8419
children
comparison
equal deleted inserted replaced
146:7dc00829c32f 147:33c7ce833d3f
1 {# display a blog item which can be expanded/retracted by clicking on it
2
3 if the locale differs from item language, it will be totally reduced, and will need a click to be displayed
4
5 @variable item(data_object.BlogItem): item to display
6 @variable identities(data_object.Identities): identities which can be used to display info on item author
7 @variable dates_format(unicode): format of the date to use (see date_fmt filter)
8 #}
9
10 {% block item %}
11
12 {% if item.language and locale and locale.language != item.language %}
13 {# we may display items in different language in a specific way #}
14 {% set other_lang = " other_lang" %}
15 {% endif %}
16
17 {% if expanded %}
18 {# FIXME: the style attribute is not nice, but due to the use of clicked_mh_fix. A cleaner way would be welcomed #}
19 <article id="{{item.id}}" class="init box{{other_lang}} clicked" style="max-height: none">
20 {% else %}
21 <article id="{{item.id}}" class="init box{{other_lang}}" >
22 {% endif %}
23
24 {# following message is displayed if item lang is different from page locale #}
25 {% if other_lang is defined %}
26 <div class="info"><p>{% trans language=locale.language_name %}This message is not in {{language}}, click to display anyway{% endtrans %}</p></div>
27 {% endif %}
28
29 {# we put a reduce button at the top #}
30 <div class="expand_box box_top" onclick="clicked_mh_fix('{{item.id}}')">
31 <p>
32 <span class='hide'>{% trans %}Click to reduce…{% endtrans %}</span>
33 </p>
34 </div>
35
36 <header>
37 {% block header %}
38 {# title and publication date link to a HTTP page if items_http_uri is set #}
39 {% set item_http_uri = items_http_uri.get(item.id) if items_http_uri is defined else none %}
40
41 <div class="title">
42 {% block blog_title scoped %}
43 {% set title = item.title_xhtml or item.title or '' %}
44 {% if item_http_uri %}
45 <a href="{{item_http_uri}}">{{title}}</a>
46 {% else %}
47 {{title}}
48 {% endif %}
49 {% endblock %}
50 </div>
51 {% block metadata scoped %}
52 <div class="metadata">
53 {% if identities is defined %}
54 <span class="author">{{identities[item.author_jid].nick | default(item.author)}}</span>
55 {% else %}
56 <span class="author">{{item.author}}</span>
57 {% endif %}
58 {% set published = item.published|date_fmt(fmt=dates_format) %}
59 {% if item_http_uri %}
60 <span class="blog_data"><a href="{{item_http_uri}}">{{published}}</a></span>
61 {% else %}
62 {{- published -}}
63 {% endif %}
64 </div>
65 {% if item.tags %}
66 <div class="labels">
67 {% if tags_http_uri is defined %}
68 {% for tag in item.tags %}
69 <a href="{{tags_http_uri[tag]}}"><span>{{tag}}</span></a>
70 {% endfor %}
71 {% else %}
72 {% for tag in item.tags %}
73 <span>{{tag}}</span>
74 {% endfor %}
75 {% endif %}
76 </div>
77 {% endif %}
78 {% endblock metadata %}
79 {% endblock header %}
80 </header>
81
82 <div class="content{{' text' if not item.content_xhtml}}">
83 {% block content %}
84 {{- item.content_xhtml or item.content|urlize or '' -}}
85 {% endblock content %}
86 </div>
87
88 {# and the bottom button to expand/reduce the article #}
89 <div class="expand_box box_bottom" onclick="clicked_mh_fix('{{item.id}}')">
90 <p>
91 <span class='show'>{% trans %}Click to expand…{% endtrans %}</span>
92 <span class='hide'>{% trans %}Click to reduce…{% endtrans %}</span>
93 </p>
94 </div>
95
96 </article>
97
98 {% endblock item %}