From: Emilie Date: Thu, 1 Dec 2016 16:53:01 +0000 (+0100) Subject: Limit related organization to research X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=47f1b35fa655b43b782bb4f630b3041ad3d443cb;p=mezzo.git Limit related organization to research --- diff --git a/app/organization/core/context_processors.py b/app/organization/core/context_processors.py index 85c6d374..74ddab52 100644 --- a/app/organization/core/context_processors.py +++ b/app/organization/core/context_processors.py @@ -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 } diff --git a/app/templates/pages/departmentpage.html b/app/templates/pages/departmentpage.html index 8c8b3688..30b6a463 100644 --- a/app/templates/pages/departmentpage.html +++ b/app/templates/pages/departmentpage.html @@ -25,8 +25,7 @@ {% endeditable %} {% endif %}--> - - {% if LINKED_ORGA_CONTENT %} + {% if LINKED_ORGA_CONTENT and RESEARCH_SLUG == page.departmentpage.slug %} {% include 'core/inc/linked_organization_content.html' %} {% endif %} diff --git a/app/templates/pages/projecttopicpage.html b/app/templates/pages/projecttopicpage.html index 3f644845..c4755d6e 100644 --- a/app/templates/pages/projecttopicpage.html +++ b/app/templates/pages/projecttopicpage.html @@ -34,10 +34,12 @@ {% 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 %}
diff --git a/app/templates/pages/teampage.html b/app/templates/pages/teampage.html index 2e90fc67..46254fcf 100644 --- a/app/templates/pages/teampage.html +++ b/app/templates/pages/teampage.html @@ -20,11 +20,11 @@ {% 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 %}
diff --git a/app/templates/projects/project_detail.html b/app/templates/projects/project_detail.html index 61cec702..ab4f945e 100644 --- a/app/templates/projects/project_detail.html +++ b/app/templates/projects/project_detail.html @@ -45,9 +45,11 @@

{{ project.title }}

{% 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 %}