From: Guillaume Pellerin Date: Tue, 8 Nov 2016 10:19:13 +0000 (+0100) Subject: Update team person list place X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f87055fe7e5459770e464deb58dabedcd1ce9388;p=mezzo.git Update team person list place --- diff --git a/app/organization/core/templatetags/organization_tags.py b/app/organization/core/templatetags/organization_tags.py index b5099c1a..93048502 100644 --- a/app/organization/core/templatetags/organization_tags.py +++ b/app/organization/core/templatetags/organization_tags.py @@ -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]] diff --git a/app/templates/pages/page.html b/app/templates/pages/page.html index 3f59429e..074a04ce 100644 --- a/app/templates/pages/page.html +++ b/app/templates/pages/page.html @@ -130,12 +130,15 @@ {% 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 %} diff --git a/app/templates/pages/teampage.html b/app/templates/pages/teampage.html index 766f43eb..555e0b3a 100644 --- a/app/templates/pages/teampage.html +++ b/app/templates/pages/teampage.html @@ -74,33 +74,6 @@ {% endwith %} {% endblock %} -{% block page_person_list %} - {% activity_statuses as statuses %} - {% if statuses|length > 0 %} -
- {#
#} -
-
-
-

{% trans 'Team' %}


- {% for status in statuses %} - {% with page.teampage.team|get_team_persons:status as persons %} - {% if persons %} - {{ status.name }} : - {% for person in persons %} - {{ person.title }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
- {% endif %} - {% endwith %} - {% endfor %} -
-
-
-
- {% endif %} -{% endblock %} - {% block related_project %} {% if page.teampage.team.leader_projects.published or page.teampage.team.partner_projects.published %}
@@ -138,8 +111,42 @@ {% 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 %} +
+ {#
#} +
+
+
+

{% trans 'Team' %}


+ {% for status in statuses %} + {% with page.teampage.team|get_team_persons:status as persons %} + {% if persons %} + {{ status.name }} : + {% for person in persons %} + {{ person.title }}{% if not forloop.last %}, {% endif %} + {% endfor %} +
+ {% endif %} + {% endwith %} + {% endfor %} +
+
+
+
+ {% endif %} +{% endblock %} + +{% block page_sub_content_3 %} + {% with page.blocks.all|slice_ng:'-1' as blocks %} {% include "core/inc/block.html" %} {% endwith %} {% endblock %}