Mercurial > libervia-templates
diff sat_templates/templates/bulma/blog/articles.html @ 230:0e69b5843c2f
theme: bulma theme first draft:
This theme uses the Bulma CSS framework, Brython to handle the menu on touch devices, and
Sass to customize Bulma. CSS default fallbacks are disabled as Bulma uses its own naming
conventions, and default fallbacks would lead to hard to debug conflicts.
`common.js` has been slightly improved to handle custom classed in `tab_select`
The theme is not complete yet, but it is functional.
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 19 May 2020 00:02:34 +0200 |
parents | |
children | 1928ba66c194 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/blog/articles.html Tue May 19 00:02:34 2020 +0200 @@ -0,0 +1,40 @@ +{# blog_page indicate if blog is included in an other page or if it is the main one #} +{% if not embedded %}{% extends 'base/base.html' %}{% set blog_page = True %}{% endif %} +{% set single = items|length == 1 %} +{% set dates_format='relative' if single else 'short' %} +{% import 'components/avatar.html' as avatar with context %} +{% import 'blog/macros.html' as blog with context %} +{% import 'input/navigation.html' as navigation with context %} + +{%- block title scoped -%} + {%- if blog_page -%} + {%- if single -%} + {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} + {%- else -%} + {{C.APP_NAME}} + {# {{- super() -}} + FIXME: super() is failing if blog is embedded (i.e. base/base.html is not its direct parent) + not sure what's the best way to avoid that, so just using C.APP_NAME for now #} + {%- endif -%} + {%- endif -%} +{%- endblock title -%} + +{% block body %} +{% if items %} + <div class="container has-margin-top-1"> + <div id="blog_items" class="columns"> + <div class="column"> + {{ blog.show_items(items, expanded=single) }} + </div> + </div> + </div> +{% else %} + <div class="message has-margin-top-1"> + <div class="message-body"> + {% trans %}No articles found in this blog!{% endtrans %} + </div> + </div> +{% endif %} + +{{ navigation.prev_next(_("newer articles"), _("older articles")) }} +{% endblock body %}