diff --git a/ietf/templates/wgchairs/wg_shepherd_documents.html b/ietf/templates/wgchairs/wg_shepherd_documents.html
index 5c76b0300..8d0487afa 100644
--- a/ietf/templates/wgchairs/wg_shepherd_documents.html
+++ b/ietf/templates/wgchairs/wg_shepherd_documents.html
@@ -34,23 +34,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% endcomment %}
{% block wg_titledetail %}Documents{% endblock %}
-{% block content %}
-
-
-
{% block wg_content %}
+
- Title |
+ Documents I shepherd |
Date |
- Status |
+ Status |
Area Director |
- {% for group, documents in groupped_documents.items %}
-
-
- {% for doc in documents %}
+ {% for doc in my_documents %}
{{ doc.title }}
@@ -65,12 +59,64 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
{% endfor %}
- {% endfor %}
-
+
+
+
+ Documents whithout shepherd |
+ Date |
+ Status |
+ Area Director |
+
+
+ {% for doc in no_shepherd %}
+
+
+ {{ doc.title }}
+ |
+
+ {{ doc.status.start_date|date:"Y-m" }}
+ |
+
+ {{ doc.status.status }}
+ |
+ {{ doc.ad_name|default:"" }} |
+
+
+ {% endfor %}
+
+
+
+
+
+ Documents by other shepherds |
+ Date |
+ Status |
+ Area Director |
+
+
+ {% regroup other_shepherds by shepherd as regrouped %}
+ {% for documents in regrouped %}
+
+
+
+ {% for doc in documents.list %}
+
+
+ {{ doc.title }}
+ |
+
+ {{ doc.status.start_date|date:"Y-m" }}
+ |
+
+ {{ doc.status.status }}
+ |
+ {{ doc.ad_name|default:"" }} |
+
+
+ {% endfor %}
+ {% endfor %}
+
{% endblock wg_content %}
-
-{% endblock content %}
-
diff --git a/ietf/wgchairs/views.py b/ietf/wgchairs/views.py
index f04a36298..e2229aeab 100644
--- a/ietf/wgchairs/views.py
+++ b/ietf/wgchairs/views.py
@@ -3,12 +3,11 @@ from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django.http import HttpResponseForbidden
+from ietf.idrfc.views_search import SearchForm, search_query
from ietf.wgchairs.forms import (RemoveDelegateForm, add_form_factory,
ManagingShepherdForm)
from ietf.wgchairs.accounts import (can_manage_delegates_in_group, get_person_for_user,
can_manage_shepherds_in_group)
-from ietf.ietfworkflows.utils import get_workflow_for_wg
-from django.db.models import Q
def manage_delegates(request, acronym):
@@ -35,15 +34,6 @@ def manage_delegates(request, acronym):
}, RequestContext(request))
-def manage_workflow(request, acronym):
- wg = get_object_or_404(IETFWG, group_acronym__acronym=acronym, group_type=1)
- workflow = get_workflow_for_wg(wg)
- return render_to_response('wgchairs/manage_workflow.html',
- {'wg': wg,
- 'workflow': workflow,
- }, RequestContext(request))
-
-
def managing_shepherd(request, acronym, name):
"""
View for managing the assigned shepherd of a document.
@@ -71,16 +61,20 @@ def wg_shepherd_documents(request, acronym):
return HttpResponseForbidden('You have no permission to access this view')
current_person = get_person_for_user(user)
- base_qs = InternetDraft.objects.select_related('status')
+ form = SearchForm({'by':'group', 'group':str(wg.group_acronym.acronym),
+ 'activeDrafts':'on'})
+ if not form.is_valid():
+ raise ValueError("form did not validate")
+ (docs,meta) = search_query(form.cleaned_data)
+
+ base_qs = InternetDraft.objects.filter(pk__in=[i.id._draft.pk for i in docs if i.id]).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))
+ documents_other = base_qs.exclude(shepherd__isnull=True).exclude(shepherd__pk__in=[current_person.pk, 0])
context = {
- 'groupped_documents': {
- 'Documents without Shepherd': documents_no_shepherd,
- 'My documents': documents_my,
- 'Other documents': documents_other,
- },
+ 'no_shepherd': documents_no_shepherd,
+ 'my_documents': documents_my,
+ 'other_shepherds': documents_other,
'wg': wg,
}
return render_to_response('wgchairs/wg_shepherd_documents.html', context, RequestContext(request))