Skip to content

Commit 2e29298

Browse files
committed
Move group charter actions from box and button next to header up to an
edit menu under the ordinary group menu - Legacy-Id: 6219
1 parent 5924024 commit 2e29298

4 files changed

Lines changed: 30 additions & 29 deletions

File tree

ietf/templates/wginfo/group_base.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ <h1>{{ group.name}} ({{ group.acronym }})
7070
</h1>
7171

7272
<div class="ietf-navset">
73+
<div>
7374
<a {% if selected == "documents" %}class="selected"{% else %}href="{% url ietf.wginfo.views.group_documents acronym=group.acronym %}"{% endif %}>Documents</a> |
7475
<a {% if selected == "charter" %}class="selected"{% else %}href="{% url ietf.wginfo.views.group_charter acronym=group.acronym %}"{% endif %}>Charter</a> |
7576

@@ -78,6 +79,15 @@ <h1>{{ group.name}} ({{ group.acronym }})
7879
<a href="{{ group.list_archive }}">List Archive &raquo;</a> |
7980
{% endif %}
8081
<a href="http://tools.ietf.org/wg/{{ group.acronym }}/">Tools WG Page &raquo;</a>
82+
</div>
83+
84+
{% if menu_actions %}
85+
<div class="actions">
86+
{% for name, url in menu_actions %}
87+
<a href="{{ url }}">{{ name }}</a>
88+
{% endfor %}
89+
</div>
90+
{% endif %}
8191
</div>
8292

8393
{% block group_content %}

ietf/templates/wginfo/group_charter.html

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@
138138

139139
</table>
140140

141-
{% if user|has_role:"Area Director,Secretariat" %}
142-
<div style="margin: 2px; margin-top: 2em;">
143-
{% for name, url in actions %}
144-
<a href="{{ url }}">{{ name }}</a> {% if not forloop.last %} | {% endif %}
145-
{% endfor %}
146-
</div>
147-
{% endif %}
148141
</div>
149142

150143
{% with group.groupurl_set.all as urls %}
@@ -161,14 +154,7 @@ <h2>Charter for {% if group.state_id == "proposed" %}Proposed{% endif %} Working
161154

162155
<p>{{ group.charter_text|escape|format_charter|safe }}</p>
163156

164-
<h2>{% if group.state_id == "proposed" %}Proposed{% endif %} Milestones
165-
166-
{% if group.state_id != "proposed" %}
167-
{% if user|has_role:"Area Director,Secretariat" or is_chair %}
168-
<a class="button" href="{% url wg_edit_milestones acronym=group.acronym %}">Add or edit milestones</a>
169-
{% endif %}
170-
{% endif %}
171-
</h2>
157+
<h2>{% if group.state_id == "proposed" %}Proposed{% endif %} Milestones</h2>
172158

173159
{% with group.milestones as milestones %}
174160
{% include "wginfo/milestones.html" %}

ietf/wginfo/views.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,27 @@ def chartering_wgs(request):
173173

174174
def construct_group_menu_context(request, group, selected, others):
175175
"""Return context with info for the group menu filled in."""
176+
actions = []
177+
178+
is_chair = group.has_role(request.user, "chair")
179+
is_ad_or_secretariat = has_role(request.user, ("Area Director", "Secretariat"))
180+
181+
if group.state_id != "proposed" and (is_chair or is_ad_or_secretariat):
182+
actions.append((u"Add or edit milestones", urlreverse("wg_edit_milestones", kwargs=dict(acronym=group.acronym))))
183+
184+
if group.state_id != "conclude" and is_ad_or_secretariat:
185+
actions.append((u"Edit group", urlreverse("group_edit", kwargs=dict(acronym=group.acronym))))
186+
187+
if is_chair or is_ad_or_secretariat:
188+
actions.append((u"Customize workflow", urlreverse("ietf.wginfo.edit.customize_workflow", kwargs=dict(acronym=group.acronym))))
189+
190+
if group.state_id in ("active", "dormant") and is_ad_or_secretariat:
191+
actions.append((u"Request closing group", urlreverse("wg_conclude", kwargs=dict(acronym=group.acronym))))
192+
176193
d = {
177194
"group": group,
178195
"selected": selected,
196+
"menu_actions": actions,
179197
}
180198

181199
d.update(others)
@@ -259,25 +277,11 @@ def group_charter(request, acronym):
259277
fill_in_charter_info(group, include_drafts=False)
260278
group.delegates = Email.objects.filter(role__group=group, role__name="delegate")
261279

262-
actions = []
263-
if group.state_id != "conclude":
264-
actions.append((u"Edit %s" % group.type.name, urlreverse("group_edit", kwargs=dict(acronym=group.acronym))))
265-
266280
e = group.latest_event(type__in=("changed_state", "requested_close",))
267281
requested_close = group.state_id != "conclude" and e and e.type == "requested_close"
268282

269-
if group.state_id in ("active", "dormant"):
270-
actions.append((u"Request closing %s" % group.type.name, urlreverse("wg_conclude", kwargs=dict(acronym=group.acronym))))
271-
272-
is_chair = request.user.is_authenticated() and group.role_set.filter(name="chair", person__user=request.user)
273-
274-
if is_chair or has_role(request.user, "Secretariat"):
275-
actions.append((u"Customize workflow", urlreverse("ietf.wginfo.edit.customize_workflow", kwargs=dict(acronym=group.acronym))))
276-
277283
return render_to_response('wginfo/group_charter.html',
278284
construct_group_menu_context(request, group, "charter", {
279-
"actions": actions,
280-
"is_chair": is_chair,
281285
"milestones_in_review": group.groupmilestone_set.filter(state="review"),
282286
"requested_close": requested_close,
283287
}), RequestContext(request))

static/css/base2.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ a img { border: 0; }
7676
.ietf-navset .selected { font-weight:bold; padding: 0 3px; }
7777
.ietf-navset a, .ietf-navset a:visited { color: white; padding:0 3px; }
7878

79+
.ietf-navset .actions { margin-top: 0.5em; font-style: italic; font-size: 90%; }
7980

8081
.ietf-ballot .left { background: #edf5ff; width:160px; padding-left: 10px; }
8182
.ietf-ballot .right { padding-left: 15px; padding-right:15px; width:610px;padding-top:0px;}

0 commit comments

Comments
 (0)