diff --git a/templates/article.html b/templates/article.html new file mode 100644 index 0000000..853368e --- /dev/null +++ b/templates/article.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} +{% block content %} +
+
+

Par + {% for author in article.authors %} + {{ author }} + {% endfor %} + dans {{ article.category }} le {{ article.date.strftime('%d/%m/%Y') }}. +

+
+

{{ article.title }}

+ {% if article.subtitle %} +

{{ article.subtitle }}

+ {% endif %} +
+
+ {{ article.content }} +
+
+ +{% endblock content %} diff --git a/templates/category.html b/templates/category.html new file mode 100644 index 0000000..2e1888b --- /dev/null +++ b/templates/category.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% import "macros.html" as macro %} +{% block content %} +
+

{{ category.name }}

+
+
+ +{{ macro.listArticles(articles_page.object_list) }} + +{% endblock content %} diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..dfa5acf --- /dev/null +++ b/templates/macros.html @@ -0,0 +1,20 @@ +{% macro listArticles(objIt) -%} +{% for art in objIt %} +
+

Par + {% for author in art.authors %} + {{ author }} + {% endfor %} + dans {{ art.category }} le {{ art.date.strftime('%d/%m/%Y') }}. +

+
+ +

{{ art.title }}

+
+
+ {{ art.summary }} +
+ Continuer à lire +
+{% endfor %} +{%- endmacro %}