]> git.parisson.com Git - mezzo.git/commitdiff
add event tags filters
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 2 May 2016 13:47:08 +0000 (15:47 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 2 May 2016 13:47:08 +0000 (15:47 +0200)
app/templates/agenda/event_list.html
app/templates/blog/blog_post_list.html

index 3b1f660827972296c3891dce407c14b8414ca1bc..1cbbbbf7ae80c5f3121c88d97b71fb2c4538bb5a 100644 (file)
@@ -42,6 +42,8 @@
 {% endblock %}
 
 {% block main %}
+
+{% comment %}
 {% if tag or location or year or month or author %}
     {% block event_list_filterinfo %}
     <p>
@@ -62,7 +64,9 @@
     {% endblock %}
     </p>
 {% else %}
-    {% if page %}
+{% endcomment %}
+
+{% if page %}
     {% block event_list_pagecontent %}
     {{ page.richtextpage.content|richtext_filters|safe }}
     {% endblock %}
 
     {% block event_keywords %}
     {% keywords_for mezzanine_agenda.event as tags %}
+    {% all_events as all_events %}
     {% if tags %}
 
     <ul class="list-inline tag-cloud">
-    {% for tag in tags %}
-    <li>
-        <a href="{% url "event_list_tag" tag.slug %}"
-            class="tag-weight-{{ tag.weight }}">{{ tag }}s</a>
-        ({{ tag.item_count }})
-    </li>
-    {% endfor %}
+        <li>
+            <a href="/events/" {% if not tag %}class="is-active"{% endif %}>{% trans "All" %}</a> ({{ all_events.count }})
+        </li>
+        {% for t in tags %}
+        <li>
+            <a href="{% url "event_list_tag" t.slug %}" {% if tag == t %}class="is-active"{% endif %}
+                class="tag-weight-{{ tag.weight }}">{{ t }}s</a>
+            ({{ t.item_count }})
+        </li>
+        {% endfor %}
     </ul>
     <br/>
     {% endif %}
     {% endblock %}
-
-    {% endif %}
 {% endif %}
+{# {% endif %}#}
 
 <div class="msry__container">
     <div class="msry__sizer">
index cd2184e67658ac31f0e4fa8835b076f0fac35823..924788b35fbc763ad807a7387e79df16c780d77f 100644 (file)
 
 {% 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 %}
-        <ul class="list-inline tag-cloud">
-        {% for cat in categories %}
-         <li>
-          <a href="{% url "blog_post_list_category" cat.slug %}" {% if category == cat %}class="is-active"{% endif %}>{{ cat }}</a> ({{ cat.post_count }})
-         </li>
-        {% endfor %}
-        </ul>
-        <br/>
-        {% endif %}
+{% comment %}
+{% if tag or category or year or month or author %}
+    {% block blog_post_list_filterinfo %}
+    <p>
+    {% if tag %}
+        {% trans "Viewing posts tagged" %} {{ tag }}
+    {% else %}{% if category %}
+        {% trans "Viewing posts for the category" %} <a href="{% url "blog_post_list_category" category.slug %}">{{ category }}</a>
+    {% 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 %}
+    </p>
+{% 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 %}
+    <ul class="list-inline tag-cloud">
+    {% for cat in categories %}
+     <li>
+      <a href="{% url "blog_post_list_category" cat.slug %}" {% if category == cat %}class="is-active"{% endif %}>{{ cat }}</a> ({{ cat.post_count }})
+     </li>
+    {% endfor %}
+    </ul>
+    <br/>
     {% endif %}
+{# {% endif %}#}
+
+{% endif %}
 
 <div class="msry__container">
   <div class="msry__sizer"></div>