From 9879f940a3fae6623571366fe574b40bab21cd9e Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 17 Feb 2019 18:43:40 +0100 Subject: [PATCH] Overwrite admin templates (2) --- templates/admin/delete_confirmation.html | 53 ++++++++++++++++++++ templates/admin/object_history.html | 43 ++++++++++++++++ templates/admin/submit_line.html | 63 ++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 templates/admin/delete_confirmation.html create mode 100644 templates/admin/object_history.html create mode 100644 templates/admin/submit_line.html diff --git a/templates/admin/delete_confirmation.html b/templates/admin/delete_confirmation.html new file mode 100644 index 00000000..bce15746 --- /dev/null +++ b/templates/admin/delete_confirmation.html @@ -0,0 +1,53 @@ +{# Please keep this template in sync with django/contrib/admin one #} +{% extends "admin/base_site.html" %} +{% load i18n admin_urls static %} + +{% block extrahead %} + {{ block.super }} + {{ media }} + +{% endblock %} + +{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation{% endblock %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} +{% if perms_lacking %} +

{% blocktrans with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}

+ +{% elif protected %} +

{% blocktrans with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktrans %}

+ +{% else %} +

{% blocktrans with escaped_object=object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}

+ {% include "admin/includes/object_delete_summary.html" %} +

{% trans "Objects" %}

+ +
{% csrf_token %} +
+ + {% if is_popup %}{% endif %} + {% if to_field %}{% endif %} + + {% trans "No, take me back" %} +
+
+{% endif %} +{% endblock %} diff --git a/templates/admin/object_history.html b/templates/admin/object_history.html new file mode 100644 index 00000000..3ff0d2b0 --- /dev/null +++ b/templates/admin/object_history.html @@ -0,0 +1,43 @@ +{# Please keep this template in sync with django/contrib/admin one #} +{% extends "admin/base_site.html" %} +{% load i18n admin_urls %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} +
+
+ +{% if action_list %} + + + + + + + + + + {% for action in action_list %} + + + + + + {% endfor %} + +
{% trans 'Date/time' %}{% trans 'User' %}{% trans 'Action' %}
{{ action.action_time|date:"DATETIME_FORMAT" }}{{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}{{ action.get_change_message }}
+{% else %} +

{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}

+{% endif %} +
+
+{% endblock %} diff --git a/templates/admin/submit_line.html b/templates/admin/submit_line.html new file mode 100644 index 00000000..cdae3ae5 --- /dev/null +++ b/templates/admin/submit_line.html @@ -0,0 +1,63 @@ +{% comment %} +Re2o est un logiciel d'administration développé initiallement au rezometz. Il +se veut agnostique au réseau considéré, de manière à être installable en +quelques clics. + +Copyright © 2019 Alexandre Iooss + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +{% endcomment %} + +{% load i18n admin_urls %} +
+ {% if show_save %} + + {% endif %} + + {% if show_delete_link %} + {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %} + + + {% trans "Delete" %} + + {% endif %} + + {% if show_save_as_new %} + + {% endif %} + + {% if show_save_and_add_another %} + + {% endif %} + + {% if show_save_and_continue %} + + {% endif %} +