annotate sat_templates/templates/bulma/blog/articles.html @ 325:8c779fb46384

bulma (components/block): interests_grid is more customisable: - new `delete_icon` argument can be set to `false` if delete icon is not desired - the macro can now be called, the caller then get 2 arguments: part to customise and current interest. Part to customise can be: * `header-title`: markup to put in the title * `content`: car content (replaces the default `interest.name`)
author Goffi <goffi@goffi.org>
date Sat, 01 May 2021 18:44:47 +0200
parents fbea1b9a558f
children 3db3509cbad1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 {# blog_page indicate if blog is included in an other page or if it is the main one #}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
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
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 {% set dates_format='relative' if single else 'short' %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 {% import 'components/avatar.html' as avatar with context %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 {% import 'blog/macros.html' as blog with context %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 {% import 'input/navigation.html' as navigation with context %}
296
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
8 {% import 'input/textbox.html' as textbox with context %}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 {%- block title scoped -%}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 {%- if blog_page -%}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 {%- 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
13 {{- blog_items['items'][0].title|default(blog_items['items'][0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 {%- else -%}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 {{C.APP_NAME}}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16 {# {{- super() -}}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 FIXME: super() is failing if blog is embedded (i.e. base/base.html is not its direct parent)
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
18 not sure what's the best way to avoid that, so just using C.APP_NAME for now #}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
19 {%- endif -%}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 {%- endif -%}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 {%- endblock title -%}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
23 {% 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
24
40fccd3b7cf0 updated code to handle blog items following data structure change in backend/Libervia
Goffi <goffi@goffi.org>
parents: 246
diff changeset
25 {% if blog_items['items'] %}
246
1928ba66c194 bulma: replaced custom styles by new spacing helpers
Goffi <goffi@goffi.org>
parents: 230
diff changeset
26 <div class="container mt-4">
296
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
27 <nav class="level mb-4">
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
28 <div class="level-left">
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
29 </div>
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
30 <div class="level-right">
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
31 <div class="level-item">
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
32 {{ textbox.search() }}
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
33 </div>
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
34 </div>
fbea1b9a558f bulma: new search box, used in blog for now
Goffi <goffi@goffi.org>
parents: 247
diff changeset
35 </nav>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
36 <div id="blog_items" class="columns">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
37 <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
38 {{ blog.show_items(blog_items['items'], expanded=single) }}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
39 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
40 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
42 {% else %}
246
1928ba66c194 bulma: replaced custom styles by new spacing helpers
Goffi <goffi@goffi.org>
parents: 230
diff changeset
43 <div class="message mt-4">
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
44 <div class="message-body">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
45 {% trans %}No articles found in this blog!{% endtrans %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
46 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
47 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
48 {% endif %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
49
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
50 {{ navigation.prev_next(_("newer articles"), _("older articles")) }}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
51 {% endblock body %}