]> git.parisson.com Git - mezzo.git/commitdiff
Update team person list place
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 8 Nov 2016 10:19:13 +0000 (11:19 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 8 Nov 2016 10:19:13 +0000 (11:19 +0100)
app/organization/core/templatetags/organization_tags.py
app/templates/pages/page.html
app/templates/pages/teampage.html

index b5099c1aa0aa4ff295b2c04447829282309ac5f8..9304850249f7032dc8e186636985472ee9e117b7 100644 (file)
@@ -141,3 +141,18 @@ def get_team_persons(team, status):
         if not activity.person in persons:
             persons.append(activity.person)
     return persons
+
+@register.filter
+def slice_ng(qs, indexes):
+    list = []
+    for obj in qs:
+        list.append(obj)
+    index_split = indexes.split(':')
+    index_1 = int(index_split[0])
+    index_2 = 0
+    if len(index_split) > 1:
+        index_2 = int(index_split[1])
+    if index_1 > 0 and index_2:
+        return list[index_1:index_2]
+    else:
+        return [list[index_1]]
index 3f59429eca204605cb268591f37c12f29863a4a3..074a04ceb9fec4f0d705849658bd4cd350d11879 100644 (file)
                 {% endif %}
             {% endblock %}
 
-            {% block page_person_list_team %}
+            {% block page_sub_content_2 %}
             {% endblock %}
 
-            {% block page_sub_content_2 %}
+            {% block page_person_list_team %}
             {% endblock %}
 
+            {% block page_sub_content_3 %}
+            {% endblock %}
+            
             {% block logo %}
                 {% with page.images.all|get_type:'logo' as images %}
                     {% if images %}
index 766f43eb04a4b0e7271c3932bf7bc852c2038c17..555e0b3afae2a9392c50134adf9affc2bc843d5c 100644 (file)
     {% endwith %}
 {% endblock %}
 
-{% block page_person_list %}
-    {% activity_statuses as statuses %}
-    {% if statuses|length > 0 %}
-        <div class="page__block page__block--yellow">
-        {# <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" data-summary-content>
-                        <h2 class="dotted">{% trans 'Team' %}</h2><br>
-                        {% for status in statuses %}
-                            {% with page.teampage.team|get_team_persons:status as persons %}
-                                {% if persons %}
-                                    <strong>{{ status.name }} : </strong>
-                                    {% for person in persons %}
-                                        <a href="{% url 'organization-network-person-detail' person.slug %}">{{ person.title }}</a>{% if not forloop.last %}, {% endif %}
-                                    {% endfor %}
-                                    <br/>
-                                {% endif %}
-                            {% endwith %}
-                        {% endfor %}
-                    </div>
-                </div>
-            </div>
-        </div>
-    {% endif %}
-{% endblock %}
-
 {% block related_project %}
     {% if page.teampage.team.leader_projects.published or page.teampage.team.partner_projects.published %}
         <div class="white-bg pb2">
     {% endif %}
 {% endblock %}
 
+
 {% block page_sub_content_2 %}
-    {% with page.blocks.all|slice:'1:' as blocks %}
+    {% with page.blocks.all|slice_ng:'1:-2' as blocks %}
+        {% include "core/inc/block.html" %}
+    {% endwith %}
+{% endblock %}
+
+{% block page_person_list_team %}
+    {% activity_statuses as statuses %}
+    {% if statuses|length > 0 %}
+        <div class="page__block page__block--yellow">
+        {# <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" data-summary-content>
+                        <h2 class="dotted">{% trans 'Team' %}</h2><br>
+                        {% for status in statuses %}
+                            {% with page.teampage.team|get_team_persons:status as persons %}
+                                {% if persons %}
+                                    <strong>{{ status.name }} : </strong>
+                                    {% for person in persons %}
+                                        <a href="{% url 'organization-network-person-detail' person.slug %}">{{ person.title }}</a>{% if not forloop.last %}, {% endif %}
+                                    {% endfor %}
+                                    <br/>
+                                {% endif %}
+                            {% endwith %}
+                        {% endfor %}
+                    </div>
+                </div>
+            </div>
+        </div>
+    {% endif %}
+{% endblock %}
+
+{% block page_sub_content_3 %}
+    {% with page.blocks.all|slice_ng:'-1' as blocks %}
         {% include "core/inc/block.html" %}
     {% endwith %}
 {% endblock %}