kopia lustrzana https://github.com/wagtail/wagtail
Move all interim support of non-breadcrumbs listing views to the index.html template
We want to remove all breadcrumbs_items check in the templates
eventually (as we want all listing views to use breadcrumbs). Instead of
having both BaseListingView's listing.html and IndexView's index.html
templates support the non-breadcrumbs case, do this only for the
index.html template.
The reasoning is because the BaseListingView was extracted more recently
as part of the Universal Listings work. When the filtering support was
moved from the IndexView to BaseListingView in 130c7ff
, we still had to
support the non-breadcrumbs case due to the report views still using the
old filters implementation.
Now that we have migrated the report views to use the new AJAX-based
filtering, it's much less likely there's a BaseListingView subclass out
there that uses the non-breadcrumbs version. For such views, it's likely
they would work with IndexView too (as we haven't really documented
BaseListingView since its creation). So, put the interim support in the
IndexView template for now.
We could also completely drop the non-breadcrumbs case for both views,
but this would mean any custom listing view that uses filters now _must_
implement a results-only view _and_ enable breadcrumbs, or include the
filtering template themselves...
pull/12236/head
rodzic
3e758e65fd
commit
9e36fa74b6
|
@ -13,3 +13,20 @@
|
|||
{% include "wagtailadmin/shared/header.html" with title=page_title subtitle=page_subtitle action_url=header_action_url action_text=header_action_label action_icon=header_action_icon extra_actions=extra_actions icon=header_icon search_url=search_url search_form=search_form search_results_url=index_results_url only %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block listing %}
|
||||
{% comment %}
|
||||
DEPRECATED: This block override is for supporting views that have filters
|
||||
but not using breadcrumbs (thus have no slim_header to put the filters in).
|
||||
There is no longer such a view in Wagtail core, but we keep this block
|
||||
until we can enforce the use of breadcrumbs in all listing views.
|
||||
{% endcomment %}
|
||||
{% if filters and not breadcrumbs_items %}
|
||||
<div class="filterable">
|
||||
{{ block.super }}
|
||||
{% include "wagtailadmin/shared/filters.html" %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ block.super }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,29 +1,23 @@
|
|||
{% extends "wagtailadmin/generic/base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block main_header %}
|
||||
{% if not breadcrumbs_items %}
|
||||
{% include "wagtailadmin/shared/header.html" with title=page_title subtitle=page_subtitle action_url=header_action_url action_text=header_action_label icon=header_icon only %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% comment %}
|
||||
Override the content block instead of main_content so we get the full-width layout without the nice-padding.
|
||||
However, this means we need to include the header block again (and only do {{ block.super }} inside it).
|
||||
{% endcomment %}
|
||||
|
||||
{% block header %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block listing %}
|
||||
<div class="{% if filters and not breadcrumbs_items %}filterable{% endif %}">
|
||||
<div id="listing-results">
|
||||
{% comment %}
|
||||
This div will be replaced on AJAX refreshes.
|
||||
Do not add page furniture here unless you intend it to disappear on AJAX refresh
|
||||
{% endcomment %}
|
||||
{% include view.results_template_name|default:"wagtailadmin/generic/listing_results.html" %}
|
||||
</div>
|
||||
{% if filters and not breadcrumbs_items %}
|
||||
{% include "wagtailadmin/shared/filters.html" %}
|
||||
{% endif %}
|
||||
<div id="listing-results">
|
||||
{% comment %}
|
||||
This div will be replaced on AJAX refreshes.
|
||||
Do not add page furniture here unless you intend it to disappear on AJAX refresh
|
||||
{% endcomment %}
|
||||
{% include view.results_template_name|default:"wagtailadmin/generic/listing_results.html" %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue