]> git.parisson.com Git - mezzo.git/commitdiff
Limit related organization to research
authorEmilie <zawadzki@ircam.fr>
Thu, 1 Dec 2016 16:53:01 +0000 (17:53 +0100)
committerEmilie <zawadzki@ircam.fr>
Thu, 1 Dec 2016 16:53:01 +0000 (17:53 +0100)
app/organization/core/context_processors.py
app/templates/pages/departmentpage.html
app/templates/pages/projecttopicpage.html
app/templates/pages/teampage.html
app/templates/projects/project_detail.html

index 85c6d3749076a48da6baf7560b7469d8d3458d02..74ddab52a4ff7ef116319c8c364f8bdd976606c2 100644 (file)
@@ -19,10 +19,13 @@ def settings(request):
     host_organization = Organization.objects.get(is_host=True)
     linked_organizations_content = host_organization.organizations_content.all()
     linked_organizations_footer = host_organization.organizations_footer.all()
+    research_slug = "recherche"
+
     return {'CURRENT_SEASON': CURRENT_SEASON,
             'CURRENT_SEASON_STYLED': CURRENT_SEASON_STYLED,
             'NEWSLETTER_SUBSCRIBING_URL': NEWSLETTER_SUBSCRIBING_URL,
             'host_organization': host_organization,
             'LINKED_ORGA_CONTENT' : linked_organizations_content,
-            'LINKED_ORGA_FOOTER' : linked_organizations_footer
+            'LINKED_ORGA_FOOTER' : linked_organizations_footer,
+            'RESEARCH_SLUG' : research_slug
             }
index 8c8b3688593c4e88e95c417364062dad6fc8a49f..30b6a4639a92d778ade457a77cca8eda6e56f00d 100644 (file)
@@ -25,8 +25,7 @@
             </div>
         {% endeditable %}
     {% endif %}-->
-
-    {% if LINKED_ORGA_CONTENT %}
+    {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == page.departmentpage.slug %}
         {% include 'core/inc/linked_organization_content.html' %}
     {% endif %}
 
index 3f6448451f4bf2474b58db658bea84682ec48068..c4755d6ea89a5a335b81d4e7be3c1d0b87a427e1 100644 (file)
 {% endblock %}
 
 {% block page_content %}
-    {% if LINKED_ORGA_CONTENT %}
-        {% include 'core/inc/linked_organization_content.html' %}
-    {% endif %}
-    
+    {% with page.get_ascendants|last as top_level_parent %}
+        {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == top_level_parent.slug %}
+            {% include 'core/inc/linked_organization_content.html' %}
+        {% endif %}
+    {% endwith %}
+
     {% if page.projecttopicpage.sub_title %}
         {% editable page.projecttopicpage.sub_title %}
             <div class="chapo">
index 2e90fc671f49bc725c4789e548648bce489a188c..46254fcf4433361bda2e98af312b019d2954a896 100644 (file)
 {% endblock %}
 
 {% block page_content %}
-
-    {% if LINKED_ORGA_CONTENT %}
-        {% include 'core/inc/linked_organization_content.html' %}
-    {% endif %}
-
+    {% with page.get_ascendants|last as top_level_parent %}
+        {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == top_level_parent.slug %}
+            {% include 'core/inc/linked_organization_content.html' %}
+        {% endif %}
+    {% endwith %}
     {% if page.teampage.sub_title %}
         {% editable page.teampage.sub_title %}
             <div class="chapo">
index 61cec702b9a4c6385064de929839a1eb07787c00..ab4f945e2dae70ff7f2630b3c4b3e1f9aee94475 100644 (file)
         <h1 class="dotted">{{ project.title }}</h1>
     {% endeditable %}
 
-    {% if LINKED_ORGA_CONTENT %}
-        {% include 'core/inc/linked_organization_content.html' %}
-    {% endif %}
+    {% with page.get_ascendants|last as top_level_parent %}
+        {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == top_level_parent.slug %}
+            {% include 'core/inc/linked_organization_content.html' %}
+        {% endif %}
+    {% endwith %}
 
     {% if project.description %}
         {% editable project.description %}