From a0b799216913fbddc51cdd3529898026f551b0fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20A=2E=20S=C3=A1nchez=20L=C3=B3pez?= Date: Thu, 9 Dec 2010 13:22:03 +0000 Subject: [PATCH] Move shepherd list of documents view into wgchais application. See #564 - Legacy-Id: 2709 --- .../wg_shepherd_documents.html | 0 ietf/wgchairs/urls.py | 3 ++- ietf/wgchairs/views.py | 20 +++++++++++++++++++ ietf/wginfo/urls.py | 1 - ietf/wginfo/views.py | 20 ------------------- 5 files changed, 22 insertions(+), 22 deletions(-) rename ietf/templates/{wginfo => wgchairs}/wg_shepherd_documents.html (100%) diff --git a/ietf/templates/wginfo/wg_shepherd_documents.html b/ietf/templates/wgchairs/wg_shepherd_documents.html similarity index 100% rename from ietf/templates/wginfo/wg_shepherd_documents.html rename to ietf/templates/wgchairs/wg_shepherd_documents.html diff --git a/ietf/wgchairs/urls.py b/ietf/wgchairs/urls.py index a64747c1d..ab69bf8d6 100644 --- a/ietf/wgchairs/urls.py +++ b/ietf/wgchairs/urls.py @@ -5,5 +5,6 @@ from django.conf.urls.defaults import patterns, url urlpatterns = patterns('ietf.wgchairs.views', url(r'^workflows/$', 'manage_workflow', name='manage_workflow'), url(r'^delegates/$', 'manage_delegates', name='manage_delegates'), - url(r'shepherds/(?P[^/]+)/$', 'managing_shepherd', name='doc_managing_shepherd'), + url(r'^shepherds/$', 'wg_shepherd_documents', name='manage_shepherds'), + url(r'^shepherds/(?P[^/]+)/$', 'managing_shepherd', name='doc_managing_shepherd'), ) diff --git a/ietf/wgchairs/views.py b/ietf/wgchairs/views.py index 9970a1ed4..69da491af 100644 --- a/ietf/wgchairs/views.py +++ b/ietf/wgchairs/views.py @@ -7,6 +7,8 @@ from ietf.wgchairs.forms import (RemoveDelegateForm, add_form_factory, ManagingShepherdForm) from ietf.wgchairs.accounts import can_manage_delegates_in_group from ietf.ietfworkflows.utils import get_workflow_for_wg +from ietf.idtracker.models import InternetDraft, PersonOrOrgInfo, IESGLogin +from django.db.models import Q def manage_delegates(request, acronym): @@ -60,3 +62,21 @@ def managing_shepherd(request, acronym, name): user=request.user, login=login), context_instance=RequestContext(request)) + + +def wg_shepherd_documents(request, acronym): + current_person = PersonOrOrgInfo.objects. \ + get(iesglogin__login_name=request.user.username) + + base_qs = InternetDraft.objects.select_related('status') + documents_no_shepherd = base_qs.filter(shepherd__isnull=True) + documents_my = base_qs.filter(shepherd=current_person) + documents_other = base_qs.filter(~Q(shepherd=current_person)) + context = { + 'groupped_documents': { + 'Documents without Shepherd': documents_no_shepherd, + 'My documents': documents_my, + 'Other documents': documents_other, + } + } + return render_to_response('wgchairs/wg_shepherd_documents.html', context, RequestContext(request)) diff --git a/ietf/wginfo/urls.py b/ietf/wginfo/urls.py index f4f5fa475..d67fc4897 100644 --- a/ietf/wginfo/urls.py +++ b/ietf/wginfo/urls.py @@ -13,7 +13,6 @@ urlpatterns = patterns('', (r'^1wg-summary-by-acronym.txt', views.wg_summary_acronym), (r'^1wg-charters.txt', views.wg_charters), (r'^1wg-charters-by-acronym.txt', views.wg_charters_by_acronym), - (r'^shepherd/list/$', views.wg_shepherd_documents), (r'^(?P[^/]+)/$', views.wg_documents), (r'^(?P[^/]+)/charter/$', views.wg_charter), (r'^(?P[^/]+)/management/', include('ietf.wgchairs.urls')), diff --git a/ietf/wginfo/views.py b/ietf/wginfo/views.py index 61b341b6d..f0eb152cb 100644 --- a/ietf/wginfo/views.py +++ b/ietf/wginfo/views.py @@ -38,8 +38,6 @@ from django.template import RequestContext, loader from django.http import HttpResponse from ietf.idrfc.views_search import SearchForm, search_query from ietf.idrfc.idrfc_wrapper import IdRfcWrapper -from ietf.idtracker.models import InternetDraft, PersonOrOrgInfo, IESGLogin -from django.db.models import Q def wg_summary_acronym(request): areas = Area.active_areas() @@ -87,24 +85,6 @@ def wg_documents(request, acronym): return render_to_response('wginfo/wg_documents.html', {'wg': wg, 'concluded':concluded, 'selected':'documents', 'docs':docs, 'meta':meta, 'docs_related':docs_related_pruned, 'meta_related':meta_related}, RequestContext(request)) -def wg_shepherd_documents(request): - current_person = PersonOrOrgInfo.objects. \ - get(iesglogin__login_name=request.user.username) - - base_qs = InternetDraft.objects.select_related('status') - documents_no_shepherd = base_qs.filter(shepherd__isnull=True) - documents_my = base_qs.filter(shepherd=current_person) - documents_other = base_qs.filter(~Q(shepherd=current_person)) - context = { - 'groupped_documents': { - 'Documents without Shepherd': documents_no_shepherd, - 'My documents': documents_my, - 'Other documents': documents_other, - } - } - return render_to_response('wginfo/wg_shepherd_documents.html', context, RequestContext(request)) - - def wg_charter(request, acronym): wg = get_object_or_404(IETFWG, group_acronym__acronym=acronym, group_type=1) concluded = (wg.status_id != 1)