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 %} |
|
3 {% set single = items|length == 1 %} |
|
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 -%} |
|
12 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} |
|
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 %} |
|
23 {% if items %} |
|
24 <div class="container has-margin-top-1"> |
|
25 <div id="blog_items" class="columns"> |
|
26 <div class="column"> |
|
27 {{ blog.show_items(items, expanded=single) }} |
|
28 </div> |
|
29 </div> |
|
30 </div> |
|
31 {% else %} |
|
32 <div class="message has-margin-top-1"> |
|
33 <div class="message-body"> |
|
34 {% trans %}No articles found in this blog!{% endtrans %} |
|
35 </div> |
|
36 </div> |
|
37 {% endif %} |
|
38 |
|
39 {{ navigation.prev_next(_("newer articles"), _("older articles")) }} |
|
40 {% endblock body %} |