Browse Source

Colocar object-tools como barra de ações

pull/159/head
Sesostris Vieira 3 years ago
parent
commit
95f2b93667
  1. 17
      sigi/static/css/change_form.css
  2. 19
      sigi/templates/admin/change_form.html
  3. 18
      sigi/templates/admin/change_form_object_tools.html

17
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);
}

19
sigi/templates/admin/change_form.html

@ -1,3 +1,20 @@
{% extends 'admin/change_form.html' %}
{% load i18n static admin_modify %}
{% block breadcrumbs %}{% endblock %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static 'css/change_form.css' %}">
{% endblock %}
{% block breadcrumbs %}
{% if not is_popup %}
<div class="sigi-object-tools">
<ul>
{% block object-tools-items %}
{% change_form_object_tools %}
{% endblock %}
</ul>
</div>
{% endif %}
{% endblock %}
{% block object-tools %}{% endblock %}

18
sigi/templates/admin/change_form_object_tools.html

@ -0,0 +1,18 @@
{% load i18n admin_urls %}
{% block object-tools-items %}
<li>
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">
<i class="left material-icons" aria-hidden="true">history</i>
{% trans "History" %}
</a>
</li>
{% if has_absolute_url %}
<li>
<a href="{{ absolute_url }}" class="viewsitelink">
<i class="left material-icons" aria-hidden="true">web</i>
{% trans "View on site" %}
</a>
</li>
{% endif %}
{% endblock %}
Loading…
Cancel
Save