Skip to content

Commit 7edecae

Browse files
committed
Added photo page support for individual groups, and tweaked some names. This provides a photo page for the IAB, but also as a benefit photo pages for other groups.
- Legacy-Id: 11287
1 parent dd781c9 commit 7edecae

6 files changed

Lines changed: 13 additions & 4 deletions

File tree

ietf/group/urls_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
(r'^bofs/$', views.bofs),
2020
(r'^email-aliases/$', 'ietf.group.views.email_aliases'),
2121
(r'^bofs/create/$', views_edit.edit, {'action': "create"}, "bof_create"),
22-
(r'^photos/$', views.photos),
22+
(r'^photos/$', views.all_photos),
2323
(r'^(?P<acronym>[a-zA-Z0-9-._]+)/', include('ietf.group.urls_info_details')),
2424
)

ietf/group/urls_info_details.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.conf.urls import patterns, url
22
from django.views.generic import RedirectView
3+
import views
34

45
urlpatterns = patterns('',
56
(r'^$', 'ietf.group.views.group_home', None, "group_home"),
@@ -28,5 +29,6 @@
2829
(r'^materials/new/$', 'ietf.doc.views_material.choose_material_type'),
2930
(r'^materials/new/(?P<doc_type>[\w-]+)/$', 'ietf.doc.views_material.edit_material', { 'action': "new" }, "group_new_material"),
3031
(r'^archives/$', 'ietf.group.views.derived_archives'),
32+
(r'^photos/$', views.group_photos),
3133
url(r'^email-aliases/$', RedirectView.as_view(pattern_name='ietf.group.views.email',permanent=False),name='old_group_email_aliases'),
3234
)

ietf/group/views.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,9 +871,16 @@ def derived_archives(request, acronym=None, group_type=None):
871871
'list_acronym':list_acronym,
872872
}))
873873

874-
def photos(request, group_type=None):
874+
def all_photos(request, group_type=None):
875875
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)
876876
for role in roles:
877877
role.last_initial = role.person.last_name()[0]
878878
return render(request, 'group/photos.html', {'group_type': group_type, 'role': 'Chair', 'roles': roles })
879879

880+
def group_photos(request, group_type=None, acronym=None):
881+
group = get_object_or_404(Group, acronym=acronym)
882+
roles = sorted(Role.objects.filter(group__acronym=acronym),key=lambda x: x.name.name+x.person.last_name())
883+
for role in roles:
884+
role.last_initial = role.person.last_name()[0]
885+
return render(request, 'group/group_photos.html', {'group_type': group_type, 'roles': roles, 'group':group })
886+

ietf/templates/group/active_rgs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h2>IRTF chair</h2>
1717

1818
<h2>Active research groups</h2>
1919
<a class="btn btn-default" href="{% url "ietf.group.views.all_status" %}">Status Reports</a>
20-
<a class="btn btn-default" href="{% url "ietf.group.views.photos" group_type="rg" %}">Chair Photos</a>
20+
<a class="btn btn-default" href="{% url "ietf.group.views.all_photos" group_type="rg" %}">Chair Photos</a>
2121

2222
<table class="table table-striped table-condensed tablesorter">
2323
<thead>

ietf/templates/group/active_wgs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h1>Active IETF working groups</h1>
2020
<a class="btn btn-default" href="{% url "ietf.group.views.concluded_groups" %}">Concluded WGs</a>
2121
<a class="btn btn-default" href="https://www.ietf.org/dyn/wg/charter/history/">Historic charters</a>
2222
<a class="btn btn-default" href="{% url "ietf.group.views.all_status" %}">Status Reports</a>
23-
<a class="btn btn-default" href="{% url "ietf.group.views.photos" group_type="wg" %}">Chair Photos</a>
23+
<a class="btn btn-default" href="{% url "ietf.group.views.all_photos" group_type="wg" %}">Chair Photos</a>
2424

2525
{% for area in areas %}
2626
<h2 class="anchor-target" id="{{area.acronym}}">{{ area.name }} ({{ area.acronym }})</h2>

0 commit comments

Comments
 (0)