Skip to content

Commit c125ca1

Browse files
committed
Fix edit pages and milestones functionality to work with RGs - currently the IRTF Chair takes the same role as the AD
- Legacy-Id: 7541
1 parent cb1e72a commit c125ca1

16 files changed

Lines changed: 156 additions & 112 deletions

ietf/group/utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from ietf.group.models import Group, RoleHistory
66
from ietf.person.models import Email
77
from ietf.utils.history import get_history_object_for, copy_many_to_many_for_history
8+
from ietf.ietfauth.utils import has_role
89

910

1011
def save_group_in_history(group):
@@ -98,3 +99,18 @@ def save_milestone_in_history(milestone):
9899
copy_many_to_many_for_history(h, milestone)
99100

100101
return h
102+
103+
def can_manage_group_type(user, group_type):
104+
if group_type == "rg":
105+
return has_role(user, ('IRTF Chair', 'Secretariat'))
106+
elif group_type == "wg":
107+
return has_role(user, ('Area Director', 'Secretariat'))
108+
109+
return has_role(user, 'Secretariat')
110+
111+
def milestone_reviewer_for_group_type(group_type):
112+
if group_type == "rg":
113+
return "IRTF Chair"
114+
else:
115+
return "Area Director"
116+

ietf/templates/base/left_menu.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div></div></li>
7474

7575
<li style="padding-top:0;"><a href="/wg/">Active WGs</a></li>
76-
<li><a href="{% url "ietf.wginfo.views.chartering_wgs" group_type="wg" %}">Chartering WGs</a></li>
76+
<li><a href="{% url "ietf.wginfo.views.chartering_groups" group_type="wg" %}">Chartering WGs</a></li>
7777
<li><a href="{% url "ietf.wginfo.views.bofs" group_type="wg" %}">BoFs</a></li>
7878
<li><a href="http://tools.ietf.org/wg/concluded">Concluded WGs</a></li>
7979
<li><a href="http://www.ietf.org/list/nonwg.html">Non-WG Lists</a></li>

ietf/templates/wginfo/chartering_wgs.html renamed to ietf/templates/wginfo/chartering_groups.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{% extends "base.html" %}
22

3-
{% block title %}Chartering or Re-Chartering Working Groups{% endblock %}
3+
{% block title %}Chartering or Re-Chartering Groups{% endblock %}
44

55
{% block content %}
66
{% load ietf_filters %}
77
{% load ballot_icon %}
88

9-
<h1>Chartering or Re-Chartering Working Groups</h1>
9+
<h1>Chartering or Re-Chartering Groups</h1>
1010

1111
<p>Groups with a charter in state
1212
{% for s in charter_states %}{% if not forloop.first %}, {% if forloop.last %}or {% endif %}{% endif %}<i>{{ s.name }}</i>{% endfor %}.</p>

ietf/templates/wginfo/customize_workflow.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ <h1>Customize Workflow for {{ group.acronym }} {{ group.type.name }}</h1>
3737
<a href="{% url "group_charter" group_type=group.type_id acronym=group.acronym %}">{{ group.acronym }} {{ group.type.name }}</a>. Note that some states are
3838
mandatory for group operation and cannot be deactivated.</p>
3939

40+
{% if group.type_id == "wg" %}
4041
<p>You can see the default Working Group I-D State Diagram
4142
in <a href="http://tools.ietf.org/html/rfc6174#section-4.1">Section 4.1 of RFC6174</a>.</p>
42-
43+
{% endif %}
4344

4445
<h3>States</h3>
4546

ietf/templates/wginfo/edit.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ <h1>
4343
so. New accounts can be <a href="{% url "create_account" %}">created here</a>.</p>
4444

4545
<form class="edit" action="" method="post">{% csrf_token %}
46+
{% for field in form.hidden_fields %}{{ field }}{% endfor %}
4647
<table>
4748
{% for field in form.visible_fields %}
4849
<tr>
4950
<th>{{ field.label_tag }} {% if field.field.required %}*{% endif %}</th>
5051
<td>{{ field }}
51-
{% if field.name == "ad" and user|has_role:"Area Director" %}
52-
<label><input type="checkbox" name="ad" value="{{ login.pk }}" /> Assign to me</label>
52+
{% if field.name == "ad" and request.user|has_role:"Area Director" %}
53+
<label><input type="checkbox" name="ad" value="{{ request.user.person.pk }}" /> Assign to me</label>
5354
{% endif %}
5455
{% if field.help_text %}<div class="help">{{ field.help_text }}</div>{% endif %}
5556
{{ field.errors }}

ietf/templates/wginfo/edit_milestones.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ <h1>{{ title }}</h1>
5151

5252
{% if needs_review %}
5353
Note that as {{ group.type.name }} Chair you cannot edit descriptions of existing
54-
milestones and milestones you add are subject to review by the Area
55-
Director.
54+
milestones and milestones you add are subject to review by the {{ reviewer }}.
5655
{% endif %}
5756
</p>
5857

@@ -86,7 +85,7 @@ <h1>{{ title }}</h1>
8685

8786
<tr class="edit-milestone{% if form.changed %} changed{% endif %}"><td colspan="2">{% include "wginfo/milestone_form.html" %}</td></tr>
8887
{% endfor %}
89-
<tr class="milestone add"><td></td><td>Add {% if milestone_set == "chartering" %}charter{% endif%} milestone {% if needs_review %}for AD review{% endif %}</td></tr>
88+
<tr class="milestone add"><td></td><td>Add {% if milestone_set == "chartering" %}charter{% endif%} milestone {% if needs_review %}for {{ reviewer }} review{% endif %}</td></tr>
9089
<tr class="edit-milestone template"><td colspan="2">{% include "wginfo/milestone_form.html" with form=empty_form %}</td></tr>
9190
</table>
9291

ietf/templates/wginfo/group_base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h1>{{ group.name}} ({{ group.acronym }})
7474
| <a href="{{ group.list_archive }}">List Archive &raquo;</a>
7575
{% endif %}
7676
{% if group.has_tools_page %}
77-
| <a href="http://tools.ietf.org/wg/{{ group.acronym }}/">Tools WG Page &raquo;</a>
77+
| <a href="http://tools.ietf.org/{{ group.type_id }}/{{ group.acronym }}/">Tools {{ group.type.name }} Page &raquo;</a>
7878
{% endif %}
7979
</div>
8080

ietf/templates/wginfo/group_charter.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="ietf-box ietf-group-details">
1313

1414
{% if group.state_id == "conclude" %}
15-
<span class="ietf-concluded-warning">Note: The data for concluded WGs
15+
<span class="ietf-concluded-warning">Note: The data for concluded {{ group.type.name }}s
1616
is occasionally incorrect.</span>
1717
{% endif %}
1818

@@ -162,7 +162,7 @@ <h2>{% if group.state_id == "proposed" %}Proposed{% endif %} Milestones</h2>
162162

163163
{% if milestones_in_review %}
164164
<p>+ {{ milestones_in_review|length }} new milestone{{ milestones_in_review|pluralize }}
165-
currently in Area Director review.</p>
165+
currently in {{ milestone_reviewer }} review.</p>
166166
{% endif %}
167167

168168
{% endblock %}

ietf/templates/wginfo/milestone_form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{# assumes group, form, needs_review are in the context #}
1+
{# assumes group, form, needs_review, reviewer are in the context #}
22
<input type="hidden" name="prefix" value="{{ form.prefix|default:"" }}"/>
33
{{ form.id }}
44

@@ -35,7 +35,7 @@
3535
<td>Review:</td>
3636
<td class="accept">
3737
This milestone is not active yet, awaiting
38-
AD acceptance{% if needs_review %}.{% else %}: {{ form.accept }}{% endif %}
38+
{{ reviewer }} acceptance{% if needs_review %}.{% else %}: {{ form.accept }}{% endif %}
3939
</td>
4040
</tr>
4141
{% endif %}

ietf/templates/wginfo/reminder_milestones_need_review.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% autoescape off %}{% filter wordwrap:73 %}{{ milestones|length }} new milestone{{ milestones|pluralize }} in "{{ group.name }}" {% if milestones|length > 1 %}need{% else %}needs{%endif %} an AD review:
1+
{% autoescape off %}{% filter wordwrap:73 %}{{ milestones|length }} new milestone{{ milestones|pluralize }} in "{{ group.name }}" {% if milestones|length > 1 %}need{% else %}needs{%endif %} review by the {{ reviewer }}:
22

33
{% for m in milestones %}"{{ m.desc }}"{% if m.days_ready != None %}
44
Waiting for {{ m.days_ready }} day{{ m.days_ready|pluralize }}.{% endif %}

0 commit comments

Comments
 (0)