Mercurial > libervia-templates
annotate default/blog/articles.html @ 102:7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 22 Jan 2018 08:46:07 +0100 |
parents | e4ffb56efd4e |
children | e1a0d5678837 |
rev | line source |
---|---|
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
8
diff
changeset
|
1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} |
49
f19e9f5e43b0
blog: moved items rendering to a macro + handle new date filter + handle identities
Goffi <goffi@goffi.org>
parents:
43
diff
changeset
|
2 {% set dates_format='relative' %} |
f19e9f5e43b0
blog: moved items rendering to a macro + handle new date filter + handle identities
Goffi <goffi@goffi.org>
parents:
43
diff
changeset
|
3 {% import 'blog/macros.html' as blog with context %} |
0 | 4 |
95
e4ffb56efd4e
blog/articles: if only one item is shown, use it's title or content as page title.
Goffi <goffi@goffi.org>
parents:
93
diff
changeset
|
5 {% block title -%} |
102
7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
Goffi <goffi@goffi.org>
parents:
95
diff
changeset
|
6 {%- if not embedded -%} |
7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
Goffi <goffi@goffi.org>
parents:
95
diff
changeset
|
7 {%- if items|length == 1 -%} |
7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
Goffi <goffi@goffi.org>
parents:
95
diff
changeset
|
8 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} |
7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
Goffi <goffi@goffi.org>
parents:
95
diff
changeset
|
9 {%- else -%} |
7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
Goffi <goffi@goffi.org>
parents:
95
diff
changeset
|
10 {{- super() -}} |
7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
Goffi <goffi@goffi.org>
parents:
95
diff
changeset
|
11 {%- endif -%} |
95
e4ffb56efd4e
blog/articles: if only one item is shown, use it's title or content as page title.
Goffi <goffi@goffi.org>
parents:
93
diff
changeset
|
12 {%- endif -%} |
102
7108731be0b9
blog/articles: don't set content in title block if embedded, to avoid exception with missing parent title
Goffi <goffi@goffi.org>
parents:
95
diff
changeset
|
13 {%- endblock title -%} |
95
e4ffb56efd4e
blog/articles: if only one item is shown, use it's title or content as page title.
Goffi <goffi@goffi.org>
parents:
93
diff
changeset
|
14 |
0 | 15 {% block body %} |
16 <div id="blog_items"> | |
49
f19e9f5e43b0
blog: moved items rendering to a macro + handle new date filter + handle identities
Goffi <goffi@goffi.org>
parents:
43
diff
changeset
|
17 {{ blog.show_items(items) }} |
0 | 18 </div> |
93
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
19 <nav class="bottom_links"> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
20 <ul> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
21 {% if newer_url is defined %} |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
22 <li class="newer_items"> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
23 <a href="{{newer_url}}"> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
24 <img src="{{media_path}}icons/tango/actions/32/go-previous.png"> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
25 {% trans %}newer articles{% endtrans %} |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
26 </a> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
27 </li> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
28 {% endif %} |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
29 {% if older_url is defined %} |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
30 <li class="older_items"> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
31 <a href="{{older_url}}"> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
32 <img src="{{media_path}}icons/tango/actions/32/go-next.png"> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
33 {% trans %}older articles{% endtrans %} |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
34 </a> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
35 </li> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
36 {% endif %} |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
37 </ul> |
650f3456f80d
blog/articles: added simple pagination
Goffi <goffi@goffi.org>
parents:
49
diff
changeset
|
38 </nav> |
0 | 39 {% endblock body %} |