Skip to content

Commit 735efac

Browse files
committed
Add charter documents to iesg/agenda and iesg/agenda/documents
Keep the ordering for drafts the same on iesg/agenda and iesg/agenda/documents Allow setting the responsible AD for a charter document Change the UI of the charter page to use editlink for changing attributes and buttons for actions (to align with drafts and conflict-reviews) - Legacy-Id: 4769
1 parent 7a1a67f commit 735efac

9 files changed

Lines changed: 153 additions & 49 deletions

File tree

ietf/iesg/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ def agenda_docs(date, next_agenda):
207207
m.balloting_started = e.time if e else datetime.datetime.min
208208

209209
docmatches.append(m)
210+
211+
# Be careful to keep this the same as what's used in agenda_documents
212+
docmatches.sort(key=lambda d: d.balloting_started)
210213

211214
res = dict(("s%s%s%s" % (i, j, k), []) for i in range(2, 5) for j in range (1, 4) for k in range(1, 4))
212215
for id in docmatches:
@@ -232,7 +235,8 @@ def agenda_wg_actions(date):
232235
section_key = "s" + get_wg_section(c.group)
233236
if section_key not in res:
234237
res[section_key] = []
235-
res[section_key].append({'obj': c.group})
238+
# Cleanup - Older view code wants obj, newer wants doc. Older code should be moved forward
239+
res[section_key].append({'obj': c.group, 'doc': c})
236240
return res
237241

238242
def agenda_management_issues(date):
@@ -370,6 +374,7 @@ def _agenda_data(request, date=None):
370374
def agenda(request, date=None):
371375
data = _agenda_data(request, date)
372376
data['private'] = 'private' in request.REQUEST
377+
data['settings'] = settings
373378
return render_to_response("iesg/agenda.html", data, context_instance=RequestContext(request))
374379

375380
def agenda_txt(request):

ietf/templates/idrfc/document_charter.html

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{% extends "base.html" %}
1+
{% extends "idrfc/doc_main.html" %}
2+
{% comment extends "base.html" %}
3+
{% endcomment %}
24

35
{% load ietf_filters %}
46

@@ -37,37 +39,25 @@
3739
<td><a href="/doc/help/state/charter/">Charter State</a>:</td>
3840
<td>
3941
<div>
40-
<a title="{{ doc.get_state.desc }}"{% if not snapshot and user|has_role:"Area Director,Secretariat" %} href="{% url charter_change_state name=doc.name %}"{% endif %}>{{ doc.get_state.name }}</a>
41-
{% if chartering == "initial" %}(Initial Chartering){% endif %}
42-
{% if chartering == "rechartering" %}(Rechartering){% endif %}
42+
<a title="{{ doc.get_state.desc }}"
43+
{% if not snapshot and user|has_role:"Area Director,Secretariat" %}
44+
class="editlink" href="{% url charter_change_state name=doc.name %}"
45+
{% endif %}>
46+
{{ doc.get_state.name }}
47+
</a>
48+
{% if chartering == "initial" %} - (Initial Chartering){% endif %}
49+
{% if chartering == "rechartering" %} - (Rechartering){% endif %}
4350

44-
{% if not snapshot and user|has_role:"Area Director,Secretariat" %}
45-
46-
47-
{% if chartering %}
48-
- <a href="{% url charter_startstop_process name=doc.name option='abandon' %}">Abandon effort</a>
49-
50-
{% if request.user|has_role:"Secretariat" %}
51-
- <a href="{% url charter_approve name=doc.name %}">Approve charter</a>
52-
{% endif %}
53-
54-
{% else %}
55-
{% if group.state_id == "proposed" or group.state_id == "bof" %}
56-
- <a href="{% url charter_submit name=doc.name option='initcharter' %}">Start chartering</a>
57-
{% else %}
58-
- <a href="{% url charter_submit name=doc.name option='recharter' %}">Recharter</a>
59-
{% endif %}
60-
{% endif %}
61-
62-
{% endif %}
6351
</div>
6452

6553
{% if not snapshot and chartering %}
6654
<div class="telechat">
67-
{% if not telechat %}Not on agenda of IESG telechat{% else %}On agenda of {{ telechat.telechat_date|date:"Y-m-d" }} IESG telechat{% endif %}
68-
{% if user|has_role:"Area Director,Secretariat" %}
69-
- <a href="{% url charter_telechat_date name=doc.name %}">Change</a>
70-
{% endif %}
55+
<a
56+
{% if user|has_role:"Area Director,Secretariat" %}
57+
class="editlink" href="{% url charter_telechat_date name=doc.name %}"
58+
{% endif %}>
59+
{% if not telechat %}Not on agenda of IESG telechat{% else %}On agenda of {{ telechat.telechat_date|date:"Y-m-d" }} IESG telechat{% endif %}
60+
</a>
7161
</div>
7262

7363
{% if ballot_summary %}
@@ -88,14 +78,20 @@
8878
</tr>
8979
{% endif %}
9080

81+
<tr>
82+
<td>Responsible AD:</td>
83+
<td><a {% if request.user|has_role:"Area Director,Secretariat" %}class="editlink" href="{% url charter_edit_ad name=doc.name %}"{% endif %}>{{ doc.ad|default:"none" }}</a> </td>
84+
</tr>
85+
9186
<tr><td colspan='2'><hr size='1' noshade /></td></tr>
9287

9388
<tr>
9489
<td>Send notices to:</td>
95-
<td>{{ doc.notify|default:"none" }}
96-
{% if user|has_role:"Area Director,Secretariat" %}
97-
- <a href="{% url charter_edit_notify name=doc.name %}">Change</a>
98-
{% endif %}
90+
<td><a {% if user|has_role:"Area Director,Secretariat" %}
91+
class="editlink" href="{% url charter_edit_notify name=doc.name %}"
92+
{% endif %}>
93+
{{ doc.notify|default:"none" }}
94+
</a>
9995
</td>
10096
</tr>
10197

@@ -107,6 +103,26 @@
107103
<div class="actions">
108104
<a href="/feed/group-changes/{{ group.acronym }}/">Atom feed</a>
109105
</div>
106+
107+
<div>
108+
{% if not snapshot and user|has_role:"Area Director,Secretariat" %}
109+
{% if chartering %}
110+
<span id="charter_abandon_effort_button" class="yui-button yui-link-button" style="margin-left:2px;margin-top:2px">{% url charter_startstop_process name=doc.name option='abandon' as abandon_url %}{% if abandon_url %}<span class="first-child"><a href="{{abandon_url}}">Abandon Effort</a></span>{% endif %}</span>
111+
112+
{% if request.user|has_role:"Secretariat" %}
113+
<span id="charter_approve_button" class="yui-button yui-link-button" style="margin-left:2px;margin-top:2px">{% url charter_approve name=doc.name as approve_url %}{% if approve_url %}<span class="first-child"><a href="{{approve_url}}">Approve Charter</a></span>{% endif %}</span>
114+
{% endif %}
115+
116+
{% else %}
117+
{% if group.state_id == "proposed" or group.state_id == "bof" %}
118+
<span id="charter_start_button" class="yui-button yui-link-button" style="margin-left:2px;margin-top:2px">{% url charter_submit name=doc.name option='initcharter' as start_url %}{% if start_url %}<span class="first-child"><a href="{{start_url}}">Start Chartering</a></span>{% endif %}</span>
119+
{% else %}
120+
<span id="charter_recharter_button" class="yui-button yui-link-button" style="margin-left:2px;margin-top:2px">{% url charter_submit name=doc.name option='recharter' as recharter_url %}{% if recharter_url %}<span class="first-child"><a href="{{recharter_url}}">Recharter</a></span>{% endif %}</span>
121+
{% endif %}
122+
{% endif %}
123+
124+
{% endif %}
125+
</div>
110126
</div>
111127

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

ietf/templates/iesg/agenda.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
.agenda blockquote { margin-left: 30px; width: 70ex; font-style:italic;}
4747
table.agenda-doc { margin-left: 30px; margin-top:0.5em; margin-bottom: 0.5em; width: 95%; }
4848
table.agenda-doc > tbody > tr { vertical-align:top; }
49+
div.agenda-wg { margin-left: 30px; margin-top:0.5em; margin-bottom: 0.5em; width: 95%; }
4950
{% endblock morecss %}
5051

5152
{% block pagehead %}

ietf/templates/iesg/agenda_documents_redesign.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,22 @@ <h1>Documents on Future IESG Telechat Agendas</h1>
131131
{% if t.docs.s333 %}<tr class="header"><td colspan="6">3.3.3 For Action</td></tr>{% endif %}
132132
{% for doc in t.docs.s333 %}{% include "iesg/agenda_documents_row_redesign.html" %}{%endfor%}
133133

134+
<tr class="header"><td colspan="6">4. Working Group Actions</td></tr>
135+
136+
{% if t.docs.s411 or t.docs.s412%}<tr class="header"><td colspan="6">4.1 WG Creation</td></tr>{% endif %}
137+
138+
{% if t.docs.s411 %}<tr class="header"><td colspan="6">4.1.1 Proposed for IETF Review</td></tr>{% endif %}
139+
{% for doc in t.docs.s411 %}{% include "iesg/agenda_documents_row_redesign.html" %}{%endfor%}
140+
{% if t.docs.s412 %}<tr class="header"><td colspan="6">4.1.2 Proposed for Approval</td></tr>{% endif %}
141+
{% for doc in t.docs.s412 %}{% include "iesg/agenda_documents_row_redesign.html" %}{%endfor%}
142+
143+
{% if t.docs.s421 or t.docs.s422 %}<tr class="header"><td colspan="6">4.2 WG Rechartering</td></tr>{% endif %}
144+
145+
{% if t.docs.s421 %}<tr class="header"><td colspan="6">4.2.1 Under Evaluation for IETF Review</td></tr>{% endif %}
146+
{% for doc in t.docs.s421 %}{% include "iesg/agenda_documents_row_redesign.html" %}{%endfor%}
147+
{% if t.docs.s422 %}<tr class="header"><td colspan="6">4.2.2 Proposed for Approval</td></tr>{% endif %}
148+
{% for doc in t.docs.s422 %}{% include "iesg/agenda_documents_row_redesign.html" %}{%endfor%}
149+
134150
{% endfor %}
135151

136152
</table>

ietf/templates/iesg/agenda_documents_row_redesign.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<tr
4040
{% if user|in_group:"Area_Director" %}
4141
{% if doc|my_position:user|equal:"Discuss" %}style="background:#ffa0a0;"{% endif %}
42+
{% if doc|my_position:user|equal:"Block" %}style="background:#ffa0a0;"{% endif %}
4243
{% if doc|my_position:user|equal:"Abstain" %}style="background:#ffff00;"{% endif %}
4344
{% if doc|my_position:user|equal:"Yes" or doc|my_position:user|slugify|equal:"no-objection" %}style="background:#a0ffa0;"{% endif %}
4445
{% if doc|my_position:user|equal:"Recuse" %}style="background:#c0c0c0;"{% endif %}

ietf/templates/iesg/agenda_wg.html

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,24 @@
3131
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3232
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
{% endcomment %}
34+
{% load ballot_icon_redesign %}
3435
{% if title2_first %}{% if title1_first %}<h2>{{ title1 }}</h2>
3536
{% endif %}
3637
<h3>{{ title2 }}</h3>
3738
{% endif %}<h4>{{ title3 }}</h4>
3839

3940
{% for wg in section_wgs %}
40-
{% if forloop.first %}
41-
<table>
42-
<tr><th>Area</th><th>Date</th><th></th></tr>
43-
{% endif %}
4441

45-
<tr>
46-
<td>{{ wg.obj.parent.acronym|upper }}</td>
47-
<td>{{ wg.obj.time|date:"M d"}}</td>
48-
<td>
49-
<a href="{{ wg.obj.txt_link }}">
50-
{{ wg.obj.name|escape }} ({{wg.obj.acronym}})
51-
</a>
52-
</td>
53-
</tr>
54-
55-
{% if forloop.last %}
56-
</table>
57-
{% endif %}
42+
<div class="agenda-wg">
43+
<span width="30%" style="float:right;">
44+
{% ballot_icon wg.doc %}
45+
</span>
46+
<span width="30%">
47+
<div> <a href="{{ wg.doc.get_absolute_url }}">{{ wg.doc.name}}-({{wg.doc.rev}})</a> <a href="{{ settings.CHARTER_TXT_URL }}{{ wg.doc.filename_with_rev }}">[txt]</a> </div>
48+
<div>{{ wg.doc.group.name|escape }} ({{wg.doc.group.acronym}})</div>
49+
<div>Area: {{ wg.doc.group.parent.acronym|upper }} ({{ wg.doc.ad|default:"Sponsoring AD not assigned" }})</div>
50+
</span>
51+
</div>
5852

5953
{% empty %}
6054
<p>NONE</p>

ietf/wgcharter/tests.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,29 @@ def test_edit_notify(self):
132132
charter = Document.objects.get(name=charter.name)
133133
self.assertEquals(charter.notify, "someone@example.com, someoneelse@example.com")
134134

135+
def test_edit_ad(self):
136+
make_test_data()
137+
138+
charter = Group.objects.get(acronym="mars").charter
139+
140+
url = urlreverse('charter_edit_ad', kwargs=dict(name=charter.name))
141+
login_testing_unauthorized(self, "secretary", url)
142+
143+
# normal get
144+
r = self.client.get(url)
145+
self.assertEquals(r.status_code, 200)
146+
q = PyQuery(r.content)
147+
self.assertEquals(len(q('select[name=ad]')),1)
148+
149+
# post
150+
self.assertTrue(not charter.ad)
151+
ad2 = Person.objects.get(name='Ad No2')
152+
r = self.client.post(url,dict(ad=str(ad2.pk)))
153+
self.assertEquals(r.status_code, 302)
154+
155+
charter = Document.objects.get(name=charter.name)
156+
self.assertEquals(charter.ad, ad2)
157+
135158
def test_submit_charter(self):
136159
make_test_data()
137160

ietf/wgcharter/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
url(r'^(?P<option>initcharter|recharter|abandon)/$', "ietf.wgcharter.views.change_state", name='charter_startstop_process'),
88
url(r'^telechat/$', "ietf.wgcharter.views.telechat_date", name='charter_telechat_date'),
99
url(r'^notify/$', "ietf.wgcharter.views.edit_notify", name='charter_edit_notify'),
10+
url(r'^ad/$', "ietf.wgcharter.views.edit_ad", name='charter_edit_ad'),
1011
url(r'^(?P<ann>action|review)/$', "ietf.wgcharter.views.announcement_text", name="charter_edit_announcement"),
1112
url(r'^ballotwriteupnotes/$', "ietf.wgcharter.views.ballot_writeupnotes"),
1213
url(r'^approve/$', "ietf.wgcharter.views.approve", name='charter_approve'),

ietf/wgcharter/views.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,53 @@ def edit_notify(request, name):
267267
login=login),
268268
context_instance=RequestContext(request))
269269

270+
class AdForm(forms.Form):
271+
ad = forms.ModelChoiceField(Person.objects.filter(role__name="ad", role__group__state="active").order_by('name'),
272+
label="Responsible AD", empty_label="(None)", required=True)
273+
274+
def __init__(self, *args, **kwargs):
275+
super(self.__class__, self).__init__(*args, **kwargs)
276+
277+
# if previous AD is now ex-AD, append that person to the list
278+
ad_pk = self.initial.get('ad')
279+
choices = self.fields['ad'].choices
280+
if ad_pk and ad_pk not in [pk for pk, name in choices]:
281+
self.fields['ad'].choices = list(choices) + [("", "-------"), (ad_pk, Person.objects.get(pk=ad_pk).plain_name())]
282+
283+
@role_required("Area Director", "Secretariat")
284+
def edit_ad(request, name):
285+
"""Change the responsible Area Director for this charter."""
286+
287+
charter = get_object_or_404(Document, type="charter", name=name)
288+
login = request.user.get_profile()
289+
290+
if request.method == 'POST':
291+
form = AdForm(request.POST)
292+
if form.is_valid():
293+
new_ad = form.cleaned_data['ad']
294+
if new_ad != charter.ad:
295+
save_document_in_history(charter)
296+
e = DocEvent(doc=charter, by=login)
297+
e.desc = "Responsible AD changed to %s" % new_ad.plain_name()
298+
if charter.ad:
299+
e.desc += " from %s" % charter.ad.plain_name()
300+
e.type = "changed_document"
301+
e.save()
302+
charter.ad = new_ad
303+
charter.time = e.time
304+
charter.save()
305+
306+
return HttpResponseRedirect(reverse('doc_view', kwargs={'name': charter.name}))
307+
else:
308+
init = { "ad" : charter.ad_id }
309+
form = AdForm(initial=init)
310+
311+
return render_to_response('wgcharter/change_ad.html',
312+
{'form': form,
313+
'charter': charter,
314+
},
315+
context_instance = RequestContext(request))
316+
270317

271318
class UploadForm(forms.Form):
272319
content = forms.CharField(widget=forms.Textarea, label="Charter text", help_text="Edit the charter text", required=False)

0 commit comments

Comments
 (0)