Skip to content

Commit 4034532

Browse files
committed
Merged [4212] from rcross@amsl.com:
Ticket ietf-tools#673 Add ability to clear ballot - Legacy-Id: 4222 Note: SVN reference [4212] has been migrated to Git commit cbc660e
2 parents 6d1ef8d + cbc660e commit 4034532

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

ietf/idrfc/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
url(r'^(?P<name>[A-Za-z0-9.-]+)/edit/resurrect/$', views_edit.resurrect, name='doc_resurrect'),
5454
url(r'^(?P<name>[A-Za-z0-9.-]+)/edit/addcomment/$', views_edit.add_comment, name='doc_add_comment'),
5555
url(r'^(?P<name>[A-Za-z0-9.-]+)/edit/position/$', views_ballot.edit_position, name='doc_edit_position'),
56+
url(r'^(?P<name>[A-Za-z0-9.-]+)/edit/clearballot/$', views_ballot.clear_ballot, name='doc_clear_ballot'),
5657
url(r'^(?P<name>[A-Za-z0-9.-]+)/edit/deferballot/$', views_ballot.defer_ballot, name='doc_defer_ballot'),
5758
url(r'^(?P<name>[A-Za-z0-9.-]+)/edit/undeferballot/$', views_ballot.undefer_ballot, name='doc_undefer_ballot'),
5859
url(r'^(?P<name>[A-Za-z0-9.-]+)/edit/sendballotcomment/$', views_ballot.send_ballot_comment, name='doc_send_ballot_comment'),

ietf/idrfc/views_ballot.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,23 @@ def send_ballot_commentREDESIGN(request, name):
511511
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
512512
send_ballot_comment = send_ballot_commentREDESIGN
513513

514+
@group_required('Secretariat')
515+
def clear_ballot(request, name):
516+
"""Clear all positions and discusses. This is actually accomplished by creating a new
517+
started_iesg_process DocEvent."""
518+
doc = get_object_or_404(Document, name=name)
519+
if request.method == 'POST':
520+
DocEvent.objects.create(type='started_iesg_process',
521+
doc=doc,
522+
by=request.user.get_profile(),
523+
desc='cleared_ballot')
524+
525+
return HttpResponseRedirect(urlreverse("doc_view", kwargs=dict(name=doc.name)))
526+
527+
return render_to_response('idrfc/clear_ballot.html',
528+
dict(doc=doc,
529+
back_url=doc.get_absolute_url()),
530+
context_instance=RequestContext(request))
514531

515532
@group_required('Area_Director','Secretariat')
516533
def defer_ballot(request, name):
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% extends "base.html" %}
2+
3+
{% block title %}Clear ballot for {{ doc }}{% endblock %}
4+
5+
{% block content %}
6+
<h1>Clear ballot for {{ doc }}</h1>
7+
8+
<form action="" method="POST">
9+
<p>Clear the ballot for {{ doc.file_tag }}?</p>
10+
11+
<p>This will clear all ballot positions and discuss entries.</p>
12+
13+
<div class="actions">
14+
<a href="{{ back_url }}">Back</a>
15+
<input type="submit" value="Clear ballot"/>
16+
</div>
17+
</form>
18+
{% endblock %}

ietf/templates/idrfc/doc_ballot.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848

4949
{% endif %}
5050

51+
{% if doc_ballot_edit_button and user|in_group:"Secretariat" %}
52+
<div style="margin-top:8px; margin-bottom:8px;"><span id="doc_clear_ballot_button" class="yui-button yui-link-button"><span class="first-child"><a href="{% url doc_clear_ballot name=doc.draft_name %}">Clear ballot</a></span></span></div>
53+
{% endif %}
54+
5155
<p style="margin-top:1em;"><span class="square" style="background:#c00000;"></span><b>Discuss</b><br/>
5256
{% with ballot.get_discuss as positions %}{% include "idrfc/doc_ballot_list.html" %}{% endwith %}</p>
5357

0 commit comments

Comments
 (0)