]> git.parisson.com Git - mezzo.git/commitdiff
Menus in project page
authorEmilie <zawadzki@ircam.fr>
Wed, 28 Sep 2016 16:46:57 +0000 (18:46 +0200)
committerEmilie <zawadzki@ircam.fr>
Wed, 28 Sep 2016 16:46:57 +0000 (18:46 +0200)
app/organization/projects/views.py
app/templates/projects/project_detail.html

index a1e7c31007652749ca2032132f892a109558500a..bbbbb7882239909170a3d850ae9b9f4372198964 100644 (file)
@@ -25,4 +25,8 @@ class ProjectDetailView(SlugMixin, DetailView):
                     break
 
         context['department'] = department
+        if project.topic and project.topic.parent:
+            context['page'] = project.topic.parent.pages.all().first()
+        elif project.topic:
+            context['page'] = roject.topic.pages.all().first()
         return context
index 910ee260e547ec3cc5b65d521de5c9e50dfebd9d..98755f3ddcbc8f5e4b976697d965ceffe798ea98 100644 (file)
     {% if project.content %}
         {{ project.content|richtext_filters|safe }}
     {% endif %}
+    {{ page_branch }}
 
 {% endblock %}
 
 {% block page_sidebar %}
-    {% if project.topic and project.topic.parent %}
-        {% page_menu "pages/menus/current_tree_secondary.html" project.topic.parent.pages.all.0 %}
-    {% elif project.topic %}
-        {% page_menu "pages/menus/current_tree_secondary.html" project.topic.pages.all.0 %}
-    {% endif %}
+    {{ block.super }}
 {% endblock %}
 
 {% block page_link %}