From 95f2b936672df48941e7c09ad855cc6dd07ea2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Fri, 6 May 2022 09:56:30 -0300 Subject: [PATCH] =?UTF-8?q?Colocar=20object-tools=20como=20barra=20de=20a?= =?UTF-8?q?=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/static/css/change_form.css | 17 +++++++++++++++++ sigi/templates/admin/change_form.html | 19 ++++++++++++++++++- .../admin/change_form_object_tools.html | 18 ++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 sigi/static/css/change_form.css create mode 100644 sigi/templates/admin/change_form_object_tools.html diff --git a/sigi/static/css/change_form.css b/sigi/static/css/change_form.css new file mode 100644 index 0000000..1bb3777 --- /dev/null +++ b/sigi/static/css/change_form.css @@ -0,0 +1,17 @@ +.sigi-object-tools { + background-color: var(--object-tools-bg); +} + +.sigi-object-tools>ul { + display: flex; + padding: 5px 15px; +} + +.sigi-object-tools>ul>li { + padding-right: 20px; +} + +.sigi-object-tools>ul>li>a { + color: var(--object-tools-fg); + border-color: var(--object-tools-fg); +} \ No newline at end of file diff --git a/sigi/templates/admin/change_form.html b/sigi/templates/admin/change_form.html index 6608d52..72f6dd4 100644 --- a/sigi/templates/admin/change_form.html +++ b/sigi/templates/admin/change_form.html @@ -1,3 +1,20 @@ {% extends 'admin/change_form.html' %} +{% load i18n static admin_modify %} -{% block breadcrumbs %}{% endblock %} \ No newline at end of file +{% block extrastyle %} + {{ block.super }} + +{% endblock %} +{% block breadcrumbs %} + {% if not is_popup %} +
+ +
+ {% endif %} +{% endblock %} + +{% block object-tools %}{% endblock %} \ No newline at end of file diff --git a/sigi/templates/admin/change_form_object_tools.html b/sigi/templates/admin/change_form_object_tools.html new file mode 100644 index 0000000..a5d1f1d --- /dev/null +++ b/sigi/templates/admin/change_form_object_tools.html @@ -0,0 +1,18 @@ +{% load i18n admin_urls %} +{% block object-tools-items %} +
  • + {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} + + + {% trans "History" %} + +
  • + {% if has_absolute_url %} +
  • + + + {% trans "View on site" %} + +
  • + {% endif %} +{% endblock %} \ No newline at end of file