annotate default/blog/item.html @ 44:580670430fa2

blog/item: expand/reduce improvments: - only expand_box is now clickable, not the whole article anymore, avoiding unwanted click - when in .clicked state, message is "Click to reduce" instead of "expand" - in .clicked state, expand_box is only visible on :hover - in .clicked state, and expand_box is available at top and bottom
author Goffi <goffi@goffi.org>
date Thu, 13 Jul 2017 19:23:02 +0200
parents 0c6aa1c81252
children f19e9f5e43b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
1 {% block item %}
30
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
2
36
baa0942d6b45 blog/item: fixed other_lang detection
Goffi <goffi@goffi.org>
parents: 34
diff changeset
3 {% if item.language and locale and locale.language != item.language %}
30
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
4 {# we may display items in different language in a specific way #}
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
5 {% set other_lang = " other_lang" %}
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
6 {% endif %}
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
7
44
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
8 <article id="{{item.id}}" class="init box{{other_lang}}">
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
9
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
10 {# following message is displayed if item lang is different from page locale #}
30
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
11 {% if other_lang is defined %}
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
12 <div class="info"><p>{% trans language=locale.language_name %}This message is not in {{language}}, click to display anyway{% endtrans %}</p></div>
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
13 {% endif %}
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
14
44
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
15 {# we put a reduce button at the top #}
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
16 <div class="expand_box box_top" onclick="clicked_mh_fix('{{item.id}}')">
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
17 <p>
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
18 <span class='hide'>{% trans %}Click to reduce…{% endtrans %}</span>
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
19 </p>
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
20 </div>
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
21
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
22 <header>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
23 {% block header %}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
24 <div class="title">{% block blog_title %}{{ item.title_xhtml or item.title or '' }}{% endblock %}</div>
16
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
25 {% block metadata %}
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
26 <div class="metadata">
24
2496887339f6 defaut (blog/item): use new identities object for author field
Goffi <goffi@goffi.org>
parents: 20
diff changeset
27 <span class="author">{{identities[item.author_jid].nick | default(item.author)}}</span>
32
16818343fc43 blog/item: use date_days instead of blog_date + fr translation
Goffi <goffi@goffi.org>
parents: 30
diff changeset
28 <span class="blog_data">{% trans days=item.published|date_days %}{{days}} days ago{% endtrans %}</span>
16
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
29 </div>
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
30
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
31 {% endblock metadata %}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
32 {% endblock header %}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
33 </header>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
34
34
5fd910d48192 blog/item: "text" class is added for non XHTML content
Goffi <goffi@goffi.org>
parents: 32
diff changeset
35 <div class="content{{' text' if not item.content_xhtml}}">
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
36 {% block content %}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
37 {{ item.content_xhtml or item.content or ''}}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
38 {% endblock content %}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
39 </div>
16
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
40
44
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
41 {# and the bottom button to expand/reduce the article #}
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
42 <div class="expand_box box_bottom" onclick="clicked_mh_fix('{{item.id}}')">
16
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
43 <p>
44
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
44 <span class='show'>{% trans %}Click to expand…{% endtrans %}</span>
580670430fa2 blog/item: expand/reduce improvments:
Goffi <goffi@goffi.org>
parents: 42
diff changeset
45 <span class='hide'>{% trans %}Click to reduce…{% endtrans %}</span>
16
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
46 </p>
8cdcbe0d7dee blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents: 0
diff changeset
47 </div>
30
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
48
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
49 </article>
30
69a2e3bf5e17 blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
Goffi <goffi@goffi.org>
parents: 24
diff changeset
50
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
51 {% endblock item %}