Files
django-admin-confirm-briq/admin_confirm/templates/admin/change_confirmation.html
T
Thu Trang Pham 1b617170bf Feat/confirm actions (#2)
* Working wrapper for actions

* checking permissions for action

* Refactor/clean change_confirmation template a bit

* Update README

* Update README

* Adding unit tests for confirm_action decorator

* Updated tests/readme

* Update after testing upload to test pypi

* Clean up and format code

Co-authored-by: Thu Trang Pham <thu@joinmodernhealth.com>
2020-11-29 13:31:27 -08:00

59 lines
2.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "admin/base_site.html" %}
{% load i18n admin_urls static %}
{% block extrahead %}
{{ block.super }}
{{ media }}
<script src="{% static 'admin/js/cancel.js' %}" async></script>
{% endblock %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">
<link rel="stylesheet" type="text/css" href="{% static "admin/css/confirmation.css" %}">
{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-confirmation{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
{% if not add %}
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object_id|admin_urlquote %}">{{ object_name|truncatewords:"18" }}</a>
&rsaquo; {% trans 'Confirm change' %}
{% else %}
&rsaquo; {% trans 'Confirm add' %}
{% endif %}
</div>
{% endblock %}
{% block content %}
{% if add %}
<p>{% blocktrans with escaped_object=object %}Are you sure you want to add the {{ model_name }}?{% endblocktrans %}</p>
{% include "admin/change_data.html" %}
<form method="post" action="{% url opts|admin_urlname:'add'%}">{% csrf_token %}
{% else %}
<p>{% blocktrans with escaped_object=object %}Are you sure you want to change the {{ model_name }} "{{ object_name }}"?{% endblocktrans %}</p>
{% include "admin/change_data.html" %}
<form method="post" action="{% url opts|admin_urlname:'change' object_id|admin_urlquote %}">{% csrf_token %}
{% endif %}
{% for key, value in form_data.items %}
<input type="hidden" name="{{ key }}" value="{{ value }}">
{% endfor %}
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %}
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %}
<div class="submit-row">
<input type="submit" value="{% trans 'Yes, Im sure' %}" name="{{ submit_name }}">
<p class="deletelink-box">
<a href="#" class="button cancel-link">{% trans "No, continue to edit" %}</a>
</p>
</div>
</form>
{% endblock %}