From 2eb79d04a4c57055ca43813908b147e3a7399618 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 27 Feb 2019 18:31:42 +0100 Subject: [PATCH] Simplify breadcrumbs --- static/css/base.css | 9 +++++++++ useradmin/templates/admin/app_index.html | 19 ------------------- useradmin/templates/admin/change_form.html | 10 +++++----- useradmin/templates/admin/change_list.html | 8 ++++---- .../templates/admin/delete_confirmation.html | 12 ++++++------ .../admin/delete_selected_confirmation.html | 10 +++++----- useradmin/templates/admin/object_history.html | 12 ++++++------ 7 files changed, 35 insertions(+), 45 deletions(-) delete mode 100644 useradmin/templates/admin/app_index.html diff --git a/static/css/base.css b/static/css/base.css index a13c596f..ac369080 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -143,3 +143,12 @@ dl.profile-info > div { padding: 8px; border-top: 1px solid #ddd; } + +/* Breadcrumbs */ +.breadcrumbs { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} diff --git a/useradmin/templates/admin/app_index.html b/useradmin/templates/admin/app_index.html deleted file mode 100644 index 4043af22..00000000 --- a/useradmin/templates/admin/app_index.html +++ /dev/null @@ -1,19 +0,0 @@ -{# Please keep this template in sync with django/contrib/admin one #} -{% extends "admin/index.html" %} -{% load i18n %} - -{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %} - -{% if not is_popup %} -{% block breadcrumbs %} - -{% endblock %} -{% endif %} - -{% block sidebar %}{% endblock %} diff --git a/useradmin/templates/admin/change_form.html b/useradmin/templates/admin/change_form.html index 0224fdbd..76d6d039 100644 --- a/useradmin/templates/admin/change_form.html +++ b/useradmin/templates/admin/change_form.html @@ -15,12 +15,12 @@ {% if not is_popup %} {% block breadcrumbs %} - +› {{ opts.app_config.verbose_name }} +› {% if has_change_permission %}{{ opts.verbose_name_plural|capfirst }}{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} +› {% if add %}{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}{% else %}{{ original|truncatewords:"18" }}{% endif %} + {% endblock %} {% endif %} diff --git a/useradmin/templates/admin/change_list.html b/useradmin/templates/admin/change_list.html index 03113c8f..d99b0565 100644 --- a/useradmin/templates/admin/change_list.html +++ b/useradmin/templates/admin/change_list.html @@ -28,11 +28,11 @@ {% if not is_popup %} {% block breadcrumbs %} - +› {{ cl.opts.app_config.verbose_name }} +› {{ cl.opts.verbose_name_plural|capfirst }} + {% endblock %} {% endif %} diff --git a/useradmin/templates/admin/delete_confirmation.html b/useradmin/templates/admin/delete_confirmation.html index badcb306..3b58e558 100644 --- a/useradmin/templates/admin/delete_confirmation.html +++ b/useradmin/templates/admin/delete_confirmation.html @@ -11,13 +11,13 @@ {% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation{% endblock %} {% block breadcrumbs %} - +› {{ opts.app_config.verbose_name }} +› {{ opts.verbose_name_plural|capfirst|escape }} +› {{ object|truncatewords:"18" }} +› {% trans 'Delete' %} + {% endblock %} {% block content %} diff --git a/useradmin/templates/admin/delete_selected_confirmation.html b/useradmin/templates/admin/delete_selected_confirmation.html index 071f8224..371be030 100644 --- a/useradmin/templates/admin/delete_selected_confirmation.html +++ b/useradmin/templates/admin/delete_selected_confirmation.html @@ -11,12 +11,12 @@ {% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation delete-selected-confirmation{% endblock %} {% block breadcrumbs %} - +› {{ opts.app_config.verbose_name }} +› {{ opts.verbose_name_plural|capfirst }} +› {% trans 'Delete multiple objects' %} + {% endblock %} {% block content %} diff --git a/useradmin/templates/admin/object_history.html b/useradmin/templates/admin/object_history.html index 63089fb7..5bf5e4db 100644 --- a/useradmin/templates/admin/object_history.html +++ b/useradmin/templates/admin/object_history.html @@ -3,13 +3,13 @@ {% load i18n admin_urls %} {% block breadcrumbs %} - +› {{ opts.app_config.verbose_name }} +› {{ module_name }} +› {{ object|truncatewords:"18" }} +› {% trans 'History' %} + {% endblock %} {% block content %}