Renamed group.views.all_photos() back to chair_photos(). Added differentiated ordering by role to group photo pages. Moved the external links (dependency graph and tools pages) off of the tabs, to the charter page.
- Legacy-Id: 11303
This commit is contained in:
parent
cbaabbf98f
commit
7c53eb1843
|
@ -347,24 +347,15 @@ def construct_group_menu_context(request, group, selected, group_type, others):
|
|||
entries.append(("Materials", urlreverse("ietf.group.views.materials", kwargs=kwargs)))
|
||||
if group.type_id in ('rg','wg','team'):
|
||||
entries.append(("Meetings", urlreverse("ietf.group.views.meetings", kwargs=kwargs)))
|
||||
entries.append(("Email expansions", urlreverse("ietf.group.views.email", kwargs=kwargs)))
|
||||
entries.append(("History", urlreverse("ietf.group.views.history", kwargs=kwargs)))
|
||||
|
||||
entries.append(("Photos", urlreverse("ietf.group.views.group_photos", kwargs=kwargs)))
|
||||
entries.append(("Email expansions", urlreverse("ietf.group.views.email", kwargs=kwargs)))
|
||||
if group.list_archive.startswith("http:") or group.list_archive.startswith("https:") or group.list_archive.startswith("ftp:"):
|
||||
if 'mailarchive.ietf.org' in group.list_archive:
|
||||
entries.append(("List archive", urlreverse("ietf.group.views.derived_archives", kwargs=kwargs)))
|
||||
entries.append(("list archive", urlreverse("ietf.group.views.derived_archives", kwargs=kwargs)))
|
||||
else:
|
||||
entries.append((mark_safe("List archive »"), group.list_archive))
|
||||
|
||||
if group.features.has_documents:
|
||||
kwargs["output_type"] = "svg"
|
||||
entries.append((mark_safe("Dependencies »"), urlreverse("ietf.group.views.dependencies", kwargs=kwargs)))
|
||||
del kwargs["output_type"]
|
||||
|
||||
if group.has_tools_page():
|
||||
entries.append((mark_safe("Tools page »"), "https://tools.ietf.org/%s/%s/" % (group.type_id, group.acronym)))
|
||||
|
||||
|
||||
# actions
|
||||
actions = []
|
||||
|
||||
|
@ -871,16 +862,38 @@ def derived_archives(request, acronym=None, group_type=None):
|
|||
'list_acronym':list_acronym,
|
||||
}))
|
||||
|
||||
def all_photos(request, group_type=None):
|
||||
def chair_photos(request, group_type=None):
|
||||
roles = sorted(Role.objects.filter(group__type=group_type, group__state='active', name_id='chair'),key=lambda x: x.person.last_name()+x.person.name+x.group.acronym)
|
||||
for role in roles:
|
||||
role.last_initial = role.person.last_name()[0]
|
||||
return render(request, 'group/photos.html', {'group_type': group_type, 'role': 'Chair', 'roles': roles })
|
||||
return render(request, 'group/all_photos.html', {'group_type': group_type, 'role': 'Chair', 'roles': roles })
|
||||
|
||||
def reorder_roles(roles, role_names):
|
||||
list = []
|
||||
for name in role_names:
|
||||
list += [ r for r in roles if r.name_id == name ]
|
||||
list += [ r for r in roles if not r in list ]
|
||||
return list
|
||||
|
||||
def group_photos(request, group_type=None, acronym=None):
|
||||
group = get_object_or_404(Group, acronym=acronym)
|
||||
roles = sorted(Role.objects.filter(group__acronym=acronym),key=lambda x: x.name.name+x.person.last_name())
|
||||
|
||||
if group.type_id in ['wg', 'rg', ]:
|
||||
roles = reorder_roles(roles, ['chair', 'secr'])
|
||||
elif group.type_id in ['nomcom', ]:
|
||||
roles = reorder_roles(roles, ['chair', 'member', 'advisor', ])
|
||||
elif group.type_id in ['team', ]:
|
||||
roles = reorder_roles(roles, ['chair', 'member', 'matman', ])
|
||||
elif group.type_id in ['sdo', ]:
|
||||
roles = reorder_roles(roles, ['liaiman', ])
|
||||
else:
|
||||
pass
|
||||
for role in roles:
|
||||
role.last_initial = role.person.last_name()[0]
|
||||
return render(request, 'group/group_photos.html', {'group_type': group_type, 'roles': roles, 'group':group })
|
||||
return render(request, 'group/group_photos.html',
|
||||
construct_group_menu_context(request, group, "photos", group_type, {
|
||||
'group_type': group_type,
|
||||
'roles': roles,
|
||||
'group':group }))
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<h2>Active research groups</h2>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.views.all_status" %}">Status Reports</a>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.views.all_photos" group_type="rg" %}">Chair Photos</a>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.views.chair_photos" group_type="rg" %}">Chair Photos</a>
|
||||
|
||||
<table class="table table-striped table-condensed tablesorter">
|
||||
<thead>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<a class="btn btn-default" href="{% url "ietf.group.views.concluded_groups" %}">Concluded WGs</a>
|
||||
<a class="btn btn-default" href="https://www.ietf.org/dyn/wg/charter/history/">Historic charters</a>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.views.all_status" %}">Status Reports</a>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.views.all_photos" group_type="wg" %}">Chair Photos</a>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.views.chair_photos" group_type="wg" %}">Chair Photos</a>
|
||||
|
||||
{% for area in areas %}
|
||||
<h2 class="anchor-target" id="{{area.acronym}}">{{ area.name }} ({{ area.acronym }})</h2>
|
||||
|
|
Loading…
Reference in a new issue