kopia lustrzana https://github.com/wagtail/wagtail
Fix: Hide empty 'view live' links
rodzic
3f86de27e0
commit
36e777418f
|
@ -35,6 +35,7 @@ Changelog
|
|||
* Fix: Remove excess margin when editing snippets (Quadric)
|
||||
* Fix: Added `scope` attribute to table headers in TableBlock output (Quadric)
|
||||
* Fix: Prevent KeyError when accessing a StreamField on a deferred queryset (Paulo Alvarado)
|
||||
* Fix: Hide empty 'view live' links (Karran Besen)
|
||||
|
||||
|
||||
2.8 (03.02.2020)
|
||||
|
|
|
@ -441,6 +441,7 @@ Contributors
|
|||
* pimarc
|
||||
* minusf
|
||||
* Paulo Alvarado
|
||||
* Karran Besen
|
||||
|
||||
Translators
|
||||
===========
|
||||
|
|
|
@ -53,6 +53,7 @@ Bug fixes
|
|||
* Remove excess margin when editing snippets (Quadric)
|
||||
* Added ``scope`` attribute to table headers in TableBlock output (Quadric)
|
||||
* Prevent KeyError when accessing a StreamField on a deferred queryset (Paulo Alvarado)
|
||||
* Hide empty 'view live' links (Karran Besen)
|
||||
|
||||
|
||||
Upgrade considerations
|
||||
|
@ -67,4 +68,4 @@ Django 2.1 is no longer supported as of this release; please upgrade to Django 2
|
|||
``SiteMiddleware`` and ``request.site`` deprecated
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Wagtail's :class:`~wagtail.core.middleware.SiteMiddleware`, which makes the current site object available as the property ``request.site``, is now deprecated as it clashes with Django's sites framework and makes unnecessary database queries on non-Wagtail views. References to ``request.site`` in your code should be removed; the recommended way of retrieving the current site is ``Site.find_for_request(request)`` in Python code, and the ``{% wagtail_site %}`` tag within Django templates. Once these are removed, ``'wagtail.core.middleware.SiteMiddleware'`` can be removed from your project's ``MIDDLEWARE`` setting.
|
||||
Wagtail's :class:`~wagtail.core.middleware.SiteMiddleware`, which makes the current site object available as the property ``request.site``, is now deprecated as it clashes with Django's sites framework and makes unnecessary database queries on non-Wagtail views. References to ``request.site`` in your code should be removed; the recommended way of retrieving the current site is ``Site.find_for_request(request)`` in Python code, and the ``{% wagtail_site %}`` tag within Django templates. Once these are removed, ``'wagtail.core.middleware.SiteMiddleware'`` can be removed from your project's ``MIDDLEWARE`` setting.
|
||||
|
|
|
@ -32,7 +32,11 @@
|
|||
<li><a href="{% url 'wagtailadmin_pages:view_draft' page.id %}" class="button button-small button-secondary" target="_blank" rel="noopener noreferrer">{% trans 'Draft' %}</a></li>
|
||||
{% endif %}
|
||||
{% if page.live %}
|
||||
<li><a href="{{ page.url }}" class="button button-small button-secondary" target="_blank" rel="noopener noreferrer">{% trans 'Live' %}</a></li>
|
||||
{% with page_url=page.url %}
|
||||
{% if page_url is not None %}
|
||||
<li><a href="{{ page_url }}" class="button button-small button-secondary" target="_blank" rel="noopener noreferrer">{% trans 'Live' %}</a></li>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
|
|
|
@ -30,7 +30,11 @@
|
|||
<li><a href="{% url 'wagtailadmin_pages:view_draft' page.id %}" class="button button-small button-secondary" target="_blank" rel="noopener noreferrer">{% trans 'Draft' %}</a></li>
|
||||
{% endif %}
|
||||
{% if page.live %}
|
||||
<li><a href="{{ page.url }}" class="button button-small button-secondary" target="_blank" rel="noopener noreferrer">{% trans 'Live' %}</a></li>
|
||||
{% with page_url=page.url %}
|
||||
{% if page_url is not None %}
|
||||
<li><a href="{{ page_url }}" class="button button-small button-secondary" target="_blank" rel="noopener noreferrer">{% trans 'Live' %}</a></li>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
{% load i18n %}
|
||||
{% if page.live %}
|
||||
<a href="{{ page.url }}" target="_blank" rel="noopener noreferrer" class="status-tag primary" title="{% trans 'Visit the live page' %}">
|
||||
<span class="visuallyhidden">{% trans "Current page status:" %}</span> {{ page.status_string }}
|
||||
</a>
|
||||
{% with page_url=page.url %}
|
||||
{% if page_url is not None %}
|
||||
<a href="{{ page_url }}" target="_blank" rel="noopener noreferrer" class="status-tag primary" title="{% trans 'Visit the live page' %}">
|
||||
<span class="visuallyhidden">{% trans "Current page status:" %}</span> {{ page.status_string }}
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="status-tag primary">
|
||||
<span class="visuallyhidden">{% trans "Current page status:" %}</span> {{ page.status_string }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<span class="status-tag">
|
||||
<span class="visuallyhidden">{% trans "Current page status:" %}</span> {{ page.status_string }}
|
||||
|
|
Ładowanie…
Reference in New Issue