]> git.parisson.com Git - mezzo.git/commitdiff
Task #308: display projects if exist
authorEmilie <zawadzki@ircam.fr>
Wed, 26 Oct 2016 09:56:13 +0000 (11:56 +0200)
committerEmilie <zawadzki@ircam.fr>
Wed, 26 Oct 2016 09:56:13 +0000 (11:56 +0200)
app/templates/pages/teampage.html

index 360db78efd51cc6e483f41d0396bd8bfbfb56f2f..de3ea921a908793566461204e48d9b5086673674 100644 (file)
         <div class="white-bg pb2">
             <hr class="mt0" />
             <div class="container">
-                <div class="row">
-                    <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg" data-summary-content>
-                        <h2>{% trans "Research topics and related projects" %}</h2>
-                        {% with page.teampage.team.partner_projects.all|get_type:"internal" as projects %}
-                            {% include 'projects/inc/project_list.html' %}
-                        {% endwith %}
-                    </div>
-                </div>
+                {% with page.teampage.team.partner_projects.all|get_type:"internal" as projects %}
+                    {% if projects %}
+                        <div class="row">
+                            <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg" data-summary-content>
+                                <h2>{% trans "Research topics and related projects" %}</h2>
+                                    {% include 'projects/inc/project_list.html' %}
+                            </div>
+                        </div>
+                    {% endif %}
+                {% endwith %}
+                {% with page.teampage.team.leader_projects.all|get_type:"external" as leader_projects %}
+                {% with page.teampage.team.partner_projects.all|get_type:"external" as partner_projects %}
+                {% if leader_projects or partner_projects %}
                 <div class="row">
                     <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg" data-summary-content>
                         <h2>{% trans "European and national projects" %}</h2>
-                        {% with page.teampage.team.leader_projects.all|get_type:"external" as projects %}
+                        {% with leader_projects as projects %}
                             {% include 'projects/inc/project_list.html' %}
                         {% endwith %}
-                        {% with page.teampage.team.partner_projects.all|get_type:"external" as projects %}
+                        {% with partner_projects as projects %}
                             {% include 'projects/inc/project_list.html' %}
                         {% endwith %}
                     </div>
                 </div>
+                {% endif %}
+                {% endwith %}
+                {% endwith %}
             </div>
         </div>
     {% endif %}