Mercurial > libervia-templates
annotate sat_templates/templates/bulma/blog/articles.html @ 278:672b6137ef29
bulma (components): template for the alternative media player
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 15 Aug 2020 16:40:29 +0200 |
parents | 40fccd3b7cf0 |
children | fbea1b9a558f |
rev | line source |
---|---|
230 | 1 {# blog_page indicate if blog is included in an other page or if it is the main one #} |
2 {% if not embedded %}{% extends 'base/base.html' %}{% set blog_page = True %}{% endif %} | |
247
40fccd3b7cf0
updated code to handle blog items following data structure change in backend/Libervia
Goffi <goffi@goffi.org>
parents:
246
diff
changeset
|
3 {% set single = blog_items['items']|length == 1 %} |
230 | 4 {% set dates_format='relative' if single else 'short' %} |
5 {% import 'components/avatar.html' as avatar with context %} | |
6 {% import 'blog/macros.html' as blog with context %} | |
7 {% import 'input/navigation.html' as navigation with context %} | |
8 | |
9 {%- block title scoped -%} | |
10 {%- if blog_page -%} | |
11 {%- if single -%} | |
247
40fccd3b7cf0
updated code to handle blog items following data structure change in backend/Libervia
Goffi <goffi@goffi.org>
parents:
246
diff
changeset
|
12 {{- blog_items['items'][0].title|default(blog_items['items'][0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} |
230 | 13 {%- else -%} |
14 {{C.APP_NAME}} | |
15 {# {{- super() -}} | |
16 FIXME: super() is failing if blog is embedded (i.e. base/base.html is not its direct parent) | |
17 not sure what's the best way to avoid that, so just using C.APP_NAME for now #} | |
18 {%- endif -%} | |
19 {%- endif -%} | |
20 {%- endblock title -%} | |
21 | |
22 {% block body %} | |
247
40fccd3b7cf0
updated code to handle blog items following data structure change in backend/Libervia
Goffi <goffi@goffi.org>
parents:
246
diff
changeset
|
23 |
40fccd3b7cf0
updated code to handle blog items following data structure change in backend/Libervia
Goffi <goffi@goffi.org>
parents:
246
diff
changeset
|
24 {% if blog_items['items'] %} |
246
1928ba66c194
bulma: replaced custom styles by new spacing helpers
Goffi <goffi@goffi.org>
parents:
230
diff
changeset
|
25 <div class="container mt-4"> |
230 | 26 <div id="blog_items" class="columns"> |
27 <div class="column"> | |
247
40fccd3b7cf0
updated code to handle blog items following data structure change in backend/Libervia
Goffi <goffi@goffi.org>
parents:
246
diff
changeset
|
28 {{ blog.show_items(blog_items['items'], expanded=single) }} |
230 | 29 </div> |
30 </div> | |
31 </div> | |
32 {% else %} | |
246
1928ba66c194
bulma: replaced custom styles by new spacing helpers
Goffi <goffi@goffi.org>
parents:
230
diff
changeset
|
33 <div class="message mt-4"> |
230 | 34 <div class="message-body"> |
35 {% trans %}No articles found in this blog!{% endtrans %} | |
36 </div> | |
37 </div> | |
38 {% endif %} | |
39 | |
40 {{ navigation.prev_next(_("newer articles"), _("older articles")) }} | |
41 {% endblock body %} |