Skip to content

Commit 61697ed

Browse files
committed
Improve shepherd assignation by email.
Check if multiple persons have the same email. If person exist assign him/her directly. If person doesn't exists inform by email: person, wg chairs and secretariat. Inform the user what's going on in each step. See ietf-tools#558 - Legacy-Id: 2734
1 parent 204a4dd commit 61697ed

12 files changed

Lines changed: 202 additions & 197 deletions
Lines changed: 32 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,40 @@
1-
{% extends "base.html" %}
1+
{% extends "wginfo/wg_base.html" %}
2+
{% load ietf_filters %}
23

3-
{% block title %}Edit info on {{ doc }}{% endblock %}
4+
{% block title %}Chage shepherd for {{ doc }}{% endblock %}
45

5-
{% block morecss %}
6-
form.edit-info #id_state_change_notice_to {
7-
width: 600px;
8-
}
9-
form.edit-info #id_note {
10-
width: 600px;
11-
height: 150px;
12-
}
13-
form.edit-info .actions {
14-
padding-top: 20px;
15-
}
16-
{% endblock %}
6+
{% block wg_content %}
177

18-
{% block content %}
19-
{% load ietf_filters %}
20-
<h1>Edit info on {{ doc }}</h1>
8+
<p>
9+
<a href="{% url manage_shepherds wg.group_acronym.acronym %}">Return to shepherd list</a>
10+
</p>
2111

22-
Shepherd: {{ doc.shepherd }}
12+
<h1>Change shepherd for {{ doc }}</h1>
13+
14+
<table style="width: 100%;"><tr style="vertical-align: top;"><td style="width: 50%;">
15+
<form action="" method="POST">
16+
<table class="ietf-table" style="width: 100%;">
17+
<tr><th>Actual shepherd</th></tr>
18+
<tr><td>{% if doc.shepherd %}{{ doc.shepherd }}{% else %}No shephered assigned{% endif %}</td></tr>
19+
</table>
20+
<input type="hidden" name="update_shepherd" value="1" />
21+
<input type="submit" name="remove_shepherd" value="Unassign shepherd" />
22+
<input type="submit" name="setme" value="Set me as shepherd of this document" />
23+
</form>
24+
</td><td style="width: 50%;">
25+
<form action="" method="POST">
26+
<table class="ietf-table" style="width: 100%;">
27+
<tr><th>Change shepherd</th></tr>
28+
{% if form.message %}
29+
<tr><td class="message message-{{ form.message.type }}">
30+
{{ form.message.value }}
31+
</td></tr>
32+
{% endif %}
2333

24-
{{ form.non_field_errors }}
25-
<form class="edit-info" action="" method="POST">
26-
<table>
27-
{% for field in form %}
28-
<tr>
29-
<th>{{ field.label_tag }}:</th>
30-
<td>{{ field }}
31-
{% ifequal field.name "telechat_date" %}{{ form.returning_item }} {{ form.returning_item.label_tag }} {{ form.returning_item.errors }}{% endifequal %}
32-
{% ifequal field.name "job_owner" %}
33-
{% if user|in_group:"Area_Director" %}
34-
<label><input type="checkbox" name="job_owner" value="{{ login.id }}" /> Assign to me</label>
35-
{% endif %}
36-
{% endifequal %}
37-
{% if field.help_text %}<div class="help">{{ field.help_text }}</div>{% endif %}
38-
{{ field.errors }}</td>
39-
</tr>
40-
{% endfor %}
41-
<tr>
42-
<td></td>
43-
<td class="actions">
44-
<a href="{{ doc.idinternal.get_absolute_url }}">Back</a>
45-
<input type="submit" value="Save"/>
46-
</td>
47-
</tr>
34+
<tr><td>{{ form.as_p }}</td></tr>
4835
</table>
36+
<input type="submit" name="change_sheperd" value="Change shepherd" />
37+
{% if form.can_cancel %}<a href="">No! I don't want to continue</a>{% endif %}
4938
</form>
39+
</td></tr></table>
5040
{% endblock %}

ietf/templates/wgchairs/edit_management_shepherd_email.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
{% extends "wginfo/wg_base.html" %}
22

3-
{% block morecss %}
4-
{{ block.super }}
5-
.wg-chair-management ul {
6-
list-style: none;
7-
}
8-
9-
.wg-chair-management input {
10-
border: 1px solid green;
11-
}
12-
{% endblock %}
133

144
{% block wg_titledetail %}Delegates{% endblock %}
155

166
{% block wg_content %}
177
<div class="wg-chair-management">
18-
<h2>Add new delegate</h2>
8+
9+
<h2>Manage delegates</h2>
10+
<p><strong>Please,</strong> rembember that you only can assign a maximum of three delegates.</p>
11+
12+
<table style="width: 100%;">
13+
<tr style="vertical-align: top;"><td>
14+
{% if delegates %}
15+
<form action="" method="POST">
16+
<table class="ietf-table" style="width: 100%">
17+
<tr><th>Remove</th><th style="Width: 100%">Delegate name</th></tr>
18+
{% for delegate in delegates %}
19+
<tr class="{% cycle "oddrow" "evenrow" %}"><td><input type="checkbox" name="delete" value="{{ delegate.pk }}" /></td><td>{{ delegate.person }}</td></tr>
20+
{% endfor %}
21+
</table>
22+
<input type="submit" value="Remove delegate(s)" name="remove" />
23+
</form>
24+
{% else %}
25+
No delegates
26+
{% endif %}
27+
</td>
28+
<td>
29+
<table class="ietf-table" style="width: 100%;">
30+
<tr><th>Add new delegate</th></tr>
1931
{% if add_form.message %}
20-
<div class="message message-{{ add_form.message.type }}">
32+
<tr><td class="message message-{{ add_form.message.type }}">
2133
{{ add_form.message.value }}
22-
</div>
34+
</td></tr>
2335
{% endif %}
36+
<tr><td>
2437
{% if can_add %}
2538
<form action="" method="POST">
2639
{{ add_form.as_p }}
@@ -30,26 +43,11 @@ <h2>Add new delegate</h2>
3043
</p>
3144
</form>
3245
{% else %}
33-
<p>
3446
You can only assign three delegates. Please remove delegates to add a new one.
35-
</p>
36-
{% endif %}
37-
38-
<h2>Delegates</h2>
39-
{% if delegates %}
40-
<form action="" method="POST">
41-
<table>
42-
<tr><th>Remove</th><th>Delegate name</th></tr>
43-
{% for delegate in delegates %}
44-
<tr><td><input type="checkbox" name="delete" value="{{ delegate.pk }}" /></td><td>{{ delegate.person }}</td></tr>
45-
{% endfor %}
46-
</table>
47-
<input type="submit" value="Remove delegate(s)" name="remove" />
48-
</form>
49-
{% else %}
50-
<p>
51-
No delegates
52-
</p>
5347
{% endif %}
48+
</td></tr>
49+
</table>
50+
</td></tr>
51+
</table>
5452
</div>
5553
{% endblock %}

ietf/templates/wgchairs/manage_workflow.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
{% block wg_titledetail %}Manage Workflow{% endblock %}
44

5+
{% block pagehead %}
6+
{{ block.super }}
7+
<script type="text/javascript" src="/js/lib/jquery-1.4.2.min.js"></script>
8+
<script type="text/javascript" src="/js/yui/yui-20100305.js"></script>
9+
<script type="text/javascript" src="/js/base.js"></script>
10+
{% endblock pagehead %}
11+
512
{% block wg_content %}
613
<div class="wg-workflow-management">
714
<h2>Edit workflow</h2>
@@ -111,10 +118,6 @@ <h2>Edit workflow</h2>
111118
</div>
112119
</div>
113120

114-
<script type="text/javascript" src="/js/lib/jquery-1.4.2.min.js"></script>
115-
<script type="text/javascript" src="/js/yui/yui-20100305.js"></script>
116-
<script type="text/javascript" src="/js/base.js"></script>
117-
118121
<script type="text/javascript">
119122
//<![CDATA[
120123
var tabView = new YAHOO.widget.TabView('mytabs');

ietf/templates/wgchairs/notexistsdelegate_delegate_email.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ chair }} as a WG Chair of {{ wg }} wants to add you as a {{ wg }} WG Delegate.
1+
{{ chair }} as a WG Chair of {{ wg }} wants to add you as a {{ wg }} {% if shepherd %}shepherd of document {{ shepherd }}{% else %}WG Delegate{% endif %}.
22

33
You don't have an user/password to log into the datatracker so you must contact
44
the Secretariat at iesg-secretary@ietf.org in order to get your credentials.

ietf/templates/wgchairs/notexistsdelegate_secretariat_email.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ chair }} as a WG Chair of {{ wg }} wants to add a person with email
2-
{{ delegate_email }} as a WG Delegate.
2+
{{ delegate_email }} as a {% if shepherd %}shepherd of document {{ shepherd }}{% else %}WG Delegate{% endif %}.
33

44
This person don't have an user/password to log into the datatracker so
55
an email has been seent to {{ delegate_email }} in order to he/she contacs the
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ chair }} as a WG Chair of {{ wg }} wants to add a person with email
2-
{{ delegate_email }} as a WG Delegate.
2+
{{ delegate_email }} as a {% if shepherd %}shepherd of document {{ shepherd }}{% else %}WG Delegate{% endif %}.
33

44
This person don't have an user/password to log into the datatracker so
55
an email has been seent to {{ delegate_email }} in order to he/she contacs the
@@ -8,4 +8,4 @@ Secretariat to request his/her credentials.
88
When he/she gets her credentials then he/she will send an email to
99
{{ chair }} at {{ chair.email.1 }}.
1010

11-
{{ chair }} could then assign this person as WG Delegate.
11+
{{ chair }} could then assign this person as {% if shepherd %}shepherd of document {{ shepherd }}{% else %}WG Delegate{% endif %}.

ietf/templates/wgchairs/wg_shepherd_documents.html

Lines changed: 65 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,34 @@
3434
{% endcomment %}
3535
{% block wg_titledetail %}Documents{% endblock %}
3636

37+
{% block pagehead %}
38+
{{ block.super }}
39+
<script type="text/javascript" src="/js/lib/jquery-1.4.2.min.js"></script>
40+
<script type="text/javascript" src="/js/yui/yui-20100305.js"></script>
41+
<script type="text/javascript" src="/js/base.js"></script>
42+
{% endblock pagehead %}
43+
3744
{% block wg_content %}
3845

39-
<table class="ietf-table ietf-doctable" style="margin-top:16px;">
46+
<h2>Documets by its shepherd</h2>
47+
<div id="mytabs" class="yui-navset">
48+
<ul class="yui-nav">
49+
<li class="selected"><a href="#noshepherd"><em>Without shepherd</em></a></li>
50+
<li><a href="#mydocs"><em>I Shepherd</em></a></li>
51+
<li><a href="#othershepherds"><em>Other shepherds</em></a></li>
52+
</ul>
53+
54+
<div class="yui-content">
55+
<div id="noshepherd">
56+
<table class="ietf-table ietf-doctable" style="margin-top:16px; width: 100%;">
4057
<tr>
41-
<th class="title">Documents I shepherd</th>
58+
<th class="title">Document</th>
4259
<th class="date">Date</th>
4360
<th class="status">Status</th>
4461
<th class="ad">Area Director</th>
4562
</tr>
4663

47-
{% for doc in my_documents %}
64+
{% for doc in no_shepherd %}
4865
<tr class="{% cycle oddrow,evenrow %}">
4966
<td class="title">
5067
<a href="{% url doc_managing_shepherd wg.group_acronym.acronym doc %}">{{ doc.title }}</a>
@@ -61,16 +78,18 @@
6178
{% endfor %}
6279

6380
</table>
81+
</div>
6482

65-
<table class="ietf-table ietf-doctable" style="margin-top:16px;">
83+
<div id="mydocs">
84+
<table class="ietf-table ietf-doctable" style="margin-top:16px; width: 100%;">
6685
<tr>
67-
<th class="title">Documents whithout shepherd</th>
86+
<th class="title">Document</th>
6887
<th class="date">Date</th>
6988
<th class="status">Status</th>
7089
<th class="ad">Area Director</th>
7190
</tr>
7291

73-
{% for doc in no_shepherd %}
92+
{% for doc in my_documents %}
7493
<tr class="{% cycle oddrow,evenrow %}">
7594
<td class="title">
7695
<a href="{% url doc_managing_shepherd wg.group_acronym.acronym doc %}">{{ doc.title }}</a>
@@ -87,36 +106,52 @@
87106
{% endfor %}
88107

89108
</table>
109+
</div>
90110

91-
<table class="ietf-table ietf-doctable" style="margin-top:16px;">
111+
<div id="othershepherds">
112+
{% regroup other_shepherds by shepherd as regrouped %}
113+
{% for documents in regrouped %}
114+
<h3 style="margin-bottom: 0px;">{{ documents.grouper }}</h3>
115+
<table class="ietf-table ietf-doctable" style="width: 100%;">
92116
<tr>
93-
<th class="title">Documents by other shepherds</th>
117+
<th class="title">Document</th>
94118
<th class="date">Date</th>
95119
<th class="status">Status</th>
96120
<th class="ad">Area Director</th>
97121
</tr>
98-
99-
{% regroup other_shepherds by shepherd as regrouped %}
100-
{% for documents in regrouped %}
101-
102-
<tr class="header"><td colspan="4">{{ documents.grouper }}</td></tr>
122+
{% for doc in documents.list %}
123+
<tr class="{% cycle oddrow,evenrow %}">
124+
<td class="title">
125+
<a href="{% url doc_managing_shepherd wg.group_acronym.acronym doc %}">{{ doc.title }}</a>
126+
</td>
127+
<td class="date">
128+
{{ doc.status.start_date|date:"Y-m" }}
129+
</td>
130+
<td class="status">
131+
{{ doc.status.status }}
132+
</td>
133+
<td class="ad">{{ doc.ad_name|default:"" }}</td>
134+
</tr>
135+
{% endfor %}
136+
</table>
137+
{% endfor %}
138+
</div>
103139

104-
{% for doc in documents.list %}
105-
<tr class="{% cycle oddrow,evenrow %}">
106-
<td class="title">
107-
<a href="{% url doc_managing_shepherd wg.group_acronym.acronym doc %}">{{ doc.title }}</a>
108-
</td>
109-
<td class="date">
110-
{{ doc.status.start_date|date:"Y-m" }}
111-
</td>
112-
<td class="status">
113-
{{ doc.status.status }}
114-
</td>
115-
<td class="ad">{{ doc.ad_name|default:"" }}</td>
116-
117-
</tr>
118-
{% endfor %}
119-
{% endfor %}
120-
</table>
140+
<script type="text/javascript">
141+
//<![CDATA[
142+
var tabView = new YAHOO.widget.TabView('mytabs');
143+
var url = location.href.split('#');
144+
if (url[1]) {
145+
url[1] = "#"+url[1];
146+
var tabs = tabView.get('tabs');
147+
for (var i = 0; i < tabs.length; i++) {
148+
if (url[1].indexOf(tabs[i].get('href')) == 0) {
149+
tabView.set('activeIndex', i);
150+
break;
151+
}
152+
}
153+
}
154+
//]]>
155+
</script>
121156
{% endblock wg_content %}
122157

ietf/templates/wgchairs/wgchairs_admin_options.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@
1313
<a href="{% url manage_delegates wg.group_acronym.acronym %}">Manage delegates</a>
1414
{% endifequal %} |
1515
{% endif %}
16+
17+
{% if can_manage_shepherds %}
18+
{% ifequal selected "manage_shepherds" %}
19+
<span class="selected">Manage shepherds</span>
20+
{% else %}
21+
<a href="{% url manage_shepherds wg.group_acronym.acronym %}">Manage shepherds</a>
22+
{% endifequal %} |
23+
{% endif %}

0 commit comments

Comments
 (0)