Change ul and li to p for django admin object-tools links

This commit is contained in:
Rachid Mrad 2023-08-30 18:41:43 -04:00
parent b8b947a583
commit 4df52e5a45
No known key found for this signature in database
GPG key ID: EF38E4CEC4A8F3CF
4 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,11 @@
{% extends "admin/change_form.html" %}
{% block object-tools %}
{% if change and not is_popup %}
<p class="object-tools">
{% block object-tools-items %}
{{ block.super }}
{% endblock %}
</p>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,7 @@
{% load i18n admin_urls %}
{% block object-tools-items %}
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
<a href="{% add_preserved_filters history_url %}" class="historylink">{% translate "History" %}</a>
{% if has_absolute_url %}<a href="{{ absolute_url }}" class="viewsitelink">{% translate "View on site" %}</a>{% endif %}
{% endblock %}

View file

@ -24,3 +24,11 @@
{% endif %}
</h2>
{% endblock %}
{% block object-tools %}
<p class="object-tools">
{% block object-tools-items %}
{{ block.super }}
{% endblock %}
</p>
{% endblock %}

View file

@ -0,0 +1,10 @@
{% load i18n admin_urls %}
{% block object-tools-items %}
{% if has_add_permission %}
{% url cl.opts|admin_urlname:'add' as add_url %}
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink">
{% blocktranslate with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktranslate %}
</a>
{% endif %}
{% endblock %}