From 282cd4abe207e346f35933bd6d172b4f2ace4731 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 29 Sep 2016 06:02:28 +0200 Subject: [PATCH] Team short code and link in projetc page, fix double breadcrumb, bugfix --- app/organization/network/models.py | 10 ++++++++++ app/organization/projects/views.py | 2 +- app/templates/projects/project_detail.html | 20 ++++---------------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/organization/network/models.py b/app/organization/network/models.py index 9bf3ab18..21e3ff98 100644 --- a/app/organization/network/models.py +++ b/app/organization/network/models.py @@ -161,6 +161,16 @@ class Team(Named, URL): return ' - '.join((self.department.name, self.name)) return self.name + def short(self): + if self.organization: + return ' - '.join((self.organization.name, self.code)) + elif self.department: + if self.department.organization: + return ' - '.join((self.department.organization.name, self.code)) + else: + return ' - '.join((self.department.name, self.code)) + return self.code + class TeamPage(Page, SubTitled, RichText): """(Team description)""" diff --git a/app/organization/projects/views.py b/app/organization/projects/views.py index bbbbb788..abd8acdb 100644 --- a/app/organization/projects/views.py +++ b/app/organization/projects/views.py @@ -28,5 +28,5 @@ class ProjectDetailView(SlugMixin, DetailView): 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() + context['page'] = project.topic.pages.all().first() return context diff --git a/app/templates/projects/project_detail.html b/app/templates/projects/project_detail.html index e5f83232..25586a85 100644 --- a/app/templates/projects/project_detail.html +++ b/app/templates/projects/project_detail.html @@ -20,22 +20,8 @@ {% endblock %} {% block breadcrumb_menu %} - {{ block.super }} - - {% if department %} - - {% endif %} - {% if project.topic and project.topic.parent %} - - - {% elif project.topic %} - - - {% endif %} - - {% endblock %} {% block page_title %} @@ -195,7 +181,7 @@ {% trans "Project lead team" %}
- {{ project.lead_team }} + {{ project.lead_team.short }}
{% elif project.lead_organization %}
@@ -214,7 +200,9 @@
{% for team in project.teams.all %} - {{ team }}
+ {% if team.pages.all %} + {{ team.short }}
+ {% endif %} {% endfor %} {% for organization in project.organizations.all %} {% if organization.url %} -- 2.39.5