0001-backoffice-use-discard-when-talking-about-removing-a.patch
tests/backoffice_pages/test_submission.py | ||
---|---|---|
356 | 356 |
resp = resp.follow().follow() |
357 | 357 |
resp.form['f1'] = 'test submission' |
358 | 358 |
resp = resp.form.submit('submit') # -> to validation |
359 |
resp = resp.click('Delete this form')
|
|
360 |
resp = resp.form.submit('delete')
|
|
359 |
resp = resp.click('Discard this form')
|
|
360 |
resp = resp.form.submit('discard')
|
|
361 | 361 |
assert resp.location == 'https://example.org' |
362 | 362 | |
363 | 363 | |
... | ... | |
698 | 698 |
resp = resp.follow() |
699 | 699 | |
700 | 700 |
# and try to delete the form (but cancel) |
701 |
resp = resp.click('Delete this form')
|
|
701 |
resp = resp.click('Discard this form')
|
|
702 | 702 |
resp = resp.form.submit('cancel') |
703 | 703 |
assert resp.location == 'http://example.net/backoffice/submission/' |
704 | 704 |
assert data_class.count() == 1 |
... | ... | |
708 | 708 |
resp = app.get('/backoffice/submission/') |
709 | 709 |
resp = resp.click('#%s' % formdata_no) |
710 | 710 |
resp = resp.follow() |
711 |
resp = resp.click('Delete this form')
|
|
712 |
resp = resp.form.submit('delete')
|
|
711 |
resp = resp.click('Discard this form')
|
|
712 |
resp = resp.form.submit('discard')
|
|
713 | 713 |
assert resp.location == 'http://example.net/backoffice/submission/' |
714 | 714 |
assert data_class.count() == 0 |
715 | 715 |
assert pub.tracking_code_class().count() == 0 |
wcs/backoffice/submission.py | ||
---|---|---|
52 | 52 |
if self.parent_directory.edit_mode: |
53 | 53 |
raise errors.AccessForbiddenError() |
54 | 54 | |
55 |
self.parent_directory.html_top(title=_('Remove'))
|
|
55 |
self.parent_directory.html_top(title=_('Discard'))
|
|
56 | 56 | |
57 | 57 |
form = Form(enctype='multipart/form-data') |
58 |
form.widgets.append(HtmlWidget('<p>%s</p>' % _('You are about to irrevocably delete this form.')))
|
|
59 |
form.add_submit('delete', _('Delete'))
|
|
58 |
form.widgets.append(HtmlWidget('<p>%s</p>' % _('You are about to discard this form.')))
|
|
59 |
form.add_submit('delete', _('Discard'))
|
|
60 | 60 |
form.add_submit('cancel', _('Cancel')) |
61 | 61 |
if form.get_widget('cancel').parse(): |
62 | 62 |
return redirect('../..') |
63 | 63 |
if not form.is_submitted() or form.has_errors(): |
64 | 64 |
r = TemplateIO(html=True) |
65 |
r += htmltext('<h2>%s</h2>') % (_('Deleting Form'))
|
|
65 |
r += htmltext('<h2>%s</h2>') % (_('Discarding Form'))
|
|
66 | 66 |
r += form.render() |
67 | 67 |
return r.getvalue() |
68 | 68 | |
... | ... | |
320 | 320 |
if draft_formdata_id: |
321 | 321 |
r += htmltext('<a rel="popup" href="remove/%s">%s</a>') % ( |
322 | 322 |
draft_formdata_id, |
323 |
_('Delete this form'),
|
|
323 |
_('Discard this form'),
|
|
324 | 324 |
) |
325 | 325 |
r += htmltext('</div>') |
326 | 326 |
r += htmltext('<div id="side">') |
327 |
- |