changeset 11:87262027cbf5

news: use pagination and search box as in Libervia Web's blog
author Goffi <goffi@goffi.org>
date Fri, 23 Apr 2021 11:04:36 +0200
parents 0e9e97777fe0
children 0d6ae55579a5
files templates/default/news/news.html
diffstat 1 files changed, 28 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/templates/default/news/news.html	Fri Apr 23 11:04:23 2021 +0200
+++ b/templates/default/news/news.html	Fri Apr 23 11:04:36 2021 +0200
@@ -1,9 +1,34 @@
 {% if not embedded %}{% extends 'base/base.html' %}{% endif %}
 {% import 'blog/macros.html' as blog with context %}
+{% import 'input/navigation.html' as navigation with context %}
+{% import 'input/textbox.html' as textbox with context %}
 
 {% block body %}
 <h1 class="title has-text-centered">{% trans %}Libervia News{% endtrans %}</h1>
-<div id="blog_items">
-    {{ blog.show_items(blog_items['items']) }}
-</div>
+{% if blog_items['items'] %}
+    <div class="container mt-4">
+        <nav class="level mb-4">
+            <div class="level-left">
+            </div>
+            <div class="level-right">
+                <div class="level-item">
+                    {{ textbox.search() }}
+                </div>
+            </div>
+        </nav>
+        <div id="blog_items" class="columns">
+            <div class="column">
+                {{ blog.show_items(blog_items['items'], expanded=single) }}
+            </div>
+        </div>
+    </div>
+{% else %}
+    <div class="message mt-4">
+        <div class="message-body">
+            {% trans %}No articles found in this blog!{% endtrans %}
+        </div>
+    </div>
+{% endif %}
+
+{{ navigation.prev_next(_("newer articles"), _("older articles")) }}
 {% endblock body %}