From 97b9bce6385f62c4a87c2092e1901768908b7881 Mon Sep 17 00:00:00 2001 From: Rick Date: Sun, 31 Jan 2021 12:09:36 +0100 Subject: [PATCH] Ajout de la pagination --- static/css/style.css | 32 ++++++++++++++++++++++++++++++++ templates/author.html | 1 + templates/category.html | 2 +- templates/index.html | 1 + templates/macros.html | 12 ++++++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/static/css/style.css b/static/css/style.css index e6c48d5..8df1e3a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -54,10 +54,28 @@ a { color: white; } +a:hover { + color: #121224; + background-color: white; +} + h1, h2, h3, h4, h5, h6 { font-family: 'Open Sans', sans-serif; } +#base-pagenation { + margin-left: 20%; + margin-right: 20%; + margin-bottom: 2em; + display: flex; + justify-content: space-between; + align-self: flex-end; +} + +#base-next { + text-align: right; +} + /* Parametres pour macro de prévisualisation d’articles */ .pre-art * { @@ -89,11 +107,21 @@ h1, h2, h3, h4, h5, h6 { text-decoration: none; } +.author:hover { + color: #121224; + background-color: #6A89CC; +} + .category:link { color: #2DCF29; text-decoration: none; } +.category:hover { + color: #121224; + background-color: #2DCF29; +} + .continue:link { background-color: #3C5DA4; border-radius: 50px; @@ -208,6 +236,10 @@ pre * { margin-right: 20px; } +[class^="icone-"]:hover { + color:grey; +} + .icone-mastodon:before { content: "\e900"; } diff --git a/templates/author.html b/templates/author.html index 4a21fdf..6bada2f 100644 --- a/templates/author.html +++ b/templates/author.html @@ -17,5 +17,6 @@ {{ macro.listArticles(articles_page.object_list) }} + {{ macro.paginationArt(articles_previous_page, articles_next_page) }} {% endblock content %} diff --git a/templates/category.html b/templates/category.html index 2e1888b..43599c9 100644 --- a/templates/category.html +++ b/templates/category.html @@ -7,5 +7,5 @@ {{ macro.listArticles(articles_page.object_list) }} - +{{ macro.paginationArt(articles_previous_page, articles_next_page) }} {% endblock content %} diff --git a/templates/index.html b/templates/index.html index 210d52a..b1805fe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,5 +3,6 @@ {% block content %} {{ macro.listArticles(articles_page.object_list) }} +{{ macro.paginationArt(articles_previous_page, articles_next_page) }} {% endblock content %} diff --git a/templates/macros.html b/templates/macros.html index dfa5acf..faff043 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -18,3 +18,15 @@ {% endfor %} {%- endmacro %} + +{% macro paginationArt(prev, next) -%} +
+ {% if prev is not none %} +

Articles récents

+ {% endif %} + + {% if next is not none %} +

Ancients articles

+ {% endif %} +
+{%- endmacro %}