kopia lustrzana https://github.com/wagtail/wagtail
Extract history icon link for slim header's actions into a template include
rodzic
bc2004cf7b
commit
569552570f
|
@ -18,15 +18,8 @@
|
|||
{% include "wagtailadmin/shared/side_panel_toggles.html" %}
|
||||
{# Page history #}
|
||||
{% if parent_page.get_latest_revision %}
|
||||
<a href="{% url 'wagtailadmin_pages:history' parent_page.id %}"
|
||||
class="{{ nav_icon_button_classes }}"
|
||||
aria-label="{% trans 'History' %}"
|
||||
data-controller="w-tooltip"
|
||||
data-w-tooltip-content-value="{% trans 'History' %}"
|
||||
data-w-tooltip-offset-value="[0, 0]"
|
||||
>
|
||||
{% icon name="history" classname=nav_icon_classes %}
|
||||
</a>
|
||||
{% url 'wagtailadmin_pages:history' parent_page.id as history_url %}
|
||||
{% include "wagtailadmin/shared/headers/_history_icon_link.html" with history_url=history_url nav_icon_button_classes=nav_icon_button_classes nav_icon_classes=nav_icon_classes only %}
|
||||
{% endif %}
|
||||
|
||||
{% include "wagtailadmin/shared/page_status_tag_new.html" with page=parent_page %}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{% load wagtailadmin_tags i18n %}
|
||||
|
||||
<a href="{{ history_url }}"
|
||||
class="{{ nav_icon_button_classes }}"
|
||||
aria-label="{% trans 'History' %}"
|
||||
data-controller="w-tooltip"
|
||||
data-w-tooltip-content-value="{% trans 'History' %}"
|
||||
data-w-tooltip-offset-value="[0, 0]"
|
||||
>
|
||||
{% icon name="history" classname=nav_icon_classes %}
|
||||
</a>
|
|
@ -19,15 +19,8 @@
|
|||
|
||||
{# Page history #}
|
||||
{% if page.get_latest_revision %}
|
||||
<a href="{% url 'wagtailadmin_pages:history' page.id %}"
|
||||
class="{{ nav_icon_button_classes }}"
|
||||
aria-label="{% trans 'History' %}"
|
||||
data-controller="w-tooltip"
|
||||
data-w-tooltip-content-value="{% trans 'History' %}"
|
||||
data-w-tooltip-offset-value="[0, 0]"
|
||||
>
|
||||
{% icon name="history" classname=nav_icon_classes %}
|
||||
</a>
|
||||
{% url 'wagtailadmin_pages:history' page.id as history_url %}
|
||||
{% include "wagtailadmin/shared/headers/_history_icon_link.html" with history_url=history_url nav_icon_button_classes=nav_icon_button_classes nav_icon_classes=nav_icon_classes only %}
|
||||
{% endif %}
|
||||
|
||||
{% include "wagtailadmin/shared/page_status_tag_new.html" with page=page_for_status %}
|
||||
|
|
|
@ -5,13 +5,5 @@
|
|||
{{ block.super }}
|
||||
|
||||
{# Object history #}
|
||||
<a href="{{ view.get_history_url }}"
|
||||
class="{{ nav_icon_button_classes }}"
|
||||
aria-label="{% trans 'History' %}"
|
||||
data-controller="w-tooltip"
|
||||
data-w-tooltip-content-value="{% trans 'History' %}"
|
||||
data-w-tooltip-offset-value="[0, 0]"
|
||||
>
|
||||
{% icon name="history" classname=nav_icon_classes %}
|
||||
</a>
|
||||
{% include "wagtailadmin/shared/headers/_history_icon_link.html" with history_url=history_url nav_icon_button_classes=nav_icon_button_classes nav_icon_classes=nav_icon_classes only %}
|
||||
{% endblock %}
|
||||
|
|
Ładowanie…
Reference in New Issue