Skip to content

Commit 2fea753

Browse files
committed
Move WG edit and conclude views from wgcharter to wginfo since they
aren't dealing with charters directly, clean up and add some polish and fix a bunch of refactoring bugs. Start on fixing tests. - Legacy-Id: 4169
1 parent 32659ed commit 2fea753

22 files changed

Lines changed: 1131 additions & 735 deletions

ietf/templates/feeds/wg_charter_description.html

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
{# Copyright The IETF Trust 2011, All Rights Reserved #}
22
{% load ietf_filters %}
3-
{{ obj.info.text|safe }}<br/>
4-
<br/>
3+
<p>{{ obj.info.text|safe|linebreaksbr }}</p>
4+
55
{% with obj.group as wg %}
6-
WG name: {{ wg.name }}<br/>
7-
WG acronym: {{ wg.acronym }}<br/>
8-
IETF area: {{ wg.parent|default:"-" }}<br/>
6+
<p>
7+
WG name: {{ wg.name }}<br/>
8+
WG acronym: {{ wg.acronym }}<br/>
9+
IETF area: {{ wg.parent|default:"-" }}<br/>
10+
</p>
911

10-
WG chairs: {% for n in obj.chairs %}{{ n }}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
11-
WG secretaries: {% for n in obj.secr %}{{ n }}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
12-
WG technical advisors: {% for n in obj.techadv %}{{ n }}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
13-
Assigned AD: {{ wg.ad }}<br/>
12+
<p>
13+
WG chairs: {% for n in obj.chairs %}{{ n }}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
14+
WG secretaries: {% for n in obj.secr %}{{ n }}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
15+
WG technical advisors: {% for n in obj.techadv %}{{ n }}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
16+
Assigned AD: {{ wg.ad }}<br/>
17+
</p>
1418

15-
Mailing list: {{ wg.list_email }}<br/>
16-
Mailing list subscribe {{ wg.list_subscribe }}<br/>
17-
Mailing list archive: {{ wg.list_archive }}<br/>
18-
Other web sites: {% for a in wg.groupurl_set.all %}{{ a.url }} {% if a.name %}({{ a.name }}){% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
19+
<p>
20+
Mailing list: {{ wg.list_email }}<br/>
21+
Mailing list subscribe {{ wg.list_subscribe }}<br/>
22+
Mailing list archive: {{ wg.list_archive }}<br/>
23+
Other web sites: {% for a in wg.groupurl_set.all %}{{ a.url }} {% if a.name %}({{ a.name }}){% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}<br/>
24+
</p>
1925

20-
WG State: {{ wg.state|safe }}<br/>
21-
Charter State: {{ wg.charter.charter_state|safe }}<br/>
22-
<br/>
26+
<p>
27+
WG State: {{ wg.state|safe }}<br/>
28+
Charter State: {% if wg.charter %}{{ wg.charter.get_state|safe }}{% endif %}<br/>
29+
</p>
2330
{% if obj.rev %}
2431
{{ obj.charter|safe }}
2532
{% else %}

ietf/templates/idrfc/document_charter.html

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@
4646
</td>
4747
</tr>
4848

49-
{% if chartering %}
50-
51-
{% if doc.group.comments %}
49+
{% if chartering and doc.group.comments %}
5250
<tr>
5351
{% if chartering == "initial" %}<td>Reason for chartering:</td>{% endif %}
5452
{% if chartering == "rechartering" %}<td>Reason for rechartering:</td>{% endif %}
@@ -72,28 +70,28 @@
7270

7371
<tr><td>Last updated:</td><td> {{ doc.time|date:"Y-m-d" }}</td></tr>
7472

75-
{% endif %}
76-
7773
<tr><td colspan='2'><hr size='1' noshade /></td></tr>
7874
</table>
7975

80-
{% if not snapshot and user|has_role:"Area Director,Secretariat" %}
76+
<div class="actions">
77+
{% if not snapshot and user|has_role:"Area Director,Secretariat" %}
8178

82-
{% if chartering %}
79+
{% if chartering %}
8380

84-
{% if doc.group.state_id != "conclude" %}
85-
<a href="{% url wg_submit name=doc.group.acronym %}">Edit charter</a>
86-
{% endif %}
81+
{% if doc.group.state_id != "conclude" %}
82+
<a href="{% url wg_submit name=doc.group.acronym %}">Edit charter text</a>
83+
{% endif %}
8784

88-
<a href="{% url wg_startstop_process name=doc.group.acronym option='abandon' %}">Abandon effort</a>
85+
<a href="{% url wg_startstop_process name=doc.group.acronym option='abandon' %}">Abandon effort</a>
8986

90-
{% else %}
91-
<a href="{% url wg_startstop_process name=doc.group.acronym option='recharter' %}">Recharter</a>
92-
{% endif %}
87+
{% else %}
88+
<a href="{% url wg_startstop_process name=doc.group.acronym option='recharter' %}">Recharter</a>
89+
{% endif %}
9390

94-
{% endif %}
91+
{% endif %}
9592

96-
<div><a href="/feed/wgcomments/{{ doc.group.acronym }}/">Atom feed</a></div>
93+
<a href="/feed/wgcomments/{{ doc.group.acronym }}/">Atom feed</a>
94+
</div>
9795
</div>
9896

9997
<p>Other versions: <a href="{{ txt_url }}">plain text</a></p>

ietf/templates/wgcharter/add_comment.html

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% autoescape off %}
22
{{ text }}
33

4-
WG Record URL: {{ url }}
4+
WG URL: {{ url }}
55
{% endautoescape %}
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% block title %}
44
{% if wg %}
5-
Edit info on {{ wg.acronym }}
5+
Edit WG {{ wg.acronym }}
66
{% else %}
77
Create WG
88
{% endif %}
@@ -42,7 +42,7 @@
4242
{% block content %}
4343
{% load ietf_filters %}
4444
<h1>{% if wg %}
45-
Edit info on {{ wg.acronym }}
45+
Edit WG {{ wg.acronym }}
4646
{% else %}
4747
Create WG
4848
{% endif %}
@@ -55,7 +55,7 @@ <h1>{% if wg %}
5555
<th>{{ field.label_tag }}:</th>
5656
<td>{{ field }}
5757
{% ifequal field.name "ad" %}
58-
{% if user|in_group:"Area_Director" %}
58+
{% if user|has_role:"Area Director" %}
5959
<label><input type="checkbox" name="ad" value="{{ login.pk }}" /> Assign to me</label>
6060
{% endif %}
6161
{% endifequal %}
@@ -68,7 +68,7 @@ <h1>{% if wg %}
6868
<td></td>
6969
<td class="actions">
7070
{% if wg %}
71-
<a href="{% url wg_view name=wg.acronym %}">Back</a>
71+
<a href="{% url wg_charter acronym=wg.acronym %}">Back</a>
7272
<input type="submit" value="Save"/>
7373
{% else %}
7474
<input type="submit" value="Create"/>
@@ -79,24 +79,8 @@ <h1>{% if wg %}
7979
</form>
8080
{% endblock %}
8181

82-
{% block scripts %}
83-
$(document).ready(function () {
84-
var chairs = eval($("#id_chairs").val()),
85-
secretaries = eval($("#id_secretaries").val()),
86-
techadv = eval($("#id_techadv").val());
87-
$("#id_chairs").tokenInput("/wgcharter/searchPerson/", { hintText: "",
88-
preventDuplicates: true,
89-
prePopulate: chairs });
90-
$("#id_secretaries").tokenInput("/wgcharter/searchPerson/", { hintText: "",
91-
preventDuplicates: true,
92-
prePopulate: secretaries });
93-
$("#id_techadv").tokenInput("/wgcharter/searchPerson/", { hintText: "",
94-
preventDuplicates: true,
95-
prePopulate: techadv });
96-
$("#id_name").focus();
97-
});
98-
{% endblock %}
99-
10082
{% block content_end %}
10183
<script type="text/javascript" src="/js/lib/jquery.tokeninput.js"></script>
84+
<script type="text/javascript" src="/js/lib/json2.js"></script>
85+
<script type="text/javascript" src="/js/emails-field.js"></script>
10286
{% endblock %}

ietf/wgcharter/feeds.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from django.contrib.syndication.feeds import Feed, FeedDoesNotExist
55
from django.utils.feedgenerator import Atom1Feed
66
from django.core.exceptions import ObjectDoesNotExist
7-
from django.core.urlresolvers import reverse
7+
from django.core.urlresolvers import reverse as urlreverse
88
from ietf.utils.history import find_history_active_at
99

1010
from ietf.group.models import Group
@@ -19,16 +19,16 @@ class GroupComments(Feed):
1919
description_template = "feeds/wg_charter_description.html"
2020
def get_object(self, bits):
2121
if len(bits) != 1:
22-
raise ObjectDoesNotExist
22+
raise Group.DoesNotExist
2323
return Group.objects.get(acronym=bits[0])
2424

2525
def title(self, obj):
26-
return "WG Record changes for %s" % obj.acronym
26+
return "WG changes for %s" % obj.acronym
2727

2828
def link(self, obj):
29-
if obj is None:
29+
if not obj:
3030
raise FeedDoesNotExist
31-
return reverse('wg_view', kwargs={'name': obj.acronym})
31+
return urlreverse('wg_charter', kwargs={'acronym': obj.acronym})
3232

3333
def description(self, obj):
3434
return self.title(obj)
@@ -59,7 +59,7 @@ def items(self, obj):
5959
return history
6060

6161
def item_link(self, obj):
62-
return reverse('wg_view', kwargs={'name': obj['group'].acronym})
62+
return urlreverse('wg_charter', kwargs={'acronym': obj['group'].acronym})
6363

6464
def item_pubdate(self, obj):
6565
return obj['date']

ietf/wgcharter/mails.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@
1414
from ietf.doc.models import WriteupDocEvent, DocAlias, GroupBallotPositionDocEvent
1515
from ietf.person.models import Person
1616

17-
# These become part of the subject of the email
18-
types = {}
19-
types['state'] = "State changed"
20-
types['state-notrev'] = "State changed to Not currently under review"
21-
types['state-infrev'] = "State changed to Informal review"
22-
types['state-intrev'] = "State changed to Internal review"
23-
types['state-extrev'] = "State changed to External review"
24-
types['state-iesgrev'] = "State changed to IESG review"
25-
types['state-approved'] = "Charter approved"
26-
types['conclude'] = "Request closing of WG"
27-
2817
def email_secretariat(request, wg, type, text):
2918
to = ["iesg-secretary@ietf.org"]
19+
20+
types = {}
21+
types['state'] = "State changed"
22+
types['state-notrev'] = "State changed to Not currently under review"
23+
types['state-infrev'] = "State changed to Informal review"
24+
types['state-intrev'] = "State changed to Internal review"
25+
types['state-extrev'] = "State changed to External review"
26+
types['state-iesgrev'] = "State changed to IESG review"
27+
types['state-approved'] = "Charter approved"
28+
types['conclude'] = "Request closing of WG"
29+
30+
subject = u"Regarding WG %s: %s" % (wg.acronym, types[type])
3031

3132
text = strip_tags(text)
32-
send_mail(request, to, None,
33-
"Regarding WG %s: %s" % (wg.acronym, types[type]),
33+
send_mail(request, to, None, subject,
3434
"wgcharter/email_secretariat.txt",
3535
dict(text=text,
36-
url=settings.IDTRACKER_BASE_URL + urlreverse('wg_view', kwargs=dict(name=wg.acronym))))
36+
url=settings.IDTRACKER_BASE_URL + urlreverse('wg_charter', kwargs=dict(acronym=wg.acronym))))
3737

3838
def generate_ballot_writeup(request, doc):
3939
e = WriteupDocEvent()

0 commit comments

Comments
 (0)