Skip to content

Commit 5dcc94e

Browse files
committed
Port wginfo views
- Legacy-Id: 3160
1 parent 68d0e4c commit 5dcc94e

23 files changed

Lines changed: 685 additions & 228 deletions

ietf/idrfc/views_search.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,10 @@ def add(allow, states):
378378
# canonical name
379379
for r in results:
380380
if r.pk in rfc_aliases:
381-
r.canonical_name = rfc_aliases[r.pk]
381+
# lambda weirdness works around lambda binding in local for loop scope
382+
r.canonical_name = (lambda x: lambda: x)(rfc_aliases[r.pk])
382383
else:
383-
r.canonical_name = r.name
384+
r.canonical_name = (lambda x: lambda: x)(r.name)
384385

385386
result_map = dict((r.pk, r) for r in results)
386387

@@ -419,12 +420,13 @@ def add(allow, states):
419420

420421
# sort
421422
def sort_key(d):
422-
if d.canonical_name.startswith('rfc'):
423-
return (2, "%06d" % int(d.canonical_name[3:]))
423+
n = d.canonical_name()
424+
if n.startswith('rfc'):
425+
return (2, "%06d" % int(n[3:]))
424426
elif d.state_id == "active":
425-
return (1, d.canonical_name)
427+
return (1, n)
426428
else:
427-
return (3, d.canonical_name)
429+
return (3, n)
428430

429431
results.sort(key=sort_key)
430432

ietf/idtracker/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ class IETFWGAdmin(admin.ModelAdmin):
9595
list_display=('group_acronym', 'group_type', 'status', 'area_acronym', 'start_date', 'concluded_date')
9696
search_fields=['group_acronym__acronym', 'group_acronym__name']
9797
list_filter=['status', 'group_type']
98-
admin.site.register(IETFWG, IETFWGAdmin)
98+
if not settings.USE_DB_REDESIGN_PROXY_CLASSES:
99+
admin.site.register(IETFWG, IETFWGAdmin)
99100

100101
class IRTFAdmin(admin.ModelAdmin):
101102
pass

ietf/idtracker/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,8 +1096,9 @@ def __init__(self, document):
10961096
AreaOld = Area
10971097
AcronymOld = Acronym
10981098
IESGLoginOld = IESGLogin
1099+
IETFWGOld = IETFWG
10991100
from redesign.doc.proxy import InternetDraft, IDInternal, BallotInfo, IDState, IDSubState, Rfc
1100-
from redesign.group.proxy import Area, Acronym
1101+
from redesign.group.proxy import Area, Acronym, IETFWG
11011102
from redesign.person.proxy import IESGLogin
11021103

11031104

ietf/mailinglists/urls.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# Copyright The IETF Trust 2007, All Rights Reserved
22

33
from django.conf.urls.defaults import patterns
4-
from django.conf import settings
54
from ietf.idtracker.models import IETFWG
65

7-
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
8-
from redesign.group.proxy import IETFWG
9-
http_archive_wg_queryset = IETFWG.objects.filter(list_pages__startswith='http')
10-
else:
11-
http_archive_wg_queryset = IETFWG.objects.filter(email_archive__startswith='http')
6+
http_archive_wg_queryset = IETFWG.objects.filter(email_archive__startswith='http')
127

138
urlpatterns = patterns('django.views.generic.list_detail',
149
(r'^wg/$', 'object_list', { 'queryset': http_archive_wg_queryset, 'template_name': 'mailinglists/wgwebmail_list.html' }),

ietf/templates/wginfo/1wg-summary-by-acronym.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
IETF Working Group Summary (By Acronym)
33

44

5-
The following Area Abreviations are used in this document
5+
The following Area Abbreviations are used in this document
66
{% for area in area_list %}
7-
{{ area }} - {{ area.area_acronym.name }}{% endfor %}
7+
{{ area|upper }} - {{ area.area_acronym.name }}{% endfor %}
88
{% for wg in wg_list|dictsort:"group_acronym.acronym" %}{% if wg.start_date %}
99
{{ wg.group_acronym.name|safe }} ({{ wg }}) -- {{ wg.area.area|upper }}
10-
{% for chair in wg.wgchair_set.all %}{% if forloop.first %} Chair{{ forloop.revcounter|pluralize:": ,s:" }} {% else %} {% endif %}{{ chair.person|safe }} <{{ chair.person.email.1 }}>
11-
{% endfor %} WG Mail: {{ wg.email_address }}
12-
To Join: {{ wg.email_subscribe }}{%if wg.email_keyword %}
13-
In Body: {{ wg.email_keyword|safe }}{% endif %}
14-
Archive: {{ wg.email_archive }}
15-
{% endif %}{% endfor %}
10+
{% include "wginfo/wg_summary.txt" %}{% endif %}{% endfor %}

ietf/templates/wginfo/1wg-summary.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,4 @@
55
{{ ad.person }} <{{ ad.person.email.1 }}>{% endfor %}
66
{% endif %}{% if wg.start_date %}
77
{{ wg.group_acronym.name|safe }} ({{ wg }})
8-
{% for chair in wg.wgchair_set.all %}{% if forloop.first %} Chair{{ forloop.revcounter|pluralize:": ,s:" }} {% else %} {% endif %}{{ chair.person|safe }} <{{ chair.person.email.1 }}>
9-
{% endfor %} WG Mail: {{ wg.email_address }}
10-
To Join: {{ wg.email_subscribe }}{%if wg.email_keyword %}
11-
In Body: {{ wg.email_keyword|safe }}{% endif %}
12-
Archive: {{ wg.email_archive }}
13-
{% endif %}{% endifequal %}{% endfor %}{% endfor %}
8+
{% include "wginfo/wg_summary.txt" %}{% endif %}{% endifequal %}{% endfor %}{% endfor %}

ietf/templates/wginfo/wg-charter.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% load ietf_filters %}{{wg.group_acronym.name|safe}} ({{wg}})
1+
{% if USE_DB_REDESIGN_PROXY_CLASSES %}{% include "wginfo/wg-charterREDESIGN.txt" %}{% else %}{% load ietf_filters %}{{wg.group_acronym.name|safe}} ({{wg}})
22
{{ wg.group_acronym.name|dashify }}{{ wg.group_acronym.acronym|dashify }}---
33

44
Charter
@@ -44,4 +44,4 @@ Internet-Drafts:
4444
* {{obs.action}} RFC{{obs.rfc_acted_on_id}}{% endfor %}{% for obs in rfc.obsoleted_by%}
4545
* {%ifequal obs.action 'Obsoletes'%}OBSOLETED BY{%else%}Updated by{%endifequal%} RFC{{obs.rfc_id}}{% endfor %}
4646
{%endfor%}
47-
{%else%}No Requests for Comments{% endif %}
47+
{%else%}No Requests for Comments{% endif %}{% endif %}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{% load ietf_filters %}{{wg.name|safe}} ({{wg.acronym}})
2+
{{ wg.name|dashify }}{{ wg.acronym|dashify }}---
3+
4+
Charter
5+
Last Modified: {{ wg.time.date }}
6+
7+
Current Status: {{ wg.state.name }}
8+
9+
Chair{{ wg.chairs|pluralize }}:
10+
{% for chair in wg.chairs %} {{ chair.person.name|safe }} <{{chair.address}}>
11+
{% endfor %}
12+
{{wg.area.area.area_acronym.name}} Directors:
13+
{% for ad in wg.area_directors %} {{ ad.person|safe }} <{{ad.person.email.1}}>
14+
{% endfor %}
15+
{{wg.area.area.area_acronym.name}} Advisor:
16+
{{ wg.areadirector.person.name|safe }} <{{wg.areadirector.address}}>
17+
{% if wg.techadvisors %}
18+
Tech Advisor{{ wg.techadvisors|pluralize }}:
19+
{% for techadvisor in wg.techadvisors %} {{ techadvisor.person.name|safe }} <{{techadvisor.address}}>
20+
{% endfor %}{% endif %}{% if wg.editors %}
21+
Editor{{ wg.editors|pluralize }}:
22+
{% for editor in wg.editors %} {{ editor.person.name|safe }} <{{editor.person.address}}>
23+
{% endfor %}{% endif %}{% if wg.secretaries %}
24+
Secretar{{ wg.secretaries|pluralize:"y,ies" }}:
25+
{% for secretary in wg.secretaries %} {{ secretary.person.name|safe }} <{{secretary.person.address}}>
26+
{% endfor %}{% endif %}
27+
Mailing Lists:
28+
General Discussion: {{ wg.email_address }}
29+
To Subscribe: {{ wg.email_subscribe }}
30+
Archive: {{ wg.email_archive }}
31+
32+
Description of Working Group:
33+
34+
{{ wg.charter_text|indent|safe }}
35+
36+
Goals and Milestones:
37+
{% for milestone in wg.milestones %} {% if milestone.done %}Done {% else %}{{ milestone.expected_due_date|date:"M Y" }}{% endif %} - {{ milestone.desc|safe }}
38+
{% endfor %}
39+
Internet-Drafts:
40+
{% for alias in wg.drafts %} - {{alias.document.title|safe}} [{{alias.name}}-{{alias.document.rev}}] ({{ alias.document.pages }} pages)
41+
{% endfor %}
42+
{% if wg.rfcs %}Requests for Comments:
43+
{% for alias in wg.rfcs %} {{ alias.name.upper }}: {{ alias.document.title|safe}} ({{ alias.document.pages }} pages){% for r in alias.rel %}
44+
* {{ r.action }} {{ r.target.name|upper }}{% endfor %}{% for r in alias.invrel %}
45+
* {% ifequal r.relationsship "obs" %}{{ r.inverse_action|upper }}{% else %}{{ r.action }}{% endifequal %} {{ r.source.canonical_name|upper }}{% endfor %}
46+
{%endfor%}
47+
{%else%}No Requests for Comments{% endif %}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{% extends "base.html" %}
2+
{# Copyright The IETF Trust 2009, All Rights Reserved #}
3+
{% comment %}
4+
Portion Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5+
All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions
9+
are met:
10+
11+
* Redistributions of source code must retain the above copyright
12+
notice, this list of conditions and the following disclaimer.
13+
14+
* Redistributions in binary form must reproduce the above
15+
copyright notice, this list of conditions and the following
16+
disclaimer in the documentation and/or other materials provided
17+
with the distribution.
18+
19+
* Neither the name of the Nokia Corporation and/or its
20+
subsidiary(-ies) nor the names of its contributors may be used
21+
to endorse or promote products derived from this software
22+
without specific prior written permission.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35+
{% endcomment %}
36+
37+
{% block title %}Active IETF Working Groups{% endblock %}
38+
39+
{% block morecss %}
40+
.ietf-wg-table { width: 100%; max-width:50em; }
41+
.ietf-wg-table tr { vertical-align:top; }
42+
{% endblock morecss %}
43+
44+
{% block content %}
45+
<h1>Active IETF Working Groups</h1>
46+
47+
<p>See also: <a href="http://www.ietf.org/wg/concluded/">Concluded
48+
Working Groups (www.ietf.org)</a>, <a href="http://tools.ietf.org/wg/concluded/">Concluded Working Groups (tools.ietf.org)</a>, <a href="http://www.ietf.org/dyn/wg/charter/history/">Historic Charters</a>.</p>
49+
50+
{% for area in areas %}
51+
<h2 class="ietf-divider" id="{{ area.name|cut:" " }}">{{ area.name }}</h2>
52+
53+
{% for ad in area.ads %}
54+
{% if forloop.first %}
55+
<p>Area Director{{ forloop.revcounter|pluralize }}:</p>
56+
<p style="margin-left: 2em">
57+
{% endif %}
58+
<a href="mailto:{{ ad.address }}">{{ ad.person.name }} &lt;{{ ad.address }}&gt;</a>{% if not forloop.last %}<br/>{% endif %}
59+
{% if forloop.last %}
60+
</p>
61+
{% endif %}
62+
{% endfor %}
63+
64+
{% for url in area.urls %}
65+
{% if forloop.first %}
66+
<p>Area Specific Web Page{{ forloop.revcounter|pluralize}}:</p>
67+
<p style="margin-left: 2em">
68+
{% endif %}
69+
<a href="{{url.url}}">{{ url.name }}</a>{% if not forloop.last %}<br/>{% endif %}
70+
{% if forloop.last %}
71+
</p>
72+
{% endif %}
73+
{% endfor %}
74+
75+
{% for wg in area.wgs %}
76+
{% if forloop.first %}
77+
<p>Active Working Groups:</p>
78+
<div style="margin-left:2em;">
79+
<table class="ietf-wg-table">
80+
{% endif %}
81+
<tr><td width="10%;"><a href="/wg/{{ wg.acronym }}/">{{ wg.acronym }}</a></td><td width="50%">{{ wg.name }}</td>
82+
<td width="39%">{% for chair in wg.chairs %}<a href="mailto:{{ chair.address }}">{{ chair.person.name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td></tr>
83+
{% if forloop.last %}
84+
</table>
85+
</div>
86+
{% endif %}
87+
{% empty %}
88+
<p>No Active Working Groups</p>
89+
{% endfor %}{# wg #}
90+
91+
{% endfor %}{# area #}
92+
{% endblock %}
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{% extends "wginfo/wg_base.html" %}
2+
{% comment %}
3+
Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4+
All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions
8+
are met:
9+
10+
* Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above
14+
copyright notice, this list of conditions and the following
15+
disclaimer in the documentation and/or other materials provided
16+
with the distribution.
17+
18+
* Neither the name of the Nokia Corporation and/or its
19+
subsidiary(-ies) nor the names of its contributors may be used
20+
to endorse or promote products derived from this software
21+
without specific prior written permission.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
{% endcomment %}
35+
{% load ietf_filters %}
36+
{% block wg_titledetail %}Charter{% endblock %}
37+
38+
{% block wg_content %}
39+
40+
<div class="ietf-box ietf-wg-details">
41+
{% if concluded %}
42+
<span class="ietf-concluded-warning">Note: The data for concluded WGs
43+
is occasionally incorrect.</span>
44+
{% endif %}
45+
<table>
46+
<tr>
47+
<td colspan="2">
48+
<b>Personnel</b>
49+
</td>
50+
</tr>
51+
52+
<tr valign="top">
53+
<td style="width:14ex;">Chair{{ wg.chairs|pluralize }}:</td>
54+
<td>
55+
{% for chair in wg.chairs %}
56+
<a href="mailto:{{ chair.address }}">{{ chair.person.name }} &lt;{{ chair.address }}&gt;</a><br/>
57+
{% endfor %}
58+
</td></tr>
59+
<tr><td>Area Director:</td>
60+
<td>
61+
{% if not wg.ad %}?{% else %}
62+
<a href="mailto:{{ wg.ad_email }}">{{ wg.ad.name }} &lt;{{ wg.ad_email }}&gt;</a>{% endif %}
63+
</td>
64+
</tr>
65+
{% if wg.techadvisors %}
66+
<tr>
67+
<td>Tech Advisor{{ wg.techadvisors|pluralize }}:</td>
68+
<td>
69+
{% for techadvisor in wg.techadvisors %}
70+
<a href="mailto:{{ techadvisor.address }}">{{ techadvisor.person.name }} &lt;{{ techadvisor.address }}&gt;</a><br/>
71+
{% endfor %}
72+
</td></tr>
73+
{% endif %}
74+
{% if wg.editors %}
75+
<td>Editor{{ wg.editors|pluralize }}:</td>
76+
<td>
77+
{% for editor in wg.editors %}
78+
<a href="mailto:{{ editor.address }}">{{ editor.person.name }} &lt;{{ editor.address }}&gt;</a><br/>
79+
{% endfor %}
80+
</td></tr>
81+
{% endif %}
82+
{% if wg.secretaries %}
83+
<tr><td>Secretar{{ wg.secretaries|pluralize:"y,ies" }}:</td>
84+
<td>
85+
{% for secretary in wg.secretaries %}
86+
<a href="mailto:{{ secretary.address }}">{{ secretary.person.name }} &lt;{{ secretary.address }}&gt;</a><br/>
87+
{% endfor %}
88+
</td></tr>
89+
{% endif %}
90+
91+
<tr>
92+
<td colspan="2">
93+
<br/><b>Mailing List</b>
94+
</td>
95+
</tr>
96+
97+
<tr><td>Address:</td><td>{{ wg.email_address|urlize }}</td></tr>
98+
<tr><td>To Subscribe:</td><td>{{ wg.email_subscribe|urlize }}</td></tr>
99+
<tr><td>Archive:</td><td>{{ wg.clean_email_archive|urlize }}</td></tr>
100+
101+
{% if not concluded %}
102+
<tr>
103+
<td colspan="2">
104+
<br/><b>Jabber Chat</b>
105+
</td>
106+
</tr>
107+
108+
<tr><td>Room Address:</td><td><a href="xmpp:{{wg}}@jabber.ietf.org">xmpp:{{wg}}@jabber.ietf.org</a></td></tr>
109+
<tr><td>Logs:</td><td><a href="http://jabber.ietf.org/logs/{{wg}}/">http://jabber.ietf.org/logs/{{wg}}/</a></td></tr>
110+
{% endif %}
111+
112+
</table>
113+
</div>
114+
115+
{% if wg.additional_urls %}
116+
<p>In addition to the charter maintained by the IETF Secretariat, there is additional information about this working group on the Web at:
117+
{% for url in wg.additional_urls %}
118+
<a href="{{ url.url }}">{{ url.description}}</a>{% if not forloop.last %}, {% endif %}
119+
{% endfor %}
120+
</p>
121+
{% endif %}
122+
123+
<h2>Description of Working Group</h2>
124+
<p>{{ wg.charter_text|escape|format_charter|safe }}</p>
125+
126+
<h2>Goals and Milestones</h2>
127+
<table>
128+
{% for milestone in wg.milestones %}
129+
<tr>
130+
<td width="80px">
131+
{% if milestone.done %}Done{% else %}{{ milestone.expected_due_date|date:"M Y" }}{% endif %}
132+
</td>
133+
<td>{{ milestone.desc|escape }}
134+
</td></tr>
135+
{% endfor %}
136+
</table>
137+
{% endblock wg_content %}

0 commit comments

Comments
 (0)