From 653f8a457bcca7fe0036f3917414c05e92e3832d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt?= <b.charpentier@webu.coop> Date: Fri, 14 Apr 2017 12:43:56 +0200 Subject: [PATCH] update list and list_item html --- .../templates/newsbox_cms/inc/list.html | 22 ++++++++++++++++--- .../templates/newsbox_cms/inc/list_item.html | 10 +++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/newsbox_cms/templates/newsbox_cms/inc/list.html b/newsbox_cms/templates/newsbox_cms/inc/list.html index 67b5b7f..e2a08e2 100644 --- a/newsbox_cms/templates/newsbox_cms/inc/list.html +++ b/newsbox_cms/templates/newsbox_cms/inc/list.html @@ -3,6 +3,22 @@ {% block newsbox_list_header %} - {% render_model_add model %} - {{ block.super }} -{% endblock %} \ No newline at end of file + {% if title %} + <header> + <h1> + {% if title_url %} + <a href="{{ title_url }}">{{ title }}</a> + {% else %} + {{ title }} + {% endif %} + {% render_model_add model %} + </h1> + </header> + {% endif %} +{% endblock %} + +{% block newsbox_list_item %} + {% render_model_block object %} + {{ block.super }} + {% endrender_model_block %} +{% endblock %} diff --git a/newsbox_cms/templates/newsbox_cms/inc/list_item.html b/newsbox_cms/templates/newsbox_cms/inc/list_item.html index db64463..4f85950 100644 --- a/newsbox_cms/templates/newsbox_cms/inc/list_item.html +++ b/newsbox_cms/templates/newsbox_cms/inc/list_item.html @@ -2,8 +2,14 @@ {% load i18n cms_tags %} {% block newsbox_list_item_header %} - {% render_model_icon object %} - {{ block.super }} + <h1> + <a href="{{ object.get_absolute_url }}"> + {{ object.newsbox_title }} + </a> + {% if object.newsbox_date and object.newsbox_date != object.newsbox_publication_start_date %} + <time datetime="{{ object.newsbox_date }}">{{ object.newsbox_date|date:'SHORT_DATE_FORMAT' }}</time> + {% endif %} + </h1> {% endblock %} -- GitLab