From f7d6fbd356d2041513a8b24752d9e487a1cee58a Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 15 Jul 2016 16:00:54 +0200 Subject: [PATCH] add various organization views and templates --- app/organization/featured/views.py | 2 -- app/organization/magazine/views.py | 4 +-- app/organization/project/views.py | 15 +++++++- app/organization/team/views.py | 42 ++++++++++++++++++++++- app/templates/project/project_detail.html | 0 app/templates/project/project_list.html | 0 app/templates/team/department_detail.html | 0 app/templates/team/department_list.html | 0 app/templates/team/person_detail.html | 0 app/templates/team/person_list.html | 0 app/templates/team/team_detail.html | 0 app/templates/team/team_list.html | 0 12 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 app/templates/project/project_detail.html create mode 100644 app/templates/project/project_list.html create mode 100644 app/templates/team/department_detail.html create mode 100644 app/templates/team/department_list.html create mode 100644 app/templates/team/person_detail.html create mode 100644 app/templates/team/person_list.html create mode 100644 app/templates/team/team_detail.html create mode 100644 app/templates/team/team_list.html diff --git a/app/organization/featured/views.py b/app/organization/featured/views.py index 91ea44a2..2536b376 100644 --- a/app/organization/featured/views.py +++ b/app/organization/featured/views.py @@ -1,3 +1 @@ from django.shortcuts import render - -# Create your views here. diff --git a/app/organization/magazine/views.py b/app/organization/magazine/views.py index 7e83d169..0ad63f47 100644 --- a/app/organization/magazine/views.py +++ b/app/organization/magazine/views.py @@ -8,7 +8,7 @@ from django.shortcuts import get_object_or_404 from organization.magazine.models import Article, Brief from organization.core.views import SlugMixin -# Create your views here. + class ArticleDetailView(SlugMixin, DetailView): model = Article @@ -19,6 +19,7 @@ class ArticleDetailView(SlugMixin, DetailView): context = super(ArticleDetailView, self).get_context_data(**kwargs) return context + class ArticleListView(SlugMixin, ListView): model = Article @@ -30,7 +31,6 @@ class ArticleListView(SlugMixin, ListView): return context -# Create your views here. class BriefDetailView(SlugMixin, DetailView): model = Brief diff --git a/app/organization/project/views.py b/app/organization/project/views.py index 91ea44a2..5d078e3a 100644 --- a/app/organization/project/views.py +++ b/app/organization/project/views.py @@ -1,3 +1,16 @@ from django.shortcuts import render -# Create your views here. +from organization.core.views import * + + +class ProjectListView(ListView): + + model = Project + template_name='project/project_list.html' + + +class ProjectDetailView(SlugMixin, DetailView): + + model = Project + template_name='project/project_detail.html' + context_object_name = 'project' diff --git a/app/organization/team/views.py b/app/organization/team/views.py index 91ea44a2..1eae93eb 100644 --- a/app/organization/team/views.py +++ b/app/organization/team/views.py @@ -1,3 +1,43 @@ from django.shortcuts import render -# Create your views here. +from organization.team.models import * +from organization.core.views import * + + +class DepartmentListView(ListView): + + model = Department + template_name='team/department_list.html' + + +class DepartmentDetailView(SlugMixin, DetailView): + + model = Department + template_name='team/department_detail.html' + context_object_name = 'department' + + +class TeamListView(ListView): + + model = Team + template_name='team/team_list.html' + + +class TeamDetailView(SlugMixin, DetailView): + + model = Team + template_name='team/team_detail.html' + context_object_name = 'team' + + +class PersonListView(ListView): + + model = Person + template_name='team/person_list.html' + + +class PersonDetailView(SlugMixin, DetailView): + + model = Person + template_name='team/person_detail.html' + context_object_name = 'person' diff --git a/app/templates/project/project_detail.html b/app/templates/project/project_detail.html new file mode 100644 index 00000000..e69de29b diff --git a/app/templates/project/project_list.html b/app/templates/project/project_list.html new file mode 100644 index 00000000..e69de29b diff --git a/app/templates/team/department_detail.html b/app/templates/team/department_detail.html new file mode 100644 index 00000000..e69de29b diff --git a/app/templates/team/department_list.html b/app/templates/team/department_list.html new file mode 100644 index 00000000..e69de29b diff --git a/app/templates/team/person_detail.html b/app/templates/team/person_detail.html new file mode 100644 index 00000000..e69de29b diff --git a/app/templates/team/person_list.html b/app/templates/team/person_list.html new file mode 100644 index 00000000..e69de29b diff --git a/app/templates/team/team_detail.html b/app/templates/team/team_detail.html new file mode 100644 index 00000000..e69de29b diff --git a/app/templates/team/team_list.html b/app/templates/team/team_list.html new file mode 100644 index 00000000..e69de29b -- 2.39.5