From dd35e6362147e99bc56924855b20d5da04667489 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Je=CC=81re=CC=81my=20Fabre?= Date: Wed, 22 Feb 2017 14:30:11 +0100 Subject: [PATCH] Exclude events from related content, move them to another container --- app/templates/agenda/event_base.html | 2 +- app/templates/agenda/event_detail.html | 2 +- app/templates/core/inc/related_content.html | 27 ++++++++++++++++++-- app/templates/pages/custompage.html | 5 +--- app/templates/pages/mutations-creations.html | 6 +++++ app/templates/pages/page.html | 2 +- app/templates/projects/project_detail.html | 2 +- 7 files changed, 36 insertions(+), 10 deletions(-) diff --git a/app/templates/agenda/event_base.html b/app/templates/agenda/event_base.html index a089ef53..3710af03 100644 --- a/app/templates/agenda/event_base.html +++ b/app/templates/agenda/event_base.html @@ -149,7 +149,7 @@
{% block page_related_content %} - {% with dynamic_content=page.dynamic_content_pages.all object=page %} + {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %} {% include "core/inc/related_content.html" %} {% endwith %} {% endblock %} diff --git a/app/templates/agenda/event_detail.html b/app/templates/agenda/event_detail.html index ed7cdba6..9208ba77 100644 --- a/app/templates/agenda/event_detail.html +++ b/app/templates/agenda/event_detail.html @@ -146,7 +146,7 @@ {% endblock %} {% block page_related_content %} - {% with dynamic_content=event.dynamic_content_event.all object=event %} + {% with dynamic_content=event.dynamic_content_event.all|filter_content object=event %} {% include "core/inc/related_content.html" %} {% endwith %} {% endblock %} diff --git a/app/templates/core/inc/related_content.html b/app/templates/core/inc/related_content.html index 10956763..fd8f4502 100644 --- a/app/templates/core/inc/related_content.html +++ b/app/templates/core/inc/related_content.html @@ -1,5 +1,28 @@ {% load i18n mezzanine_tags keyword_tags organization_tags pages_tags %} -{% if dynamic_content.first.content_object %} + +{% if dynamic_content.event|length > 0 %} + +
+
+
+

{% trans "Linked events" %}

+
+
+
+
+ {% for content in dynamic_content.event %} + {% with event=content.content_object %} + {% include 'agenda/includes/event_linecard.html' %} + {% endwith %} + {% endfor %} +
+ +
+
+ +{% endif %} + +{% if dynamic_content.other|length > 0 %}
@@ -11,7 +34,7 @@
- {% for content in dynamic_content %} + {% for content in dynamic_content.other %} {% if forloop.counter0 == 0 or forloop.counter|divisibleby:3 %}
diff --git a/app/templates/pages/custompage.html b/app/templates/pages/custompage.html index 8ded5a88..cc0110fd 100644 --- a/app/templates/pages/custompage.html +++ b/app/templates/pages/custompage.html @@ -94,10 +94,7 @@ {% endblock %} {% block page_related_content %} - {% with dynamic_content=page.dynamic_content_pages.all object=page %} - {# with dynamic_content=page.dynamic_content_pages.all|filter_content object=page #} - {# dynamic_content.event #} - {# dynamic_content.other #} + {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %} {% include "core/inc/related_content.html" %} {% endwith %} {% endblock %} diff --git a/app/templates/pages/mutations-creations.html b/app/templates/pages/mutations-creations.html index e39b3994..4d5f352e 100644 --- a/app/templates/pages/mutations-creations.html +++ b/app/templates/pages/mutations-creations.html @@ -97,4 +97,10 @@ {% endwith %} {% endblock %} + {% block page_related_content %} + {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %} + {% include "core/inc/related_content.html" %} + {% endwith %} + {% endblock %} + {% endwith %} diff --git a/app/templates/pages/page.html b/app/templates/pages/page.html index 67d080ad..3e3fd0b7 100644 --- a/app/templates/pages/page.html +++ b/app/templates/pages/page.html @@ -163,7 +163,7 @@
{% block page_related_content %} - {% with dynamic_content=page.dynamic_content_pages.all object=page %} + {% with dynamic_content=page.dynamic_content_pages.all|filter_content object=page %} {% include "core/inc/related_content.html" %} {% endwith %} {% endblock %} diff --git a/app/templates/projects/project_detail.html b/app/templates/projects/project_detail.html index 72674f68..e426951c 100644 --- a/app/templates/projects/project_detail.html +++ b/app/templates/projects/project_detail.html @@ -345,7 +345,7 @@ {% endblock %} {% block page_related_content %} - {% with dynamic_content=object.dynamic_content_object.all object=object %} + {% with dynamic_content=object.dynamic_content_object.all|filter_content object=object %} {% include "core/inc/related_content.html" %} {% endwith %} {% endblock %} -- 2.39.5