Move shepherd list of documents view into wgchais application. See #564
- Legacy-Id: 2709
This commit is contained in:
parent
ebaf7ae436
commit
a0b7992169
|
@ -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<name>[^/]+)/$', 'managing_shepherd', name='doc_managing_shepherd'),
|
||||
url(r'^shepherds/$', 'wg_shepherd_documents', name='manage_shepherds'),
|
||||
url(r'^shepherds/(?P<name>[^/]+)/$', 'managing_shepherd', name='doc_managing_shepherd'),
|
||||
)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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<acronym>[^/]+)/$', views.wg_documents),
|
||||
(r'^(?P<acronym>[^/]+)/charter/$', views.wg_charter),
|
||||
(r'^(?P<acronym>[^/]+)/management/', include('ietf.wgchairs.urls')),
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue