From 69ff7a23914970c2652422dd5b30d265985f1b2d Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 16 Feb 2019 20:55:16 +0100 Subject: [PATCH] Overwrite admin templates (1) --- templates/admin/app_index.html | 38 +++++++++ templates/admin/base_site.html | 7 ++ .../admin/delete_selected_confirmation.html | 80 +++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 templates/admin/app_index.html create mode 100644 templates/admin/base_site.html create mode 100644 templates/admin/delete_selected_confirmation.html diff --git a/templates/admin/app_index.html b/templates/admin/app_index.html new file mode 100644 index 00000000..99b16eb7 --- /dev/null +++ b/templates/admin/app_index.html @@ -0,0 +1,38 @@ +{% extends "admin/base_site.html" %} + +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} + {% if app_list %} +
+
+

{% trans "Models" %}

+
+
+
    + {% for app in app_list %} + {% for model in app.models %} +
  • + {{ model.name }} +
  • + {% endfor %} + {% endfor %} +
+
+
+ {% else %} +

{% trans "You don't have permission to edit anything." %}

+ {% endif %} +{% endblock %} diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html new file mode 100644 index 00000000..47043929 --- /dev/null +++ b/templates/admin/base_site.html @@ -0,0 +1,7 @@ +{% extends "users/sidebar.html" %} + +{% load static %} + +{% block title %}{{ title }}{% endblock %} + +{% block nav-global %}{% endblock %} diff --git a/templates/admin/delete_selected_confirmation.html b/templates/admin/delete_selected_confirmation.html new file mode 100644 index 00000000..7f5f62ff --- /dev/null +++ b/templates/admin/delete_selected_confirmation.html @@ -0,0 +1,80 @@ +{% extends "admin/base_site.html" %} + +{% load i18n l10n admin_urls static %} + +{% block extrahead %} + {{ block.super }} + {{ media }} + {# Make previous link works #} + +{% endblock %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} + {% if perms_lacking or protected %} + {% if perms_lacking %} +
+
+ {% blocktrans %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %} +
+
+
    + {% for obj in perms_lacking %} +
  • {{ obj }}
  • + {% endfor %} +
+
+
+ {% endif %} + {% if protected %} +
+
+ {% blocktrans %}Deleting the selected {{ objects_name }} would require deleting the following protected related objects:{% endblocktrans %} +
+
+
    + {% for obj in protected %} +
  • {{ obj }}
  • + {% endfor %} +
+
+
+ {% endif %} + {% else %} +
+
+ {% blocktrans %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktrans %} +
+
+ {% for deletable_object in deletable_objects %} +
    {{ deletable_object|unordered_list }}
+ {% endfor %} +
+
{% csrf_token %} +
+ {% for obj in queryset %} + + {% endfor %} + + + +
+
+
+
+ {% endif %} +{% endblock %}