forked from mmmaly/chcemvediet
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #334 Refactor Action admin deleting * #334 Move delete_dependency to admin and review suggestions * #334 Use set_attributes tag to disable submit button * #334 Review Co-authored-by: Martin Macko <[email protected]>
- Loading branch information
1 parent
325ffcf
commit fb9a890
Showing
3 changed files
with
62 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 28 additions & 1 deletion
29
chcemvediet/apps/inforequests/templates/admin/inforequests/action/delete_confirmation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
{% extends "admin/delete_confirmation.html" %} | ||
{% load amend prepend from poleno.amend %} | ||
{% load amend prepend before after set_attributes from poleno.amend %} | ||
|
||
{% block content %} | ||
{% amend %} | ||
{{ block.super }} | ||
{% after path="./ul[last()]" %} | ||
{% if outbound %} | ||
<p>Outbound messages will be deleted:</p> | ||
<ul>{{ outbound|unordered_list }}</ul> | ||
{% endif %} | ||
{% if inbound %} | ||
<p>Inbound messages will be marked undecided:</p> | ||
<ul>{{ inbound|unordered_list }}</ul> | ||
{% endif %} | ||
{% endafter %} | ||
{% if not object.is_last_action %} | ||
{% before path=".//form" %} | ||
<p> | ||
<b>Warning:</b> The deleted action is not the last action in the branch. Deleting it may | ||
cause logical errors in the inforequest history. | ||
</p> | ||
{% endbefore %} | ||
{% endif %} | ||
{% if object.type == object.TYPES.EXPIRATION or object.type == object.TYPES.APPEAL_EXPIRATION %} | ||
{% 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> | ||
{% endprepend %} | ||
{% endif %} | ||
{% if delete_constraints %} | ||
{% before path=".//form" %} | ||
<div class="errornote"> | ||
<p>Delete not allowed.</p> | ||
<ul>{{ delete_constraints|unordered_list }}</ul> | ||
</div> | ||
{% endbefore %} | ||
{% set_attributes path=".//form//input[@type='submit']" disabled=True %} | ||
{% endif %} | ||
{% endamend %} | ||
{% endblock %} |
18 changes: 18 additions & 0 deletions
18
chcemvediet/apps/inforequests/templates/admin/inforequests/branch/delete_confirmation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends "admin/delete_confirmation.html" %} | ||
{% load amend after from poleno.amend %} | ||
|
||
{% block content %} | ||
{% amend %} | ||
{{ block.super }} | ||
{% after path="./ul[last()]" %} | ||
{% if outbound %} | ||
<p>Outbound messages will be deleted:</p> | ||
<ul>{{ outbound|unordered_list }}</ul> | ||
{% endif %} | ||
{% if inbound %} | ||
<p>Inbound messages will be marked undecided:</p> | ||
<ul>{{ inbound|unordered_list }}</ul> | ||
{% endif %} | ||
{% endafter %} | ||
{% endamend %} | ||
{% endblock %} |