From f49b1351160e2a309f57bca1e429077b1949a8ec Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 8 May 2013 19:50:04 +0200 Subject: Use uniform template for index category and tag page --- theme/templates/abstract.html | 19 +++++++++++++++++++ theme/templates/category.html | 11 ++--------- theme/templates/index.html | 28 ++++++++-------------------- theme/templates/tag.html | 15 +++++---------- 4 files changed, 34 insertions(+), 39 deletions(-) create mode 100644 theme/templates/abstract.html diff --git a/theme/templates/abstract.html b/theme/templates/abstract.html new file mode 100644 index 0000000..57ff2ab --- /dev/null +++ b/theme/templates/abstract.html @@ -0,0 +1,19 @@ +{% macro abstract(article, title_level) %} +
+ <{{title_level}} class="title">{{article.title }} + + + +
+ + {% if article.logo %} +
+ +
+ {% endif %} + + {{ article.summary }} +
+
+
+{% endmacro %} diff --git a/theme/templates/category.html b/theme/templates/category.html index a541a1c..f3588eb 100755 --- a/theme/templates/category.html +++ b/theme/templates/category.html @@ -5,18 +5,11 @@

Articles dans la catégorie « {{ category }} »

{% if articles %} {% for article in (articles_page.object_list if articles_page else articles) %} -
-

{{ article.title }}

- - -
- {{ article.summary }} -
+ {% import 'abstract.html' as abstract with context %} + {{ abstract.abstract(article, "h2") }} {% if not loop.last %}
{% endif %} -
-
{% endfor %} {% endif %} {% include 'navigator.html' %} diff --git a/theme/templates/index.html b/theme/templates/index.html index bf288a8..a54ae31 100755 --- a/theme/templates/index.html +++ b/theme/templates/index.html @@ -4,26 +4,14 @@ {% block content %} {% if articles %} {% for article in (articles_page.object_list if articles_page else articles) %} -
-

{{ article.title }}

- - - -
- - {% if article.logo %} -
- -
- {% endif %} - - {{ article.summary }} -
- {% if not loop.last %} -
- {% endif %} -
-
+ + {% import 'abstract.html' as abstract with context %} + {{ abstract.abstract(article, "h1") }} + + {% if not loop.last %} +
+ {% endif %} + {% endfor %} {% include 'navigator.html' %} diff --git a/theme/templates/tag.html b/theme/templates/tag.html index 059442a..101a22d 100755 --- a/theme/templates/tag.html +++ b/theme/templates/tag.html @@ -5,18 +5,13 @@

Articles avec le mot-clef « {{ tag }} »

{% if articles %} {% for article in (articles_page.object_list if articles_page else articles) %} -
-

{{ article.title }}

- + {% import 'abstract.html' as abstract with context %} + {{ abstract.abstract(article, "h2") }} -
- {{ article.summary }} -
- {% if not loop.last %} + {% if not loop.last %}
- {% endif %} -
-
+ {% endif %} + {% endfor %} {% endif %} {% include 'navigator.html' %} -- cgit v1.2.3