Skip to content

Commit 6c35c89

Browse files
author
Michael Lee
committed
* fix Delete request
* Step number is dynamically generated * add template for delete confirmation - Legacy-Id: 623
1 parent 440c85a commit 6c35c89

4 files changed

Lines changed: 51 additions & 4 deletions

File tree

ietf/mailinglists/views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@ def get_template(self):
7474
return templates
7575
def render_template(self, *args, **kwargs):
7676
self.extra_context['clean_forms'] = self.clean_forms
77+
form0 = self.clean_forms[0]
78+
add_edit = form0.clean_data['add_edit']
7779
if self.step == 3:
78-
form0 = self.clean_forms[0]
79-
add_edit = form0.clean_data['add_edit']
8080
if add_edit == 'add' or add_edit == 'edit':
8181
# Can't get the choice mapping directly from the form
8282
self.extra_context['area'] = formchoice(self.clean_forms[1], 'area')
8383
self.extra_context['approver'] = formchoice(self.clean_forms[2], 'approver')
84+
if self.step == 2 and add_edit == 'delete':
85+
self.extra_context['list_q'] = NonWgMailingList.objects.get(pk=self.clean_forms[0].clean_data['list_id_delete'])
86+
self.extra_context['approver'] = formchoice(self.clean_forms[1], 'approver')
8487
return super(NonWgWizard, self).render_template(*args, **kwargs)
8588
def failed_hash(self, step):
8689
raise NotImplementedError("step %d hash failed" % step)

ietf/templates/mailinglists/nwg_wizard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block nwgcontent %}
44
<a href="/mailinglists/nonwg_lists/"><b>View Current list</b></a><br>
55
</p><p>
6-
<h2>Step 3</h2>
6+
<h2>Step {{ step|add:"1" }}</h2>
77
<form action="." method="POST">
88
<input type="hidden" name="{{ step_field }}" value="{{ step }}" />
99
{{ previous_fields }}

ietf/templates/mailinglists/nwg_wizard_addedit_step3.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "mailinglists/nwg_wizard_base.html" %}
22

33
{% block nwgcontent %}
4-
<h2>Step 4</h2>
4+
<h2>Step {{ step|add:"1" }}</h2>
55
<h4>Please verify the following information:</h4>
66
<form action="." method="POST">
77
<table bgcolor="#88AED2" cellspacing="1" border="0">
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{% extends "mailinglists/nwg_wizard_base.html" %}
2+
3+
{% block nwgcontent %}
4+
<h2>Step {{ step|add:"1" }}</h2>
5+
<h4>Please verify the following information:</h4>
6+
<form action="." method="POST">
7+
<table bgcolor="#88AED2" cellspacing="1" border="0">
8+
<tr valign="top"><td>
9+
<table bgcolor="#f3f8fd" cellpadding="3" cellspacing="0" border="0">
10+
<tr valign="top">
11+
<td colspan=2>
12+
<h3>Request Submit Confirmation</h3>
13+
Please review the following information that you are about to submit.<br>
14+
Once you click the 'Submit' button below, this request will be sent to
15+
the selected Area Director for approval.<br>
16+
<br>
17+
</td>
18+
</tr>
19+
<tr valign="top"><td>Request Type:</td><td>
20+
Deleting an existing entry
21+
</td></tr>
22+
<tr valign="top"><td>Submitter's Name:</td><td>{{ clean_forms.1.ds_name.data|escape }}</td></tr>
23+
<tr valign="top"><td>Submitter's Email Address:</td><td>{{ clean_forms.1.ds_email.data|escape }}</td></tr>
24+
<tr valign="top"><td>Mailing List Name:</td><td>{{ list_q.list_name|escape }}</td></tr>
25+
<tr valign="top"><td>URL or Email Address of Mailing List: </td><td><pre>{{ list_url|escape }}</pre></td></tr>
26+
<tr valign="top"><td>URL to Subscribe: </td><td><pre>{% firstof list_q.subscribe_url "Not Applicable" %}</pre></td></tr>
27+
<tr valign="top"><td>Other Info. to Subscribe: </td><td><pre>{{ list_q.subscribe_other|escape }}</pre></td></tr>
28+
<tr valign="top"><td>Administrator(s)' Email Address(es): </td><td><pre>{{ list_q.admin|escape|linebreaks }}</pre></td></tr>
29+
<tr valign="top"><td>Purpose: </td><td>{{ list_q.purpose|escape }}</td></tr>
30+
<tr valign="top"><td>Area: </td><td><pre>{{ list_q.area }}</pre></td></tr>
31+
<tr valign="top"><td>Approving Area Director: </td><td><pre>{{ approver|escape }}</pre></td></tr>
32+
<tr valign="top"><td>Message to AD: </td><td><pre>{{ clean_forms.1.msg_to_ad.data|escape }}</pre></td></tr>
33+
<tr valign="top">
34+
<td></td>
35+
<td>
36+
<input type="submit" value=" Submit ">
37+
</td>
38+
</tr>
39+
</table>
40+
</table>
41+
{{ previous_fields }}
42+
<input type="hidden" name="{{ step_field }}" value="{{ step }}" />
43+
</form>
44+
{% endblock %}

0 commit comments

Comments
 (0)