From 6129af5f08c967980a7c62619a9aeecd8aa996ce Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 2 May 2016 15:47:08 +0200 Subject: [PATCH] add event tags filters --- app/templates/agenda/event_list.html | 27 +++++++----- app/templates/blog/blog_post_list.html | 57 ++++++++++++++++++-------- 2 files changed, 56 insertions(+), 28 deletions(-) diff --git a/app/templates/agenda/event_list.html b/app/templates/agenda/event_list.html index 3b1f6608..1cbbbbf7 100644 --- a/app/templates/agenda/event_list.html +++ b/app/templates/agenda/event_list.html @@ -42,6 +42,8 @@ {% endblock %} {% block main %} + +{% comment %} {% if tag or location or year or month or author %} {% block event_list_filterinfo %}

@@ -62,7 +64,9 @@ {% endblock %}

{% else %} - {% if page %} +{% endcomment %} + +{% if page %} {% block event_list_pagecontent %} {{ page.richtextpage.content|richtext_filters|safe }} {% endblock %} @@ -70,23 +74,26 @@ {% block event_keywords %} {% keywords_for mezzanine_agenda.event as tags %} + {% all_events as all_events %} {% if tags %}
{% endif %} {% endblock %} - - {% endif %} {% endif %} +{# {% endif %}#}
diff --git a/app/templates/blog/blog_post_list.html b/app/templates/blog/blog_post_list.html index cd2184e6..924788b3 100644 --- a/app/templates/blog/blog_post_list.html +++ b/app/templates/blog/blog_post_list.html @@ -43,25 +43,46 @@ {% block main %} - {% if page %} - {% if page.get_content_model.content %} - {% editable page.get_content_model.content %} - {{ page.get_content_model.content|richtext_filters|safe }} - {% endeditable %} - {% endif %} - {% else %} - {% blog_categories as categories %} - {% if categories %} -
    - {% for cat in categories %} -
  • - {{ cat }} ({{ cat.post_count }}) -
  • - {% endfor %} -
-
- {% endif %} +{% comment %} +{% if tag or category or year or month or author %} + {% block blog_post_list_filterinfo %} +

+ {% if tag %} + {% trans "Viewing posts tagged" %} {{ tag }} + {% else %}{% if category %} + {% trans "Viewing posts for the category" %} {{ category }} + {% else %}{% if year or month %} + {% trans "Viewing posts from" %} {% if month %}{{ month }}, {% endif %} + {{ year }} + {% else %}{% if author %} + {% trans "Viewing posts by" %} + {{ author.get_full_name|default:author.username }} + {% endif %}{% endif %}{% endif %}{% endif %} + {% endblock %} +

+{% else %} +{% endcomment %} +{% if page %} +{% if page.get_content_model.content %} + {% editable page.get_content_model.content %} + {{ page.get_content_model.content|richtext_filters|safe }} + {% endeditable %} +{% endif %} +{% else %} + {% blog_categories as categories %} + {% if categories %} +
    + {% for cat in categories %} +
  • + {{ cat }} ({{ cat.post_count }}) +
  • + {% endfor %} +
+
{% endif %} +{# {% endif %}#} + +{% endif %}
-- 2.39.5