Skip to content

Commit

Permalink
#334 Unify delete_confirmation and delete_selected_confirmation templ…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
viliambalaz committed Jun 3, 2021
1 parent f507fa9 commit 2f3f352
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions chcemvediet/apps/inforequests/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,9 @@ def render_delete_form(self, request, context):
obj = context[u'object']
context[u'delete_warnings'] = self.delete_warnings(obj)
context[u'delete_constraints'] = self.delete_constraints(obj)
context[u'can_snooze_previous_action'] = self.can_snooze_previous_action(obj)
context[u'ADMIN_EXTEND_SNOOZE_BY_DAYS'] = ADMIN_EXTEND_SNOOZE_BY_DAYS
if self.can_snooze_previous_action(obj):
context[u'snoozed_actions'] = [admin_obj_format(obj.previous_action)]
context[u'ADMIN_EXTEND_SNOOZE_BY_DAYS'] = ADMIN_EXTEND_SNOOZE_BY_DAYS
return super(ActionAdmin, self).render_delete_form(request, context)

@decorate(short_description=u'Delete selected actions')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
<ul>{{ inbound|unordered_list }}</ul>
{% endif %}
{% endafter %}
{% if can_snooze_previous_action %}
{% if snoozed_actions %}
{% prepend path=".//form" %}
<p><label><input name="snooze" type="checkbox" /> Extend snooze of previous action by {{ ADMIN_EXTEND_SNOOZE_BY_DAYS }} days from today.</label></p>
<p>
<label><input name="snooze" type="checkbox" /> Extend snooze of previous actions by
{{ ADMIN_EXTEND_SNOOZE_BY_DAYS }} days from today? All of the following actions will be
snoozed:
</label>
</p>
<ul>{{ snoozed_actions|unordered_list }}</ul>
{% endprepend %}
{% endif %}
{% before path=".//form" %}
{% before path=".//form//input[@type='submit']" %}
{% if delete_warnings %}
<ul class="messagelist">
{% for warning in delete_warnings %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<ul>{{ snoozed_actions|unordered_list }}</ul>
{% endprepend %}
{% endif %}
{% before path=".//form" %}
{% before path=".//form//input[@type='submit']" %}
{% if delete_warnings %}
<ul class="messagelist">
{% for warning in delete_warnings %}
Expand Down

0 comments on commit 2f3f352

Please sign in to comment.