From e9e0e963576ccf616409b94935e59f48f58c1e72 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Thu, 14 Jul 2022 17:01:09 +0200 Subject: [PATCH] Added inhaltsbloecke to chapter navigation --- .../wagtailadmin/pages/listing/_list.html | 142 ++++++++++++++++++ .../pages/listing/_page_title_explore.html | 32 ++++ 2 files changed, 174 insertions(+) create mode 100644 server/core/templates/wagtailadmin/pages/listing/_list.html create mode 100644 server/core/templates/wagtailadmin/pages/listing/_page_title_explore.html diff --git a/server/core/templates/wagtailadmin/pages/listing/_list.html b/server/core/templates/wagtailadmin/pages/listing/_list.html new file mode 100644 index 00000000..40d8e3bc --- /dev/null +++ b/server/core/templates/wagtailadmin/pages/listing/_list.html @@ -0,0 +1,142 @@ +{% load i18n %} +{% load l10n %} +{% load wagtailadmin_tags %} + + {% if show_ordering_column or show_bulk_actions %} + + {% endif %} + + {% if show_parent %} + + {% endif %} + + + + + + {% block pre_parent_page_headers %} + {% endblock %} + + {% if parent_page %} + {% page_permissions parent_page as parent_page_perms %} + + + + + + + + {% endif %} + + {% block post_parent_page_headers %} + {% endblock %} + + + {% if pages %} + {% trans "Select page" as checkbox_aria_label %} + {% for page in pages %} + {% page_permissions page as page_perms %} + + {% if show_ordering_column %} + + {% elif show_bulk_actions %} + {% include "wagtailadmin/bulk_actions/listing_checkbox_cell.html" with obj_type="page" obj=page aria_labelledby_prefix="page_" aria_labelledby=page.pk|unlocalize aria_labelledby_suffix="_title" %} + {% endif %} + + {% if show_parent %} + + {% endif %} + + + + + + {% block page_navigation %} + {% endblock %} + + + + {# {% if page.content_type.model == 'chapter' %}#} + {# #} + {# #} + {# #} + {##} + {##} + {# #} + {##} + {# {% endif %}#} + {##} + + + + + {% endfor %} + {% else %} + {% block no_results %}{% endblock %} + {% endif %} + +
+ {% block parent_page_title %} + {% endblock %} + {% if parent_page.latest_revision_created_at %} +
+ {% blocktrans with time_period=parent_page.latest_revision_created_at|timesince %}{{ time_period }} + ago{% endblocktrans %}
{% endif %}
+ {% if not parent_page.is_root %} + {{ parent_page.content_type.model_class.get_verbose_name }} + {% endif %} + + {% if not parent_page.is_root %} + {% include "wagtailadmin/shared/page_status_tag.html" with page=parent_page %} + {% endif %} +
{% if orderable and ordering == "ord" %} +
{% trans 'Drag' %}
{% endif %}
+ + {% block page_title %} + {% endblock %} + {% if page.content_type.model == 'chapter' %} +
+
    + {% for c in page.get_children %} +
  • + + {% if page_perms.can_edit %} + {{ c.get_admin_display_title }} + {% else %} + {{ c.get_admin_display_title }} + {% endif %} +
  • + + {% endfor %} +
+ +
+ {% endif %} +
+ {% block page_parent_page_title %} + {% with page.get_parent as parent %} + {% if parent %} + {{ parent.specific_deferred.get_admin_display_title }} + {% endif %} + {% endwith %} + {% endblock %} + {% if page.latest_revision_created_at %} +
+ {% blocktrans with time_period=page.latest_revision_created_at|timesince %}{{ time_period }} + ago{% endblocktrans %}
{% endif %}
{{ page.content_type.model_class.get_verbose_name }} + {% include "wagtailadmin/shared/page_status_tag.html" with page=page %} +
#} + {##} + {# #} + {#
    #} + {# {% for c in page.get_children %}#} + {#
  • {{ c.get_admin_display_title }}
  • #} + {# {% endfor %}#} + {#
#} + {#
diff --git a/server/core/templates/wagtailadmin/pages/listing/_page_title_explore.html b/server/core/templates/wagtailadmin/pages/listing/_page_title_explore.html new file mode 100644 index 00000000..ea6c4244 --- /dev/null +++ b/server/core/templates/wagtailadmin/pages/listing/_page_title_explore.html @@ -0,0 +1,32 @@ +{% load i18n wagtailadmin_tags %} + +{# The title field for a page in the page listing, when in 'explore' mode #} + +
+ +
lksdamflasdmf
+ {% if page.is_site_root %} + {% if perms.wagtailcore.add_site or perms.wagtailcore.change_site or perms.wagtailcore.delete_site %} + + {% endif %} + {% endif %} + + {% if page_perms.can_edit %} + {{ page.get_admin_display_title }} + {% else %} + {{ page.get_admin_display_title }} + {% endif %} + + {% if show_locale_labels %} + {{ page.locale.get_display_name }} + {% endif %} + + {% block pages_listing_title_extra %}{% endblock pages_listing_title_extra %} + + {% include "wagtailadmin/pages/listing/_privacy_indicator.html" with page=page %} + {% include "wagtailadmin/pages/listing/_locked_indicator.html" with page=page %} +
+ +