Initial commit

This commit is contained in:
2024-08-27 20:33:44 +02:00
commit 1f1832267d
14794 changed files with 1599592 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
{% load wagtailadmin_tags %}
<script
src="{% versioned_static 'wagtailadmin/js/workflow-action.js' %}"
data-activate="editor"
{% if publishing_will_cancel_workflow %}
data-confirm-cancellation-url="{{ confirm_workflow_cancellation_url }}"
{% endif %}
>
</script>

View File

@@ -0,0 +1,22 @@
{% load wagtailadmin_tags %}
{% comment %}
This is a switch (checkbox) input that is hooked into the ActionController
to allow for a POST request to be made when the switch is toggled.
Variables this template accepts:
data_url - A URL for ActionController to use
checked - Whether the switch is checked (active) or not
label_text - The text that shows up beside the switch
sr_only_label - Make the label invisible for all but screen reader users
classname - Custom CSS classes for styling
{% endcomment %}
<label class="switch w-my-0 {{ classname }}">
{% if label_text %}
<span class="w-mr-1 {% if sr_only_label %}w-sr-only{% endif %}">{{ label_text }}</span>
{% endif %}
<input type="checkbox" {% if checked %}checked{% endif %} data-controller="w-action" data-action="click->w-action#post" data-w-action-url-value="{{ data_url }}">
<span class="switch__toggle">
{% icon name="check" classname="switch__icon" %}
</span>
</label>

View File

@@ -0,0 +1,21 @@
{% load i18n wagtailadmin_tags %}
<ul class="w-active-filters">
{% for filter in active_filters %}
<li class="w-pill">
<button class="w-pill__content" data-controller="w-action" data-w-active-filter-id="{{ filter.auto_id }}" aria-controls="drilldown-{{ filter.auto_id }}">
<span class="w-text-14">{{ filter.field_label }}:</span>
<b class="w-ml-1">{{ filter.value }}</b>
</button>
<button
data-controller="w-swap"
data-action="click->w-swap#replaceLazy"
data-w-swap-src-value="{{ filter.removed_filter_url }}"
data-w-swap-target-value="#listing-results"
data-w-swap-reflect-value="true"
class="w-pill__remove"
aria-label="{% trans 'Clear' %}">
{% icon name="cross" classname="w-h-4 w-w-4" %}
</button>
</li>
{% endfor %}
</ul>

View File

@@ -0,0 +1,25 @@
{# DEPRECATED. Use pagination_nav.html with meaningful URLs instead #}
{% load i18n %}
{% load wagtailadmin_tags %}
<nav class="pagination" aria-label="{% trans 'Pagination' %}">
<p>{% blocktrans trimmed with page_num=items.number total_pages=items.paginator.num_pages %}Page {{ page_num }} of {{ total_pages }}.{% endblocktrans %}</p>
<ul>
<li class="prev">
{% if items.has_previous %}
<a href="#" data-page="{{ items.previous_page_number }}">
{% icon name="arrow-left" classname="default" %}
{% trans 'Previous' %}
</a>
{% endif %}
</li>
<li class="next">
{% if items.has_next %}
<a href="#" data-page="{{ items.next_page_number }}">
{% trans 'Next' %}
{% icon name="arrow-right" classname="default" %}
</a>
{% endif %}
</li>
</ul>
</nav>

View File

@@ -0,0 +1 @@
{% for name, value in attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %}

View File

@@ -0,0 +1,31 @@
{% load wagtailadmin_tags %}
{% comment "text/markdown" %}
Displays a user avatar using the avatar template
Variables this template accepts:
- `classname` - if present, adds classname to the root class list
- `user` - A user object to use for the avatar image
- `size` (string?) - small, large, square
- `tooltip` (string?) - Modifier classes
- `tooltip_html` (string?) - An HTML element to use for the tooltip content
{% endcomment %}
<span
class="{% classnames 'avatar' size classname %}"
{% if tooltip or tooltip_html %} data-controller="w-tooltip" {% endif %}
{% if tooltip %} data-w-tooltip-content-value="{{ tooltip }}" {% endif %}
>
{% if tooltip_html %}
<template data-w-tooltip-target="content">
{{ tooltip_html }}
</template>
{% endif %}
{% if size == 'small' %}
<img src="{% avatar_url user size=25 %}" alt="" decoding="async" loading="lazy"/>
{% elif size == 'large' %}
<img src="{% avatar_url user size=100 %}" alt="" decoding="async" loading="lazy"/>
{% elif size == 'square' %}
<img src="{% avatar_url user %}" alt="" decoding="async" loading="lazy"/>
{% else %}
<img src="{% avatar_url user %}" alt="" decoding="async" loading="lazy"/>
{% endif %}
</span>

View File

@@ -0,0 +1,88 @@
{% load i18n wagtailadmin_tags %}
{% comment "text/markdown" %}
The breadcrumb component is reused across most of Wagtail's headers.
Variables this template accepts:
`items` - A list of {"url": Union[str, None], "label": str, "sublabel": Union[str, None]} dicts
`classname` - Modifier classes
`is_expanded` - Whether the breadcrumbs are always expanded or not, if True the breadcrumbs will not be collapsible
`icon_name` - The name of the icon to display before the final item when the breadcrumbs are collapsed
{% endcomment %}
{% with breadcrumb_link_classes='w-flex w-items-center w-text-text-label w-pr-0.5 w-text-14 w-no-underline w-outline-offset-inside w-border-b w-border-b-2 w-border-transparent w-box-content hover:w-border-current hover:w-text-text-label' breadcrumb_item_classes='w-h-full w-flex w-items-center w-overflow-hidden w-transition w-duration-300 w-whitespace-nowrap w-flex-shrink-0' icon_classes='w-w-4 w-h-4 w-ml-3' %}
{# Breadcrumbs are visible on mobile by default but hidden on desktop #}
<div class="w-breadcrumbs w-flex w-flex-row w-items-center w-overflow-x-auto w-overflow-y-hidden w-scrollbar-thin {{ classname }} {% if is_expanded %} w-pl-3{% endif %}"
{% if not items %}hidden{% endif %}
{% if not is_expanded %}
data-controller="w-breadcrumbs"
data-action="keyup.esc@document->w-breadcrumbs#close w-breadcrumbs:open@document->w-breadcrumbs#open w-breadcrumbs:close@document->w-breadcrumbs#close"
data-w-breadcrumbs-close-icon-class="icon-cross"
data-w-breadcrumbs-closed-value="true"
data-w-breadcrumbs-open-icon-class="icon-breadcrumb-expand"
data-w-breadcrumbs-opened-content-class="w-max-w-4xl"
data-w-breadcrumbs-peek-target-value="header"
{% endif %}
>
{% if not is_expanded %}
<button
type="button"
class="w-flex w-items-center w-justify-center w-box-border w-ml-0 w-mr-2.5 w-w-slim-header w-h-slim-header w-bg-transparent w-text-text-meta w-transition hover:w-scale-110 hover:w-text-text-label w-outline-offset-inside"
aria-label="{% trans 'Toggle breadcrumbs' %}"
aria-expanded="false"
data-w-breadcrumbs-target="toggle"
data-action="w-breadcrumbs#toggle mouseenter->w-breadcrumbs#peek"
>
{% icon name="breadcrumb-expand" classname="w-w-4 w-h-4" %}
</button>
{% endif %}
<div class="w-relative w-h-slim-header w-mr-4 w-top-0 w-z-20 w-flex w-items-center w-flex-row w-flex-1 sm:w-flex-none w-transition w-duration-300">
<nav class="w-flex w-items-center w-flex-row w-h-full"
aria-label="{% trans 'Breadcrumb' %}">
<ol class="w-flex w-flex-row w-justify-start w-items-center w-h-full w-pl-0 w-my-0 w-gap-2 sm:w-gap-0 sm:w-space-x-2">
{% block breadcrumbs_items %}
{% for item in items %}
<li
class="{{ breadcrumb_item_classes }} {% if forloop.last %}w-font-bold{% endif %} {% if not is_expanded and not forloop.last %}w-max-w-0{% endif %}"
{% if not is_expanded and not forloop.last %}
hidden
{% endif %}
{% if is_expanded or not forloop.last %}
data-w-breadcrumbs-target="content"
{% endif %}
>
{% fragment as icon %}
{% if icon_name and forloop.last %}
{% icon name=icon_name classname="w-breadcrumbs__icon w-hidden" %}
{% endif %}
{% endfragment %}
{% fragment as sublabel %}
{% if item.sublabel %}
<span class="w-sr-only">: </span>
<span class="w-breadcrumbs__sublabel w-font-normal w-hidden w-ml-2.5">
{{ item.sublabel }}
</span>
{% endif %}
{% endfragment %}
{% if item.url is not None %}
<a class="{{ breadcrumb_link_classes }}" href="{{ item.url }}">
{{ icon }}
{{ item.label }}
{{ sublabel }}
</a>
{% else %}
<div class="w-flex w-justify-start w-items-center">
{{ icon }}
{{ item.label }}
{{ sublabel }}
</div>
{% endif %}
{% if not forloop.last %}
{% icon name="arrow-right" classname=icon_classes %}
{% endif %}
</li>
{% endfor %}
{% endblock %}
</ol>
</nav>
</div>
</div>
{% endwith %}

View File

@@ -0,0 +1,7 @@
{% load wagtailadmin_tags %}
<a href="{{ button.url }}" class="{{ button.classname }}" {{ button.base_attrs_string }}>
{% if button.icon_name %}
{% icon name=button.icon_name %}
{% endif %}
{{ button.label }}
</a>

View File

@@ -0,0 +1,6 @@
{% load wagtailadmin_tags %}
{% for button in buttons %}
{% if button.show %}
<li>{% component button %}</li>
{% endif %}
{% endfor %}

View File

@@ -0,0 +1,13 @@
{% load wagtailadmin_tags i18n l10n %}
{% rawformattedfield label_text=_("Collection") id_for_label="collection_chooser_collection_id" %}
<select id="collection_chooser_collection_id" name="collection_id" data-controller="w-submit" data-action="change->w-submit#submit">
<option value="">{% trans "All collections" %}</option>
{% for pk, display_name in collections.get_indented_choices %}
<option value="{{ pk|unlocalize }}"
{% if pk == current_collection.pk %}selected="selected"{% endif %}>
{{ display_name }}
</option>
{% endfor %}
</select>
{% endrawformattedfield %}

View File

@@ -0,0 +1,50 @@
{% load wagtailadmin_tags i18n %}
<template
data-controller="w-teleport"
{% if dialog_root_selector %}data-w-teleport-target-value="{{ dialog_root_selector }}"{% endif %}
>
<div id="{{ id }}"
aria-labelledby="title-{{ id }}"
aria-hidden="true"
class="w-dialog{% if theme %} w-dialog--{{ theme }}{% endif %}{% if message_heading and message_icon_name %} w-dialog--message{% endif %}{% if classname %} {{ classname }}{% endif %}"
data-controller="w-dialog"
data-action="w-dialog:hide->w-dialog#hide w-dialog:show->w-dialog#show"
{% if theme %}data-w-dialog-theme-value="{{ theme }}"{% endif %}
{% if data_url %}data-url="{{ data_url }}"{% endif %}
>
<div class="w-dialog__overlay" data-action="click->w-dialog#hide"></div>
<div class="w-dialog__box">
<button type="button" class="w-dialog__close-button" aria-label="{% trans 'Close dialog' %}" data-action="w-dialog#hide">
{% icon name='cross' classname="w-dialog__close-icon" %}
</button>
{% if message_heading and message_icon_name %}
<div class="w-dialog__message w-dialog__message--{{ message_status }}">
{% icon name=message_icon_name classname="w-dialog__message-icon" %}
<div class="w-dialog__message-header">
<strong class="w-dialog__message-heading">{{ message_heading }}</strong>
{% if message_description %}<p class="w-dialog__message-description ">{{ message_description }}</p>{% endif %}
</div>
</div>
{% endif %}
<div class="w-dialog__content">
<div class="w-dialog__header">
<h2 class="w-dialog__title w-h1" id="title-{{ id }}">
{% fragment as icon_classname %}{% classnames "w-dialog__icon" icon_classname %}{% endfragment %}
{% if icon_name %}{% icon name=icon_name classname=icon_classname %}{% endif %}
<span id="title-text-{{ id }}">{{ title }}</span>
</h2>
{% if subtitle %}
<p class="w-dialog__subtitle w-help-text" id="subtitle-{{ id }}">{{ subtitle }}</p>
{% endif %}
</div>
<div class="w-dialog__body" data-w-dialog-target="body">
{{ children }}
</div>
</div>
</div>
</div>
</template>

View File

@@ -0,0 +1,11 @@
{% load wagtailadmin_tags %}
{% comment "text/markdown" %}
Variables this template accepts:
dialog_id - The ID of the dialog you are toggling open
classname - CSS classes for styling the button
text - The text of the button
{% endcomment %}
<button type="button" class="{{ classname }}" data-a11y-dialog-show="{{ dialog_id }}">
{{ text }}
</button>

View File

@@ -0,0 +1,43 @@
{% load wagtailadmin_tags %}
{% comment "text/markdown" %}
Reusable dropdown menu component built with Tippy.js using the Stimulus DropdownController.
- `theme` (string?) - visual variants of the component
- `classname` (string?) - more classes for parent element
- `attrs` (string?) - more attributes for parent element
- `toggle_icon` (string?) - toggle icon identifier
- `toggle_label` (string?) - Visible label for the toggle button
- `toggle_suffix` (string?) - Visible content for the toggle button after the icon
- `toggle_aria_label` (string?) - aria-label for the toggle button
- `toggle_describedby` (string?) - aria-describedby for the toggle button
- `toggle_classname` (string?) - additional toggle classes
- `toggle_tooltip_offset` (string?) - Tooltip offset prop
- `hide_on_click` (boolean?) - Whether or not the tooltip should hide when clicking inside
- `keep_mounted` (boolean?) - Whether or not the tooltip should keep its DOM node mounted when hidden
- `children` - Dropdown contents (`a` and `button` elements only)
{% endcomment %}
{% fragment as class %}{% classnames 'w-dropdown' classname %}{% if theme %} w-dropdown--{{ theme }}{% endif %}{% endfragment %}
<div
data-controller="w-dropdown"
class="{{ class }}"
{{ attrs }}
{% if theme %}data-w-dropdown-theme-value="{{ theme }}"{% endif %}
{% if toggle_tooltip_offset %}data-w-dropdown-offset-value="{{ toggle_tooltip_offset }}"{% endif %}
{% if hide_on_click %}data-w-dropdown-hide-on-click-value="true"{% endif %}
{% if keep_mounted %}data-w-dropdown-keep-mounted-value="true"{% endif %}
>
<button type="button" class="{% classnames 'w-dropdown__toggle' toggle_label|yesno:',w-dropdown__toggle--icon' toggle_classname %}" data-w-dropdown-target="toggle"{% if toggle_aria_label %} aria-label="{{ toggle_aria_label }}"{% endif %}{% if toggle_describedby %} aria-describedby="{{ toggle_describedby }}"{% endif %}{% if toggle_tippy_offset %} data-tippy-offset="{{ toggle_tippy_offset }}"{% endif %}>
{{ toggle_label }}
{% if toggle_icon %}
{% icon name=toggle_icon classname="w-dropdown__toggle-icon" %}
{% endif %}
{{ toggle_suffix }}
</button>
<div data-w-dropdown-target="content" class="w-dropdown__content" hidden>
{{ children }}
</div>
</div>

View File

@@ -0,0 +1,24 @@
{% load wagtailadmin_tags i18n %}
{% comment "text/markdown" %}
A button with a dropdown menu next to it.
- `button` (fragment) - the main button
- `toggle_icon` (string?) - toggle icon identifier
- `toggle_classname` (string?) - additional toggle classes
- `classname` (string?) - additional component classes
- `children` - Dropdown contents (`a` and `button` elements only)
- `keep_mounted` (boolean?) - Whether or not the dropdown should keep its DOM node mounted when hidden
{% endcomment %}
<div class="{% classnames 'w-dropdown-button' classname %}">
{{ button }}
{% if children %}
{% fragment as toggle_classes %}{% classnames toggle_classname "button" %}{% endfragment %}
{# Built with w-sr-only so there is no visible tooltip. #}
{% fragment as toggle_label %}<span class="w-sr-only">{% trans "More actions" %}</span>{% endfragment %}
{% dropdown theme="dropdown-button" toggle_label=toggle_label toggle_classname=toggle_classes toggle_icon=toggle_icon|default:"arrow-down" toggle_tooltip_offset="[0, 0]" keep_mounted=keep_mounted %}
{{ children }}
{% enddropdown %}
{% endif %}
</div>

View File

@@ -0,0 +1,132 @@
{% load wagtailadmin_tags i18n %}
<ol class="w-editing-sessions__list">
{% for session in sessions|slice:":4" %}
<li>
{% fragment as avatar %}
{% avatar user=session.user classname="w-editing-sessions__avatar" %}
{% endfragment %}
{% if session.revision_id %}
{% fragment as avatar_decorated %}
<div class="w-editing-sessions__decorated-avatar w-ping w-ping--critical">
{{ avatar }}
{% icon name="warning" %}
<span class="w-editing-sessions__decorator-filler"></span>
</div>
{% endfragment %}
{% if current_session.user == session.user %}
{% blocktranslate trimmed asvar saved_new_version_message %}
You saved a new version in another window
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=session.user|user_display_name|default:_("System") asvar saved_new_version_message %}
{{ user_name }} saved a new version
{% endblocktranslate %}
{% endif %}
{% dropdown theme="popup" classname="w-editing-sessions__session w-editing-sessions__session--saved" toggle_label=avatar_decorated toggle_aria_label=saved_new_version_message %}
<div class="w-editing-sessions__popup">
<div class="w-editing-sessions__message">
{% icon name="warning" %}
{{ saved_new_version_message }}
</div>
{% comment %}
Use a custom button element instead of the dialog_toggle.html so we can add arbitrary
data attributes to the button element. This is useful for allowing the SessionController
to conditionally show the dialog, i.e. only when the user has unsaved changes.
{% endcomment %}
<button type="button" data-w-session-target="reload" class="button button-small button-secondary chooser__choose-button" data-dialog-id="w-unsaved-changes-dialog">
{% icon name="rotate" %}
{% trans "Refresh" %}
</button>
</div>
{% enddropdown %}
{% elif session.is_editing %}
{% if current_session.user == session.user %}
{% blocktranslate trimmed asvar has_unsaved_changes_message %}
You have unsaved changes in another window
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=session.user|user_display_name|default:_("System") asvar has_unsaved_changes_message %}
{{ user_name }} has unsaved changes
{% endblocktranslate %}
{% endif %}
{% dropdown theme="popup" classname="w-editing-sessions__session w-editing-sessions__session--editing" toggle_label=avatar toggle_aria_label=has_unsaved_changes_message %}
<div class="w-editing-sessions__popup">
<div class="w-editing-sessions__message">
{% icon name="warning" %}
{{ has_unsaved_changes_message }}
</div>
</div>
{% enddropdown %}
{% else %}
<button class="w-editing-sessions__session" type="button" data-controller="w-tooltip">
{{ avatar }}
<div class="w-editing-sessions__popup" data-w-tooltip-target="content" hidden>
<span class="w-editing-sessions__name">{{ session.user|user_display_name|default:_("System") }}</span>
<span class="w-sr-only">-</span>
<span>{% trans "Currently viewing" %}</span>
</div>
</button>
{% endif %}
</li>
{% endfor %}
{% if sessions|length > 4 %}
{% blocktranslate trimmed count num_user=sessions|length|add:"-4" asvar num_other_users_message %}
One other user is currently viewing
{% plural %}
{{ num_user }} other users are currently viewing
{% endblocktranslate %}
{% fragment as more_sessions_toggle %}
+{{ sessions|length|add:"-4" }}
{% endfragment %}
<li>
<span id="w-editing-sessions-more-summary" class="w-sr-only">{{ num_other_users_message }}</span>
{% dropdown theme="drilldown" classname="w-editing-sessions__session w-editing-sessions__session--more" toggle_classname="w-editing-sessions__avatar" toggle_label=more_sessions_toggle toggle_describedby="w-editing-sessions-more-summary" %}
<ol class="w-editing-sessions__more-list">
{% for session in sessions|slice:"4:" %}
<li class="w-editing-sessions__list-item">
{% avatar user=session.user size="small" %}
<span>{{ session.user|user_display_name|default:_("System") }}</span>
</li>
{% endfor %}
</ol>
{% enddropdown %}
</li>
{% endif %}
</ol>
{% if sessions.0.revision_id %}
<template data-controller="w-teleport" data-w-teleport-target-value="#title-text-w-overwrite-changes-dialog" data-w-teleport-reset-value="true">
{% if current_session.user == sessions.0.user %}
{% blocktranslate trimmed asvar someone_has_saved_message %}
You saved a new version in another window
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=sessions.0.user|user_display_name|default:_("System") asvar someone_has_saved_message %}
{{ user_name }} saved a new version
{% endblocktranslate %}
{% endif %}
{{ someone_has_saved_message }}
</template>
<template data-controller="w-teleport" data-w-teleport-target-value="#subtitle-w-overwrite-changes-dialog" data-w-teleport-reset-value="true">
{% if current_session.user == sessions.0.user %}
{% blocktranslate trimmed asvar overwrite_message %}
Proceeding will overwrite the changes you made in that window. Refreshing the page will show you the new changes, but you will lose any of your unsaved changes in the current window.
{% endblocktranslate %}
{% else %}
{% blocktranslate trimmed with user_name=sessions.0.user|user_display_name|default:_("System") asvar overwrite_message %}
Proceeding will overwrite the changes made by {{ user_name }}. Refreshing the page will show you the new changes, but you will lose any of your unsaved changes.
{% endblocktranslate %}
{% endif %}
{{ overwrite_message }}
</template>
{% endif %}

View File

@@ -0,0 +1,44 @@
{% load i18n l10n wagtailadmin_tags %}
{% dialog id="w-unsaved-changes-dialog" icon_name="warning" icon_classname="w-text-text-error" title=_("Refreshing the page means you will lose any unsaved changes") %}
<div class="w-editing-sessions-dialog-buttons">
<button class="button" type="button" data-controller="w-action" data-action="w-action#forceReload">{% trans "Refresh page" %}</button>
<button class="button button-secondary" type="button" data-action="w-dialog#hide">{% trans "Cancel" %}</button>
</div>
{% enddialog %}
{% comment %}
The "-" strings are only placeholders so that the appropriate elements are rendered.
The messages will be provided via the sessions list component and teleported into the corresponding elements.
The dialog won't ever be shown without the actual messages under normal circumstances.
{% endcomment %}
{% dialog id="w-overwrite-changes-dialog" dialog_root_selector='[data-edit-form]' icon_name="warning" icon_classname="w-text-text-error" title="-" subtitle="-" %}
<div class="w-editing-sessions-dialog-buttons">
<button class="button" type="button" data-w-dialog-target="confirm" data-action="w-dialog#confirm">{% trans "Continue" %}</button>
<button class="button button-secondary" type="button" data-controller="w-action" data-action="w-action#forceReload">{% trans "Refresh the page" %}</button>
</div>
{% enddialog %}
<form
method="post"
class="w-editing-sessions"
data-controller="w-swap w-action w-session"
data-w-swap-target-value="#w-editing-sessions"
data-w-swap-src-value="{{ ping_url }}"
data-w-swap-json-path-value="html"
data-w-swap-defer-value="true"
data-w-action-continue-value="true"
data-w-action-url-value="{{ release_url }}"
data-w-session-interval-value="{{ ping_interval|unlocalize }}"
data-w-session-w-dialog-outlet="[data-edit-form] [data-controller='w-dialog']#w-overwrite-changes-dialog"
data-action="w-session:ping->w-swap#submit visibilitychange@document->w-session#dispatchVisibilityState w-session:visible->w-session#ping w-session:visible->w-session#addInterval w-session:hidden->w-session#clearInterval w-session:hidden->w-action#sendBeacon w-unsaved:add@document->w-session#setUnsavedChanges w-unsaved:clear@document->w-session#setUnsavedChanges w-swap:json->w-session#updateSessionData"
>
<input type="checkbox" name="is_editing" value="1" data-w-session-target="unsavedChanges" hidden />
{% if revision_id %}
{# The ID of the latest revision that was known when this module was initially loaded #}
<input type="hidden" name="revision_id" value="{{ revision_id }}" />
{% endif %}
<div id="w-editing-sessions">
{% component sessions_list %}
</div>
</form>

View File

@@ -0,0 +1,16 @@
{% load i18n wagtailadmin_tags %}
{% comment "text/markdown" %}
Variables accepted by this template:
- `view` - a view instance (usually of `SpreadsheetExportMixin`) that has `xlsx_export_url` and `csv_export_url` properties.
{% endcomment %}
{% fragment as button %}
<a href="{{ view.xlsx_export_url }}" class="button bicolor button--icon">{% icon name="download" wrapped=1 %}{% trans 'Download XLSX' %}</a>
{% endfragment %}
{% dropdown_button button=button toggle_icon="arrow-down" %}
<a class="button bicolor button--icon" href="{{ view.csv_export_url }}">{% icon name="download" wrapped=1 %}{% trans 'Download CSV' %}</a>
{% enddropdown_button %}

View File

@@ -0,0 +1,2 @@
{% load wagtailadmin_tags %}
{% formattedfieldfromcontext %}

View File

@@ -0,0 +1,19 @@
{% load i18n wagtailadmin_tags %}
<div class="filterable__filters">
<h2>{% trans 'Filter' %}</h2>
<form method="get">
<button
class="button button-longrunning"
type="submit"
data-controller="w-progress"
data-action="w-progress#activate"
>
{% icon name="spinner" %}{% trans 'Apply filters' %}
</button>
{% for field in filters.form %}
{% formattedfield field %}
{% endfor %}
</form>
</div>

View File

@@ -0,0 +1,62 @@
{% load wagtailadmin_tags i18n %}
{% comment "text/markdown" %}
The field template is very flexible to cater for a wide range of use cases. It has two main attributes that support different use cases:
1. `field` to render a Django form field. This may be done through the `{% formattedfield my_field %}` template tag, or a direct `include` of this template.
2. `rendered_field` to render arbitrary HTML. This may be done through the tag pair `{% rawformattedfield %}<select>[…]</select>{% endrawformattedfield %}`,
or a direct `include` of this template.
If both `field` and `rendered_field` are passed, `rendered_field` will be used as the actual form rendering, but metadata
for the surrounding elements (such as help text and ID) will be picked up from `field`.
A unified template for both use cases is messy, but it guarantees we are keeping form field styles the same everywhere.
{% endcomment %}
<div class="w-field__wrapper {{ classname }}" data-field-wrapper>
{# Render custom label attributes if provided, or the bound fields label attributes otherwise. #}
{% if show_label %}
{# Add an id to the label so we can use it as a descriptor for the "Add comment" button. #}
<label class="w-field__label{% if sr_only_label %} w-sr-only{% endif %}"{% if label_for %} for="{{ label_for }}"{% endif %}{% if label_id %} id="{{ label_id }}"{% endif %}>
{{ label_text }}{% if required %}<span class="w-required-mark">*</span>{% endif %}
</label>
{% endif %}
{# Its possible to customise the fields layout based on widget type. #}
{# Customising fields based on the field type is only supported for backwards compatibility. #}
<div class="w-field {{ field_classname }}{% if has_errors %} w-field--error{% endif %}{% if show_add_comment_button %} w-field--commentable{% endif %}" data-field{% if contentpath %} data-contentpath="{{ contentpath }}"{% endif %}>
{# Always associate a wrapping div with the field, so JS error rendering knows where to put error messages. #}
<div class="w-field__errors" data-field-errors {% if error_message_id %}id="{{ error_message_id }}"{% endif %}>
{% if errors %}
{% icon name="warning" classname="w-field__errors-icon" %}
<p class="error-message">
{% for error in errors %}{{ error|escape }} {% endfor %}
</p>
{% endif %}
</div>
<div class="w-field__help" {% if help_text_id %}id="{{ help_text_id }}"{% endif %} data-field-help>
{% if help_text %}
<div class="help">{{ help_text }}</div>
{% endif %}
</div>
{# Separate container for the widget with prefix icon and suffix comment button #}
<div class="w-field__input" data-field-input>
{% if icon %}
{% icon name=icon classname="w-field__icon" %}
{% endif %}
{{ rendered_field }}
{% if show_add_comment_button %}
<button class="w-field__comment-button w-field__comment-button--add" type="button" data-component="add-comment-button" data-comment-add aria-label="{% trans 'Add comment' %}" {% if label_id %}aria-describedby="{{ label_id }}"{% endif %}>
{% icon name="comment-add" %}
{% icon name="comment-add-reversed" %}
</button>
{% endif %}
</div>
</div>
</div>

View File

@@ -0,0 +1,3 @@
<div class="w-field-row {% if max_content%}w-field-row--max-content{% endif %} {{ classname }}">
{{ children }}
</div>

View File

@@ -0,0 +1,5 @@
{# Render a single checkbox with text center-aligned. #}
<label class="w-flex w-items-center {{ label_classname }}">
<input type="checkbox" name="{{ name }}"{% if value %} value="{{ value }}"{% endif %} {% if checked %}checked{% endif %} {% include "wagtailadmin/shared/attrs.html" with attrs=attrs %}>
{{ text }}
</label>

View File

@@ -0,0 +1,91 @@
{% load i18n wagtailadmin_tags %}
{% comment "text/markdown" %}
Variables accepted by this template:
- `classname` - if present, adds classname to the header class list
- `title` - Displayed as `h1`
- `subtitle` - Within the `h1` tag but smaller
- `description` - if present, displayed as a small text below the `h1` tag title
- `search_url` - if present, display a search box. This is a URL route name (taking no parameters) to be used as the action for that search box
- `search_form` - form object for the search form. Required if search_url is passed
- `search_results_url` - URL to be used for async requests to search results, if not provided, the form's action URL will be used
- `search_target` - A selector string to be used as the target for the search results to be swapped into. Defaults to '#listing-results'
- `search_disable_async` - If True, the default header async search functionality will not be used
- `query_parameters` - a query string (without the '?') to be placed after the search URL
- `icon` - name of an icon to place against the title
- `avatar` - if present, display an 'avatar' in place of icon. This is the URL to be used as the img src for avatar
- `merged` - if true, add the classname 'w-header--merged'
- `action_url` - if present, display an 'action' button. This is the URL to be used as the link URL for the button
- `action_text` - text for the 'action' button
- `action_icon` - icon for the 'action' button, default is 'plus'
- `base_actions` - base actions to appear before the main action
- `extra_actions` - extra action buttons for the header. This is the HTML to be used for the extra buttons
- `heading` - Replaces the header `h1` completely with custom variable content
- `search` - An alternative search content variable displayed if provided and search_url url is not present
- `extra_rows` - Shown at the end of the header container
{% endcomment %}
<header class="{% classnames "w-header" classname merged|yesno:"w-header--merged," search_form|yesno:"w-header--hasform," %}">
<div class="row">
<div class="left">
<div class="col">
{% if heading %}
{{ heading }}
{% else %}
<h1 class="w-header__title" id="header-title">
{% if icon %}
{% icon classname="w-header__glyph" name=icon %}
{% elif avatar %}
<div class="w-header__glyph avatar large"><img src="{{ avatar }}" alt="" /></div>
{% endif %}
{{ title }}{% if subtitle %} <span class="w-header__subtitle">{{ subtitle }}</span>{% endif %}
</h1>
{% endif %}
{% if description %}<div class="w-header__description">{{ description }}</div>{% endif %}
</div>
{% if search_url %}
<form
class="col search-form"
action="{% url search_url %}{% if query_parameters %}?{{ query_parameters }}{% endif %}"
method="get"
novalidate
role="search"
{% if not search_disable_async %}
data-controller="w-swap"
data-action="change->w-swap#searchLazy input->w-swap#searchLazy"
{% if search_results_url %}data-w-swap-src-value="{{ search_results_url }}"{% endif %}
{% if search_target %}data-w-swap-target-value="{{ search_target }}"{% endif %}
{% endif %}
>
{% for field in search_form %}
{% formattedfield field=field classname="w-mb-0 -w-mt-2.5" sr_only_label=True icon="search" %}
{% endfor %}
{% comment %}Add an initial disabled & hidden submit button so that pressing 'enter' will not submit form. Reload not required as the content is dynamically loaded.{% endcomment %}
<div class="w-sr-only"><input disabled type="submit" aria-hidden="true"/></div>
<div class="submit w-sr-only"><input type="submit" value="Search" class="button" /></div>
</form>
{% elif search %}
{{ search }}
{% endif %}
</div>
<div class="{% block right_column_classname %}right{% endblock %}">
{% if base_actions %}
{{ base_actions }}
{% endif %}
{% block right_column %}
{% if action_url %}
<div class="actionbutton">
{% with action_icon|default:'plus' as action_icon_name %}
<a href="{{ action_url }}" class="button bicolor button--icon">{% icon name=action_icon_name wrapped=1 %}{{ action_text|capfirst }}</a>
{% endwith %}
</div>
{% endif %}
{% endblock %}
{% if extra_actions %}
{{ extra_actions }}
{% endif %}
</div>
</div>
{% block extra_rows %}{{ extra_rows }}{% endblock %}
</header>

View File

@@ -0,0 +1,11 @@
{% extends "wagtailadmin/shared/header.html" %}
{% block right_column_classname %}right col{% endblock %}
{% block right_column %}
<form>
{% if locale %}
{% include 'wagtailadmin/shared/locale_selector.html' with theme='large' %}
{% endif %}
</form>
{{ block.super }}
{% endblock %}

View File

@@ -0,0 +1,30 @@
{% load wagtailadmin_tags i18n %}
{% fragment as toggle_suffix %}
<span class="w-drilldown__count" data-w-drilldown-target="count" hidden></span>
{% endfragment %}
{% dropdown theme="drilldown" toggle_icon="sliders" toggle_classname="w-filter-button" toggle_aria_label=_("Show filters") toggle_suffix=toggle_suffix keep_mounted=True %}
<div class="w-drilldown__contents">
<div class="w-drilldown__menu" data-w-drilldown-target="menu">
<h2 class="w-help-text w-pl-5 w-py-2.5 w-my-0">{% trans "Filter by" %}</h2>
{% for field in filters.form %}
<button class="w-drilldown__toggle" type="button" aria-expanded="false" aria-controls="drilldown-{{ field.auto_id }}" data-w-drilldown-target="toggle" data-action="click->w-drilldown#open">
{{ field.label }}
<div class="w-flex w-items-center w-gap-2">
<span class="w-drilldown__count" data-w-drilldown-target="count" data-count-name="{{ field.auto_id }}" hidden></span>
{% icon name="arrow-right" %}
</div>
</button>
{% endfor %}
</div>
{% for field in filters.form %}
<div class="w-drilldown__submenu" id="drilldown-{{ field.auto_id }}" hidden tabindex="-1">
<button class="w-drilldown__back" type="button" aria-label="{% trans 'Back' %}" data-action="click->w-drilldown#close">
{% icon name="arrow-left" %}
</button>
{% formattedfield field %}
</div>
{% endfor %}
</div>
{% enddropdown %}

View File

@@ -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>

View File

@@ -0,0 +1,6 @@
{% extends 'wagtailadmin/shared/headers/slim_header.html' %}
{% load wagtailadmin_tags i18n %}
{% block breadcrumbs %}
{% page_breadcrumbs parent_page 'wagtailadmin_explore' url_root_name='wagtailadmin_explore_root' include_self=True trailing_breadcrumb_title=title %}
{% endblock %}

View File

@@ -0,0 +1,16 @@
{% extends 'wagtailadmin/shared/headers/slim_header.html' %}
{% load wagtailadmin_tags i18n %}
{% block breadcrumbs %}
{% page_breadcrumbs page 'wagtailadmin_explore' url_root_name='wagtailadmin_explore_root' %}
{% endblock %}
{% block actions %}
{# Page actions dropdown #}
{% page_header_buttons page user=request.user view_name="edit" %}
{% endblock %}
{% block toggles %}
{{ block.super }}
{% include "wagtailadmin/shared/page_status_tag_new.html" with page=page_for_status %}
{% endblock %}

View File

@@ -0,0 +1,141 @@
{% load wagtailadmin_tags i18n %}
{% comment "text/markdown" %}
Variables accepted by this template:
- `breadcrumbs_items` - breadcrumbs items to be rendered, in the format of [{"url": str, "label": str}]
- `buttons` - buttons to be rendered beside the final breadcrumbs item
- `side_panels` - list of side panels to be rendered
- `history_url` - URL to the history view for the current object
- `title` - title of the current page, to be displayed as a hidden h1 for screen readers
- `search_url` - URL to the search view, should respond with a partial template for the results
- `search_form` - form to be rendered for search
- `filters` - filters to be rendered
- `icon_name` - name of the icon to be used in the header
When including this template, use the `only` parameter whenever possible to
ensure that the above variables are indeed the only ones needed for this
template to work.
{% endcomment %}
{% fragment as nav_icon_classes %}w-w-4 w-h-4 group-hover:w-transform group-hover:w-scale-110{% endfragment %}
{% fragment as nav_icon_button_classes %}w-w-slim-header w-h-slim-header w-bg-transparent w-border-transparent w-box-border w-py-3 w-px-3 w-flex w-justify-center w-items-center w-outline-offset-inside w-text-text-meta w-transition w-group hover:w-text-text-label focus:w-text-text-label expanded:w-text-text-label expanded:w-border-y-2 expanded:w-border-b-current w-shrink-0{% endfragment %}
{% fragment as nav_icon_counter_classes %}-w-mr-3 w-py-0.5 w-px-[0.325rem] w-translate-y-[-8px] rtl:w-translate-x-[4px] w-translate-x-[-4px] w-text-[0.5625rem] w-font-bold w-text-text-button w-border w-border-surface-page w-rounded-[1rem]{% endfragment %}
{# Z index 99 to ensure header is always above #}
<div class="w-sticky w-top-0 w-z-header">
<header class="w-slim-header w-bg-surface-header w-border-b w-border-border-furniture w-px-0 w-py-0 w-mb-0 w-relative w-top-0 w-z-header sm:w-sticky w-min-h-slim-header">
<div class="w-flex w-flex-col sm:w-flex-row w-items-center w-justify-between">
{# Padding left on mobile to give space for navigation toggle, #}
<div class="w-pl-slim-header sm:w-pl-5 w-min-h-slim-header sm:w-pr-2 w-w-full w-flex-1 w-overflow-x-auto w-box-border">
<div class="w-flex w-flex-1 w-items-center w-overflow-hidden">
{% block header_content %}
{% block title %}
{% if title %}
{# Accessible page title as the h1 because we do not want #}
{# to put the h1 inside the breadcrumbs #}
<h1 class="w-sr-only">
{{ title }}
</h1>
{% endif %}
{% endblock %}
{% block breadcrumbs %}
{% if breadcrumbs_items %}
{% breadcrumbs breadcrumbs_items icon_name=icon_name %}
{% endif %}
{% endblock %}
{# Allow actions to be passed as a prerendered variable or defined by extending the template via block_actions #}
{% fragment stripped as actions %}
{% block actions %}
{% for button in buttons %}
{% component button %}
{% endfor %}
{% endblock %}
{% endfragment %}
{% if actions %}
{# Actions divider #}
<div class="w-w-px w-h-[30px] w-ml-auto sm:w-ml-0 w-bg-border-furniture"></div>
<div id="w-slim-header-buttons" class="w-flex w-items-center w-ml-2.5 w-gap-1">
{{ actions }}
</div>
{% endif %}
{% endblock %}
</div>
</div>
{% block search_form %}
{% if not search_url %}
{% elif search_form or filters %}
<form
action="{{ search_url }}"
method="get"
class="w-slim-header__search-form"
novalidate
role="search"
data-search-form
data-controller="w-swap"
data-action="change->w-swap#submitLazy input->w-swap#submitLazy"
data-w-swap-src-value="{{ search_url }}"
data-w-swap-target-value="#listing-results"
data-w-swap-reflect-value="true"
>
{% if search_form %}
{% for field in search_form %}
{% formattedfield field=field sr_only_label=True icon="search" %}
{% endfor %}
{% endif %}
{% if filters %}
<div
id="filters-drilldown"
class="w-drilldown"
data-controller="w-drilldown"
data-action="w-swap:success@document->w-drilldown#updateCount w-dropdown:hide->w-drilldown#delayedClose w-dropdown:clickaway->w-drilldown#preventOutletClickaway"
data-w-drilldown-count-attr-value="data-w-active-filter-id"
data-w-drilldown-w-action-outlet="[data-w-active-filter-id][data-controller='w-action']"
data-w-drilldown-w-dropdown-outlet="#filters-drilldown [data-controller='w-dropdown']"
>
{% include "wagtailadmin/shared/headers/_filters.html" with filters=filters only %}
</div>
{% endif %}
{% block extra_form_fields %}
{# Add any extra form fields here #}
{% endblock %}
{% comment %}
Add an initial disabled & hidden submit button so that
pressing 'Enter' will not submit form. Reload is not
required as the content is dynamically loaded.
{% endcomment %}
<input hidden disabled type="submit" />
</form>
{% endif %}
{% endblock %}
<div class="w-w-full w-overflow-auto sm:w-w-min w-flex sm:w-flex-nowrap sm:w-flex-row w-items-center w-p-0 sm:w-py-0 w-px-2 sm:w-pr-4 sm:w-justify-end">
{% block editing_sessions %}
{% if editing_sessions %}
{% component editing_sessions %}
{% endif %}
{% endblock %}
{% block toggles %}
{% if side_panels %}
{% include "wagtailadmin/shared/side_panel_toggles.html" %}
{% endif %}
{% if 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 %}
{% endblock %}
</div>
</div>
</header>
{% block side_panels %}
{% if side_panels %}
{% include "wagtailadmin/shared/side_panels.html" %}
{% endif %}
{% endblock %}
</div>

View File

@@ -0,0 +1,10 @@
{% load wagtailadmin_tags %}
<div class="help-block help-{{ status }}">
{% if status == 'info' %}
{% icon name='help' %}
{% else %}
{% icon name='warning' %}
{% endif %}
{{ children }}
</div>

View File

@@ -0,0 +1,10 @@
{% load wagtailadmin_tags i18n %}
<button type="button" class="w-human-readable-date" data-controller="w-tooltip" data-w-tooltip-content-value="{{ date|date:tooltip_format }}" data-w-tooltip-placement-value="{{ placement }}">
<time class="w-human-readable-date__date" datetime="{{ date|date:"c" }}">
{{ date|timesince_simple|capfirst }}
</time>
{% if description %}
<span class="w-human-readable-date__description">{{ description }}</span>
{% endif %}
</button>

View File

@@ -0,0 +1,14 @@
{% spaceless %}
{# Reference implementation: components/Icon.tsx #}
{% if wrapped %}<span class="icon-wrapper">{% endif %}
<svg class="icon icon-{{ name }} {{ classname }}" aria-hidden="true">
<use href="#icon-{{ name }}"></use>
</svg>
{% if title %}
<span class="w-sr-only">
{{ title }}
</span>
{% endif %}
{% if wrapped %}</span>{% endif %}
{# Make sure this file _doesnt_ end with a final newline. It breaks rendering. #}
{% endspaceless %}

View File

@@ -0,0 +1,9 @@
{% spaceless %}
<div style="display: none">
<svg>
<defs>
{{ icons|safe }}
</defs>
</svg>
</div>
{% endspaceless %}

View File

@@ -0,0 +1,29 @@
{% load wagtailadmin_tags i18n %}
{% dialog icon_name="keyboard" classname="w-keyboard-shortcuts" id="keyboard-shortcuts-dialog" title=_("Keyboard shortcuts") %}
<table class="w-w-full">
<caption class="w-sr-only">
{% trans "All keyboard shortcuts" %}
</caption>
<thead class="w-sr-only">
<tr>
<th scope="col">{% trans "Section" %}</th>
<th scope="col">{% trans "Keyboard shortcut" %}</th>
</tr>
</thead>
{% block shortcuts %}
{% for category, shortcuts in shortcuts.items %}
<tbody class="w-w-full" id="keyboard-shortut-group-{{ category.0 }}">
<tr class="w-keyboard-shortcuts__category" colspan="2">
<th class="w-h4" scope="rowgroup">{{ category.1 }}</th>
</tr>
{% for shortcut in shortcuts %}
<tr class="w-keyboard_shortcuts__key">
<th scope="row">{{ shortcut.0 }}</th>
<td><kbd>{{ shortcut.1 }}</kbd></td>
</tr>
{% endfor %}
</tbody>
{% endfor %}
{% endblock %}
</table>
{% enddialog %}

View File

@@ -0,0 +1,20 @@
{% load wagtailadmin_tags %}
{% fragment as locale_label %}
{% icon name="site" classname="middle" %}
{{ locale.get_display_name }}
{% endfragment %}
{% if translations %}
{% fragment as toggle_classname %}{% if theme == "large" %}button{% else %}button button-small{% endif %} {{ class }}{% endfragment %}
{% dropdown attrs="data-locale-selector" toggle_icon="arrow-down" toggle_label=locale_label classname="w-inline-block" toggle_classname=toggle_classname %}
{% for translation in translations %}
<a href="{{ translation.url }}" data-locale-selector-link>
{{ translation.locale.get_display_name }}
</a>
{% endfor %}
{% enddropdown %}
{% else %}
{{ locale_label }}
{% endif %}

View File

@@ -0,0 +1,11 @@
{{ message }}
{% if buttons %}
<span class="buttons">
{% for button in buttons %}
<a href="{{ button.0 }}" class="button button-small button-secondary"{% if button.2 %} target="_blank" rel="noreferrer"{% endif %}>{{ button.1 }}</a>
{% endfor %}
</span>
{% endif %}
{{ detail }}

View File

@@ -0,0 +1,9 @@
{% if form.non_field_errors %}
<div class="messages">
<ul>
{% for error in form.non_field_errors %}
<li class="error">{{ error }}</li>
{% endfor %}
</ul>
</div>
{% endif %}

View File

@@ -0,0 +1,13 @@
{% load wagtailcore_tags %}
{% load i18n wagtailadmin_tags %}
{% trans "Current page status:" as status_hidden_label %}
{% if page.live %}
{% pageurl page as page_url %}
{% if page_url is not None %}
{% status page.status_string url=page_url title=_("Visit the live page") hidden_label=status_hidden_label classname="w-status--primary" attrs='target="_blank" rel="noreferrer"' %}
{% else %}
{% status page.status_string hidden_label=status_hidden_label classname="w-status--primary" %}
{% endif %}
{% else %}
{% status page.status_string hidden_label=status_hidden_label %}
{% endif %}

View File

@@ -0,0 +1,51 @@
{% load i18n wagtailadmin_tags %}
{% comment %}
Variables accepted by this template:
- `page` - A wagtail page object
- `classes` - String of extra css classes to pass to this component
{% endcomment %}
{% comment %} Unable to use pageurl template tag here due to issues in unit tests where request is not yet available - see #10157 {% endcomment %}
{% if page.live and page.url is not None %}
{% test_page_is_public page as is_public %}
<a href="{{ page.url }}" target="_blank" rel="noreferrer"
class="
page-status-tag
u-text-uppercase
w-inline-flex
w-items-center
w-justify-center
w-whitespace-nowrap
w-px-1
w-ml-3
w-text-11
w-rounded-sm
w-bg-transparent
w-text-text-meta
w-border
w-border-border-furniture
w-no-underline
w-font-semibold
hover:w-border-surface-menus
hover:w-text-text-label
w-transition"
aria-label="{% if is_public %}{% trans 'Visible to all. Visit the live page' %}{% else %}{% trans 'Private. Visit the live page' %}{% endif %}"
data-controller="w-tooltip"
data-w-tooltip-content-value="{% if is_public %}{% trans 'Visible to all' %}{% else %}{% trans 'Private' %}{% endif %}"
data-w-tooltip-offset-value="[0, 13]"
>
{% with icon_classes='privacy-indicator-icon w-w-4 w-h-4 w-mr-1' %}
{% if is_public %}
{% icon name="view" classname=icon_classes %}
{% else %}
{% icon name="no-view" classname=icon_classes %}
{% endif %}
{% endwith %}
{% trans 'Live' %}
</a>
{% endif %}

View File

@@ -0,0 +1,31 @@
{% load i18n %}
{% load wagtailadmin_tags %}
{% comment %}
Expects a 'linkurl' parameter to use as the base URL, which may be a URL route name (must be
reverse-resolvable with no arguments) or a direct URL path. If omitted, links will be given
an href of the form "?p=123", implicitly preserving the current URL path.
{% endcomment %}
{% resolve_url linkurl as url_path %}
<nav class="pagination" aria-label="{% trans 'Pagination' %}">
<p>{% blocktrans trimmed with page_num=items.number total_pages=items.paginator.num_pages %}Page {{ page_num }} of {{ total_pages }}.{% endblocktrans %}</p>
<ul>
<li class="prev">
{% if items.has_previous %}
<a href="{{ url_path }}{% querystring p=items.previous_page_number %}">
{% icon name="arrow-left" classname="default" %}
{% trans 'Previous' %}
</a>
{% endif %}
</li>
<li class="next">
{% if items.has_next %}
<a href="{{ url_path }}{% querystring p=items.next_page_number %}">
{% trans 'Next' %}
{% icon name="arrow-right" classname="default" %}
</a>
{% endif %}
</li>
</ul>
</nav>

View File

@@ -0,0 +1,58 @@
{% load wagtailadmin_tags i18n %}
{% comment "text/markdown" %}
Variables this template accepts:
- `id_prefix` - A prefix for all id attributes.
- `classname` - String of CSS classes to use for the panel.
- `id` - Unique to the page.
- `heading` - The text of the panels heading.
- `heading_size` - The size of the heading.
- `heading_level` - ARIA override to the default heading level (2).
- `icon` - Displayed alongside the heading.
- `id_for_label` - id of an associated field.
- `is_required` - If the panel contains a required field.
- `children` - The panels contents.
- `header_controls` - Additional panel buttons to display in the header area.
- `attrs` - Additional HTML attributes to render on the panel.
{% endcomment %}
{% fragment as prefix %}{% if id_prefix %}{{ id_prefix }}-{% endif %}{{ id }}{% endfragment %}
{% fragment as panel_id %}{{ prefix }}-section{% endfragment %}
{% fragment as heading_id %}{{ prefix }}-heading{% endfragment %}
{% fragment as content_id %}{{ prefix }}-content{% endfragment %}
<section class="{% classnames "w-panel" classname %}" id="{{ panel_id }}" {% if heading %}aria-labelledby="{{ heading_id }}"{% endif %} data-panel {% include "wagtailadmin/shared/attrs.html" with attrs=attrs %}>
{# If a panel has no heading nor header controls, we dont want any of the associated UI. #}
{% if heading or header_controls %}
<div class="w-panel__header">
<a class="w-panel__anchor w-panel__anchor--prefix" href="#{{ panel_id }}" data-panel-anchor aria-labelledby="{{ heading_id }}">
{% icon name="link" classname="w-panel__icon" %}
</a>
<button class="w-panel__toggle" type="button" aria-label="{% trans 'Toggle section' %}" aria-describedby="{{ heading_id }}" data-panel-toggle aria-controls="{{ content_id }}" aria-expanded="true">
{% firstof icon "placeholder" as icon_name %}
{% icon name=icon_name classname="w-panel__icon" %}
</button>
{% if heading %}
<h2 class="w-panel__heading {% if heading_size == "label" %}w-panel__heading--label{% endif %}" {% if heading_level %}aria-level="{{ heading_level }}"{% endif %} id="{{ heading_id }}" data-panel-heading>
{% if id_for_label %}
<label for="{{ id_for_label }}" id="{{ id_for_label }}-label"><span data-panel-heading-text>{{ heading }}</span>{% if is_required %}<span class="w-required-mark" data-panel-required>*</span>{% endif %}</label>
{% else %}
<span data-panel-heading-text>{{ heading }}</span>{% if is_required %}<span class="w-required-mark" data-panel-required>*</span>{% endif %}
{% endif %}
</h2>
{% endif %}
<a class="w-panel__anchor w-panel__anchor--suffix" href="#{{ panel_id }}" aria-labelledby="{{ heading_id }}">
{% icon name="link" classname="w-panel__icon" %}
</a>
<div class="w-panel__divider"></div>
{% if header_controls %}
<div class="w-panel__controls" data-panel-controls>
{{ header_controls }}
</div>
{% endif %}
</div>
{% endif %}
<div id="{{ content_id }}" class="w-panel__content">
{{ children }}
</div>
</section>

View File

@@ -0,0 +1,20 @@
{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% blocktrans trimmed with title=object_display_title %}Unschedule Revision {{ revision.id }} for {{ title }}{% endblocktrans %}{% endblock %}
{% block content %}
{% include "wagtailadmin/shared/header.html" with title=_("Unschedule") subtitle=subtitle icon=header_icon %}
<div class="nice-padding">
<p>{% trans "Are you sure you want to unschedule this revision?" %}</p>
<form action="{{ revisions_unschedule_url }}" method="POST">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}">
<ul class="fields">
<li>
<input type="submit" value="{% trans 'Yes, unschedule' %}" class="button">
<a href="{{ next_url }}" class="button button-secondary">{% trans "No, don't unschedule" %}</a>
</li>
</ul>
</form>
</div>
{% endblock %}

View File

@@ -0,0 +1,4 @@
{% load wagtailadmin_tags %}
<li>
<a href="{{ url }}?q={{ query_string|urlencode }}" class="{{ classname }}{% if active %} nolink{% endif %}"{{ attr_string }}>{% if icon_name %}{% icon name=icon_name classname="filter-options__icon" %}{% endif %}{{ label }}</a>
</li>

View File

@@ -0,0 +1,7 @@
{% load i18n %}
<nav class="listing-filter" aria-labelledby="other-searches-title">
<h3 id="other-searches-title" class="filter-title">{% trans "Other searches" %}</h3>
<ul class="filter-options">
{{ options_html }}
</ul>
</nav>

View File

@@ -0,0 +1,19 @@
{% load wagtailadmin_tags %}
<button type="button"
class="{{ nav_icon_button_classes }}"
aria-label="{{ toggle.aria_label }}"
aria-expanded="false"
data-controller="w-tooltip{% if toggle.keyboard_shortcut %} w-kbd{% endif %}"
data-side-panel-toggle="{{ panel.name }}"
{% if toggle.keyboard_shortcut %}data-w-kbd-key-value="{{ toggle.keyboard_shortcut }}" data-w-kbd-scope-value="global"{% endif %}
data-w-tooltip-content-value="{{ panel.title }}"
data-w-tooltip-offset-value="[0, 0]"
>
{% icon name=toggle.icon_name classname=nav_icon_classes %}
{% if toggle.has_counter %}
<div data-side-panel-toggle-counter class="{{ nav_icon_counter_classes }} {{ toggle.counter_classname|default:'w-bg-surface-button-default'}}" {% if not count %}hidden{% endif %}>
{{ count }}
</div>
{% endif %}
</button>

View File

@@ -0,0 +1,5 @@
{% load wagtailadmin_tags %}
{% for panel in side_panels %}
{% component panel.toggle %}
{% endfor %}

View File

@@ -0,0 +1,34 @@
{% load wagtailadmin_tags i18n %}
{% if not in_explorer %}
{# Rendering for the minimap is done with React. #}
<aside aria-label="{% trans 'Minimap' %}" data-minimap-container></aside>
{% endif %}
<aside class="form-side form-side--initial" aria-label="{% trans 'Side panels' %}" data-form-side{% if in_explorer %} data-form-side-explorer{% endif %}>
<button type="button" class="form-side__close-button" data-form-side-close-button aria-label="{% trans 'Toggle side panel' %}">
{% icon name="expand-right" %}
</button>
<div class="form-side__resize-grip-container">
<label class="form-side__resize-grip" data-form-side-resize-grip>
{% comment %}
By default, the `dir` attribute is inherited from the ancestor
(i.e. the root `html` element in our case).
On Chrome and Firefox, moving the slider with left-right arrow keys
is correctly reversed when dir="rtl". On Safari, this isn't the case.
So, we explicitly set the `dir` attribute to "ltr" on the input and handle the correct
direction in the JS code based on the `dir` attribute of the root `html`.
{% endcomment %}
<input type="range" step="10" dir="ltr" class="form-side__width-input" name="wagtail-side-panel-width" data-form-side-width-input />
<span class="w-sr-only">{% trans 'Side panel width' %}</span>
<div class="form-side__resize-grip-icon"></div>
</label>
</div>
{% for panel in side_panels %}
<div class="form-side__panel" data-side-panel="{{ panel.name }}" hidden>
<h2 id="side-panel-{{ panel.name }}-title" class="w-sr-only">{{ panel.title }}</h2>
{% component panel %}
</div>
{% endfor %}
</aside>

View File

@@ -0,0 +1,44 @@
{% load i18n wagtailadmin_tags %}
<template id="w-a11y-result-row-template">
<div class="w-a11y-result__row" data-a11y-result-row>
<div>
<h3 class="w-a11y-result__header">
<span class="w-a11y-result__name" data-a11y-result-name></span>
</h3>
<div class="w-a11y-result__help" data-a11y-result-help></div>
</div>
<button
class="w-a11y-result__selector"
data-a11y-result-selector
aria-label="{% trans 'Show issue' %}"
type="button"
>
<span class="w-a11y-result__selector-text" data-a11y-result-selector-text></span>
{% icon name="link-external" classname="w-a11y-result__icon" %}
</button>
</div>
</template>
<div class="w-divide-y w-divide-border-furniture w-py-6 w-pl-2 lg:w-pl-8">
<div>
<h2 class="w-my-5 w-text-16 w-font-bold w-text-text-label">
{% trans 'Content metrics' %}
</h2>
<div class="w-flex w-gap-10">
<div>
<h3 class="w-my-2 w-text-14 w-text-text-placeholder">{% trans 'Words' %}</h3>
<p class="w-font-semibold w-text-text-label" data-content-word-count>-</p>
</div>
<div>
<h3 class="w-my-2 w-text-14 w-text-text-placeholder">{% trans 'Reading time' %}</h3>
<p class="w-font-semibold w-text-text-label" data-content-reading-time>-</p>
</div>
</div>
</div>
<div class="w-mt-3">
<h2 class="w-flex w-items-center w-gap-2 w-my-5 w-text-16 w-font-bold">
<span>{% trans 'Issues found' %}</span><span class="w-a11y-result__count" data-a11y-result-count>0</span>
</h2>
<div class="w-flex w-flex-col w-gap-2.5" data-checks-panel></div>
</div>
</div>
{{ axe_configuration|json_script:"accessibility-axe-configuration" }}

View File

@@ -0,0 +1,14 @@
{% load i18n %}
{# Comment Notifications Toggle #}
{% if form.show_comments_toggle %}
<div class="w-relative w-flex w-justify-end w-mt-1 w-ml-8" data-comment-notifications hidden>
<label class="switch w-p-0 w-m-0 w-font-normal w-flex w-justify-between w-text-14 w-space-x-2">
{% trans "Comment notifications" %}
{{ form.comment_notifications }}
<span class="switch__toggle"></span>
</label>
</div>
{% endif %}
<div id="comments"></div>

View File

@@ -0,0 +1,34 @@
{% load wagtailadmin_tags %}
<div class="w-py-6 w-space-y-3">
{% block content %}
<section class="w-flex w-space-x-3" aria-labelledby="status-sidebar-{{ title|cautious_slugify }}">
{% icon name=icon_name classname='w-w-4 w-h-4 w-text-text-label w-flex-shrink-0 w-mt-0.5' %}
<div class="w-flex w-flex-1 w-items-start w-justify-between">
<div class="w-flex w-flex-col w-flex-1 w-pr-5">
<h3 id="status-sidebar-{{ title|cautious_slugify }}" class="w-label-1 !w-mt-0 w-mb-1">
<span class="w-sr-only">{{ screen_reader_title_prefix }}</span>
{{ title }}
</h3>
{% if help_text %}
<div class="w-help-text">{{ help_text }}</div>
{% endif %}
</div>
{% block action %}
{% if not hide_action %}
<a class="w-text-14 w-text-text-link-default hover:w-text-text-link-hover w-no-underline w-transition"
href="{{ action_url }}"
aria-describedby="status-sidebar-{{ title|cautious_slugify }}"
>
{{ action_text }}
</a>
{% endif %}
{% endblock %}
</div>
</section>
{% endblock %}
{% block bottom %}
{% endblock %}
</div>

View File

@@ -0,0 +1,35 @@
{% extends 'wagtailadmin/shared/side_panels/includes/action_list_item.html' %}
{% load i18n wagtailadmin_tags %}
{% block content %}
{% trans 'Locale: ' as screen_reader_title_prefix %}
{% if object.pk and translations %}
{% blocktrans trimmed asvar help_text %}
Available in {{ translations_total }} locales
{% endblocktrans %}
{% else %}
{% trans 'No other translations' as help_text %}
{% endif %}
{% with icon_name='globe' title=locale.get_display_name %}
{{ block.super }}
{% endwith %}
{% endblock %}
{% block action %}
{% if translations %}
{% trans 'Switch locales' as toggle_label %}
{% fragment as toggle_classname %}w-text-14 w-p-0 w-text-text-link-default hover:w-text-text-link-hover w-inline-flex w-justify-center w-transition{% endfragment %}
{% dropdown toggle_label=toggle_label toggle_classname=toggle_classname toggle_icon="arrow-down" %}
{% for translation in translations %}
<a href="{{ translation.url }}" lang="{{ translation.locale.language_code }}">
{{ translation.locale.get_display_name }}
</a>
{% endfor %}
{% enddropdown %}
{% else %}
{# No locales to switch to #}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,38 @@
{% extends 'wagtailadmin/shared/side_panels/includes/action_list_item.html' %}
{% load wagtailadmin_tags i18n %}
{% block content %}
{% trans 'Locking: ' as screen_reader_title_prefix %}
{% if lock %}
{% with icon_name=lock_context.icon title=lock_context.locked_by help_text=lock_context.description %}
{{ block.super }}
{% endwith %}
{% else %}
{% trans 'Unlocked' as title %}
{% if user_can_lock %}
{% blocktrans trimmed with model_name=base_model_name|lower asvar help_text %}
Anyone can edit this {{ model_name }} lock it to prevent others from editing
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with model_name=base_model_name|lower asvar help_text %}
Anyone can edit this {{ model_name }}
{% endblocktrans %}
{% endif %}
{% with icon_name='lock-open' help_text=help_text|capfirst %}
{{ block.super }}
{% endwith %}
{% endif %}
{% endblock %}
{% block action %}
{% trans 'Lock' as lock_text %}
{% if user_can_unlock %}
{% include 'wagtailadmin/shared/action_switch.html' with data_url=unlock_url label_text=lock_text checked=True %}
{% endif %}
{% if user_can_lock %}
{% include 'wagtailadmin/shared/action_switch.html' with data_url=lock_url label_text=lock_text checked=False %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,39 @@
{% extends 'wagtailadmin/shared/side_panels/includes/action_list_item.html' %}
{% load i18n wagtailadmin_tags %}
{% block content %}
{% test_page_is_public page as is_public %}
{# The swap between public and private text is done using JS inside of privacy-switch.js when the response from the modal comes back #}
<div class="{% if not is_public %}w-hidden{% endif %}" data-privacy-sidebar-public>
{% trans 'Page visibility: ' as screen_reader_title_prefix %}
{% trans 'Visible to all' as title %}
{% trans 'Once live anyone can view' as help_text %}
{% with icon_name='view' %}
{{ block.super }}
{% endwith %}
</div>
<div class="{% if is_public %}w-hidden{% endif %}" data-privacy-sidebar-private>
{% trans 'Private' as title %}
{% trans 'Not visible to the public' as help_text %}
{% with icon_name='no-view' %}
{{ block.super }}
{% endwith %}
</div>
{% trans 'Change privacy' as set_privacy_title %}
{% trans 'Choose who can view the live version of this page' as set_privacy_message %}
{% trans 'Privacy changes apply to all children of this page too.' as privacy_message_text %}
{% url 'wagtailadmin_pages:set_privacy' page.id as privacy_url %}
{% dialog icon_name='view' id='set-privacy' data_url=privacy_url title=set_privacy_title subtitle=set_privacy_message message_status='warning' message_heading=privacy_message_text %}
{% enddialog %}
{% endblock %}
{% block action %}
{% page_permissions page as page_perms %}
{% if page.id and page_perms.can_set_view_restrictions %}
{% trans 'Change privacy' as set_privacy_title %}
{% dialog_toggle classname='w-bg-transparent w-text-14 w-p-0 w-text-text-link-default hover:w-text-text-link-hover w-inline-flex w-justify-center w-transition' dialog_id='set-privacy' text=set_privacy_title %}
{% else %}
{# Empty actions block because of lack of permissions #}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,21 @@
{% load i18n %}
<div class="w-py-6 w-space-y-3">
<section class="w-flex w-space-x-3">
<div class="w-flex w-flex-1">
<div class="w-flex w-flex-col w-flex-1 w-pr-5">
<h3 class="w-label-1 !w-mt-0 w-mb-1">
{% trans "Usage" %}
</h3>
</div>
<a class="w-text-14 w-text-text-link-default hover:w-text-text-link-hover w-no-underline w-transition"
href="{{ usage_url }}"
>
{% if usage_url_text %}
{{ usage_url_text }}
{% else %}
{% blocktrans trimmed count usage_count=usage_count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}
{% endif %}
</a>
</div>
</section>
</div>

View File

@@ -0,0 +1,172 @@
{% extends 'wagtailadmin/shared/side_panels/includes/action_list_item.html' %}
{% load wagtailadmin_tags i18n %}
{% comment %}
This template is used to show Live, Draft, Live and Draft, In Moderation or Live and In Moderation.
Sometimes {{ block.super }} will be called two times in the instances where the object is in multiple states e.g. Live + Draft
{% endcomment %}
{% block content %}
{% if object.pk %}
<div class="w-space-y-3">
{% trans 'Status: ' as screen_reader_title_prefix %}
{% with workflow_state=object.current_workflow_state draft_revision=object.get_latest_revision live_revision=object.live_revision %}
{# Live section #}
{% if not draftstate_enabled or object.live %}
{% trans 'Live' as title %}
{% if live_revision %}
{% timesince_last_update live_revision.created_at user_display_name=live_revision.user|user_display_name use_shorthand=True as help_text %}
{% elif last_updated_info %}
{% timesince_last_update last_updated_info.timestamp user_display_name=last_updated_info.user_display_name use_shorthand=True as help_text %}
{% endif %}
{% with icon_name='doc-full-inverse' %}
{% if object.has_unpublished_changes or workflow_state %}
{% with hide_action=True %}
{{ block.super }}
{% endwith %}
{% else %}
{{ block.super }}
{% endif %}
{% endwith %}
{% if has_live_publishing_schedule %}
<div class="w-p-4 w-bg-info-50 w-rounded w-flex w-space-x-3 w-border w-border-transparent">
{% icon name='calendar-check' classname='w-w-4 w-h-4 w-text-info-100' %}
<div class="w-flex w-flex-1 w-items-start w-justify-between">
<div class="w-flex w-flex-col w-flex-1 w-pr-5 w-space-y-1 w-help-text w-text-grey-400">
<div>
<span class="w-text-grey-600">{% trans 'Expiry:' %}</span>
{{ live_expire_at }}
</div>
</div>
{% if show_schedule_publishing_toggle and not has_draft_publishing_schedule and not lock_context.locked %}
{% trans 'Edit schedule' as edit_schedule_text %}
{% dialog_toggle classname='w-bg-transparent w-text-14 w-p-0 w-text-secondary-600 hover:w-text-secondary-400 w-inline-flex w-justify-center w-transition' dialog_id="schedule-publishing-dialog" text=edit_schedule_text %}
{% endif %}
</div>
</div>
{% endif %}
{% endif %}
{# Draft and In moderation settings #}
{% if workflow_state %}
{# In Moderation Settings #}
{% trans 'In Moderation' as title %}
{% if workflow_state.created_at %}
{% timesince_last_update workflow_state.created_at user_display_name=workflow_state.requested_by|user_display_name use_shorthand=True as help_text %}
{% endif %}
{% trans 'View details' as action_text %}
{# Icon #}
{% with icon_name='draft' hide_action=False %}
{{ block.super }}
{% endwith %}
{# Draft Settings #}
{% elif object.has_unpublished_changes %}
{% trans 'Draft' as title %}
{% if draft_revision.created_at %}
{% timesince_last_update draft_revision.created_at user_display_name=draft_revision.user|user_display_name use_shorthand=True as help_text %}
{% endif %}
{# Icon #}
{% with icon_name='draft' %}
{{ block.super }}
{% endwith %}
{% endif %}
{% endwith %}
</div>
{% endif %}
{% endblock %}
{% block action %}
{% if workflow_state and not hide_action %}
{% dialog_toggle classname='w-bg-transparent w-text-14 w-p-0 w-text-text-link-default hover:w-text-text-link-hover w-inline-flex w-justify-center w-transition' dialog_id="workflow-status-dialog" text=action_text %}
{# info subtitle #}
{% if object.get_latest_revision %}
{% workflow_status_with_date workflow_state as message_heading %}
{% if workflow_state.requested_by %}
{% blocktrans trimmed with user=workflow_state.requested_by|user_display_name asvar modified_by %}by {{ user }}{% endblocktrans %}
{% endif %}
{% dialog id="workflow-status-dialog" icon_name="list-ul" title=workflow_state.workflow.name message_status='info' message_heading=message_heading|add:' '|add:modified_by %}
{% include 'wagtailadmin/workflows/workflow_status.html' %}
{% enddialog %}
{% else %}
{% dialog id="workflow-status-dialog" icon_name="list-ul" title=workflow_state.workflow.name %}
{% include 'wagtailadmin/workflows/workflow_status.html' %}
{% enddialog %}
{% endif %}
{% elif history_url %}
{% with action_url=history_url %}
{% trans 'View history' as action_text %}
{{ block.super }}
{% endwith %}
{% endif %}
{% endblock %}
{% block bottom %}
{# Workflow Status #}
{% with workflow_state=object.current_workflow_state draft_revision=object.get_latest_revision %}
{% if workflow_state %}
<div class="w-flex w-space-x-4">
{% icon name='info-circle' classname='w-w-4 w-h-4 w-text-info-100 w-shrink-0' %}
<div class="w-label-3 w-flex-1">
{% workflow_status_with_date workflow_state %}
</div>
</div>
{% endif %}
{# Scheduled publishing #}
{% if has_draft_publishing_schedule or schedule_has_errors %}
<div class="w-p-4 w-rounded w-flex w-space-x-3 w-border w-border-transparent {% if schedule_has_errors %}w-bg-critical-50{% else %}w-bg-info-50{% endif %}">
{% if schedule_has_errors %}
{% icon name='warning' classname='w-w-4 w-h-4 w-text-critical-100' %}
{% elif scheduled_go_live_at or scheduled_expire_at %}
{% icon name='calendar-check' classname='w-w-4 w-h-4 w-text-info-100' %}
{% else %}
{% icon name='calendar' classname='w-w-4 w-h-4 w-text-info-100' %}
{% endif %}
<div class="w-flex w-flex-1 w-items-start w-justify-between">
<div class="w-flex w-flex-col w-flex-1 w-pr-5 w-space-y-1 w-help-text w-text-grey-400">
{% if schedule_has_errors %}
<div class="w-label-3 w-text-primary">{% trans 'Invalid schedule' %}</div>
{% else %}
{% if scheduled_go_live_at %}
<div><span class="w-text-grey-600">{% trans 'Go-live:' %}</span> {{ scheduled_go_live_at }}</div>
{% endif %}
{% if scheduled_expire_at %}
<div><span class="w-text-grey-600">{% trans 'Expiry:' %}</span> {{ scheduled_expire_at }}</div>
{% endif %}
{% if draft_go_live_at or draft_expire_at %}
<div class="w-label-3 w-text-primary">{% trans 'Once published:' %}</div>
{% if draft_go_live_at %}
<div><span class="w-text-grey-600">{% trans 'Go-live:' %}</span> {{ draft_go_live_at }}</div>
{% endif %}
{% if draft_expire_at %}
<div><span class="w-text-grey-600">{% trans 'Expiry:' %}</span> {{ draft_expire_at }}</div>
{% endif %}
{% endif %}
{% endif %}
</div>
{% if show_schedule_publishing_toggle and not lock_context.locked %}
{% trans 'Edit schedule' as edit_schedule_text %}
{% dialog_toggle classname='w-bg-transparent w-text-14 w-p-0 w-text-secondary-600 hover:w-text-secondary-400 w-inline-flex w-justify-center w-transition' dialog_id="schedule-publishing-dialog" text=edit_schedule_text %}
{% endif %}
</div>
</div>
{% elif draftstate_enabled and not has_live_publishing_schedule %}
<div class="w-flex w-justify-between w-items-center w-w-full">
<div class="w-ml-8 w-pr-4 w-label-3">{% trans 'No publishing schedule set' %}</div>
{% if show_schedule_publishing_toggle and not lock_context.locked %}
{% trans 'Set schedule' as set_schedule_text %}
{% dialog_toggle classname='w-bg-transparent w-text-14 w-p-0 w-text-text-link-default hover:w-text-text-link-hover w-inline-flex w-justify-center w-transition' dialog_id="schedule-publishing-dialog" text=set_schedule_text %}
{% endif %}
</div>
{% endif %}
{% endwith %}
{% endblock %}

View File

@@ -0,0 +1,64 @@
{% load i18n wagtailadmin_tags %}
{% wagtail_config as settings %}
<div class="preview-panel preview-panel--mobile" data-preview-panel data-action="{{ preview_url }}">
<div class="preview-panel__sizes">
<label class="preview-panel__size-button preview-panel__size-button--mobile">
{% icon name="mobile-alt" %}
<input type="radio" name="preview-size" value="mobile" data-device-width="375" data-default-size checked aria-label="{% trans 'Preview in mobile size' %}" />
</label>
<label class="preview-panel__size-button preview-panel__size-button--tablet">
{% icon name="tablet-alt" %}
<input type="radio" name="preview-size" value="tablet" data-device-width="768" aria-label="{% trans 'Preview in tablet size' %}" />
</label>
<label class="preview-panel__size-button preview-panel__size-button--desktop">
{% icon name="desktop" %}
<input type="radio" name="preview-size" value="desktop" data-device-width="1280" aria-label="{% trans 'Preview in desktop size' %}" />
</label>
<a href="{{ preview_url }}?mode={{ object.default_preview_mode|urlencode }}" target="_blank" rel="noreferrer" class="preview-panel__size-button preview-panel__size-button--new-tab" data-preview-new-tab aria-label="{% trans 'Preview in new tab' %}">{% icon name="link-external" %}</a>
</div>
<div class="preview-panel__spinner w-hidden" data-preview-spinner>
{% icon name="spinner" classname="default" %}
<span class="w-sr-only">{% trans 'Loading'%}</span>
</div>
{% if not settings.WAGTAIL_AUTO_UPDATE_PREVIEW %}
<button class="button button-small button-secondary button--icon preview-panel__refresh-button" data-refresh-preview>{% icon name="rotate" %} Refresh</button>
{% endif %}
<div class="preview-panel__area">
<div class="preview-panel__controls{% if has_multiple_modes %} preview-panel__controls--multiple{% endif %}">
<div id="preview-panel-error-banner" class="preview-panel__error-banner">
{% icon name='warning' classname='default' %}
<div>
<h3 class="preview-panel__error-title">
{% trans 'Preview is out of date' %}
</h3>
<p class="preview-panel__error-details">
{% trans 'Correct the validation errors to resume preview (saving will highlight errors)' %}
</p>
</div>
</div>
{% if has_multiple_modes %}
{% rawformattedfield label_text=_("Preview mode") id_for_label="id_preview_mode" classname="preview-panel__modes" %}
<select id="id_preview_mode" name="preview_mode" class="preview-panel__mode-select" data-preview-mode-select>
{% for internal_name, display_name in object.preview_modes %}
<option value="{{ internal_name }}"{% if internal_name == object.default_preview_mode %} selected{% endif %}>{{ display_name }}</option>
{% endfor %}
</select>
{% endrawformattedfield %}
{% endif %}
</div>
<div class="preview-panel__wrapper">
<iframe id="preview-iframe" loading="lazy" title="{% trans 'Preview' %}" class="preview-panel__iframe" data-preview-iframe aria-describedby="preview-panel-error-banner">
<div>
{# Add placeholder element to support styling content when iframe has loaded #}
</div>
</iframe>
</div>
</div>
</div>

View File

@@ -0,0 +1,23 @@
{% load wagtailadmin_tags i18n %}
<div class="w-divide-y w-divide-border-furniture w-py-6 w-pl-2 lg:w-pl-8">
{% for template in status_templates %}
{% include template %}
{% endfor %}
{# Object type / First Published information #}
<div class="w-pt-5 w-space-y-1">
<div class="w-label-3">
<strong>{{ model_name }}</strong>
{% if model_description %}
({{ model_description }})
{% endif %}
</div>
{% if object.first_published_at %}
<div class="w-help-text">
{% trans 'First published' %} {% human_readable_date object.first_published_at placement="bottom" %}
</div>
{% endif %}
</div>
</div>

View File

@@ -0,0 +1,15 @@
{% load wagtailadmin_tags %}
{% if url %}
<a href="{{ url }}" class="{% classnames 'w-status' classname %}"{% if title %} title="{{ title }}" {% endif %}{% if attrs %} {{ attrs }}{% endif %}>
{% if hidden_label %}
<span class="w-sr-only">{{ hidden_label }}</span> {% if label %}{{ label }}{% endif %}
{% else %}
{% if label %}{{ label }}{% endif %}
{% endif %}
</a>
{% else %}
<span class="{% classnames 'w-status' classname %}"{% if attrs %} {{ attrs }}{% endif %}>
{% if hidden_label %}<span class="w-sr-only">{{ hidden_label }}</span>{% endif %}
{% if label %}{{ label }}{% endif %}
</span>
{% endif %}

View File

@@ -0,0 +1,18 @@
{% load i18n %}
{% comment "text/markdown" %}
Variables accepted by this template:
- `tab_id` - {string} A unique tab id consisting only of ASCII alphanumerics, dashes and underscores
- `title` - {string} Text that the tab button will display
- `active` - {boolean?} Force this to be active
- `classname` - {string?} Extra css classes to pass to this component
{% endcomment %}
<a id="tab-label-{{ tab_id }}" href="#tab-{{ tab_id }}" class="w-tabs__tab {{ classname }}" role="tab" aria-selected="false" tabindex="-1">
{{ title }}
<div class="w-tabs__errors" data-controller="w-count" data-w-count-active-class="!w-flex" data-w-count-container-value="#tab-{{ tab_id }}">
<span aria-hidden="true" data-w-count-target="total"></span>
<span class="w-sr-only">(<span data-w-count-target="label"></span>)</span>
</div>
</a>

View File

@@ -0,0 +1,28 @@
{% load i18n %}
{% comment "text/markdown" %}
This shared template is used to display the usage count for an object as a link
to the object's usage page. It is used by the admin's delete and unpublish views.
Variables this template accepts:
- `model_opts`: the model's options
- `usage_url`: the URL to the object's usage page
- `usage_count`: the number of times the object is used
- `is_protected` (optional): whether the object is protected from deletion
{% endcomment %}
<p>
<a href="{{ usage_url }}">
{% blocktrans trimmed with model_name=model_opts.verbose_name count usage_count=usage_count asvar usage_message %}
This {{ model_name }} is referenced {{ usage_count }} time.
{% plural %}
This {{ model_name }} is referenced {{ usage_count }} times.
{% endblocktrans %}
{# Use capfirst in case the translated message starts with {{ model_name }}. #}
{{ usage_message|capfirst }}
</a>
{% if is_protected %}
{% blocktrans trimmed with model_name=model_opts.verbose_name asvar protected_message %}
One or more references to this {{ model_name }} prevent it from being deleted.
{% endblocktrans %}
{{ protected_message|capfirst }}
{% endif %}
</p>

View File

@@ -0,0 +1,5 @@
{% load wagtailadmin_tags %}
{% avatar user=user size="small" %}
{% if not username %}{{ user }}{% else %}{{ username }}{% endif %}

View File

@@ -0,0 +1,29 @@
{% load i18n wagtailadmin_tags %}
{% include "wagtailadmin/shared/header.html" with title=action_verbose icon="clipboard-list" %}
<div class="nice-padding">
{% include "wagtailadmin/shared/non_field_errors.html" %}
<form action="{{ submit_url }}" method="POST" novalidate>
{% csrf_token %}
<ul class="fields">
{% for field in form %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% formattedfield field %}
{% endif %}
{% endfor %}
<li>
<button
type="submit"
class="button button-longrunning"
data-controller="w-progress"
data-action="w-progress#activate"
>
{% icon name="spinner" %}{{ action_verbose }}
</button>
</li>
</ul>
</form>
</div>

View File

@@ -0,0 +1,146 @@
{% extends "wagtailadmin/generic/base.html" %}
{% load i18n wagtailadmin_tags %}
{% block main_content %}
<h2>{% icon object_icon classname="initial" %} {% latest_str object %}</h2>
<p>
<a href="{% admin_edit_url object %}" class="button button-small button-secondary">{% trans "Edit / Review" %}</a>
<a href="{% url workflow_history_url_name object.pk|admin_urlquote %}" class="button button-small button-secondary">{% trans "Workflow history" %}</a>
</p>
<h2>{% icon "clipboard-list" classname="initial" %} {{ workflow_state.workflow.name }}</h2>
<p>
{% blocktrans trimmed with modified_by=workflow_state.requested_by|user_display_name %}Requested by <b>{{ modified_by }}</b>{% endblocktrans %}
{% avatar user=workflow_state.requested_by size="small" %}
</p>
<p>
{% blocktrans trimmed with workflow_state.created_at as started_at %}Started at <b>{{ started_at }}</b>{% endblocktrans %}
</p>
<p>
{% fragment as status_tag_variable %}{% status workflow_state.get_status_display classname="w-status--primary" %}{% endfragment %}
{% blocktrans trimmed with status_tag_variable as status %}Status {{ status }}{% endblocktrans %}
</p>
<div class="w-tabs" data-tabs>
<div class="w-tabs__wrapper">
<div role="tablist" class="w-tabs__list ">
{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with tab_id="tasks" title=_("Tasks") %}
{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with tab_id="timeline" title=_("Timeline") %}
</div>
</div>
<div class="tab-content">
<section id="tab-tasks" role="tabpanel" data-tab="tasks" aria-labelledby="tab-label-tasks" hidden>
<table class="workflow-progress-table workflow-progress-table--tasks">
<colgroup width="20%"></colgroup>
{% for task in tasks %}
<colgroup width="{% widthratio 80 tasks|length 1 %}%"></colgroup>
{% endfor %}
<thead>
<th class="workflow-progress-table__left-column"></th>
{% for task in tasks %}
<th>{{ task }}</th>
{% endfor %}
</thead>
<tbody>
{% for revision, task_states in task_states_by_revision %}
<tr>
<td class="workflow-progress-table__left-column">
{% if forloop.first %}
{% trans "Initial Revision" %}
{% else %}
{% if not forloop.first %}
{% trans "Edited" as action %}
{% if revision.user %}
{% blocktrans trimmed with '<b>'|add:action|add:'</b>' as action and revision.user|user_display_name as who and revision.created_at as at %}
{{ action }} by <b>{{ who }}</b> at <b>{{ at }}</b>
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with '<b>'|add:action|add:'</b>' as action and revision.created_at as at %}
{{ action }} at <b>{{ at }}</b>
{% endblocktrans %}
{% endif %}
{% endif %}
{% endif %}
</td>
{% for task_state in task_states %}
<td>
{% if task_state.status == 'approved' or task_state.status == 'rejected' %}
{% fragment as status_action %}{% status task_state.get_status_display classname="w-status--primary" %}{% endfragment %}
{% if task_state.finished_by %}
{% blocktrans trimmed with action=status_action|safe who=task_state.finished_by|user_display_name at=task_state.finished_at %}
{{ action }} by <b>{{ who }}</b> at <b>{{ at }}</b>
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with action=status_action|safe at=task_state.finished_at %}
{{ action }} at <b>{{ at }}</b>
{% endblocktrans %}
{% endif %}
{% else %}
{% status task_state.get_status_display classname="w-status--primary" %}
{% endif %}
{% if task_state.get_comment %}
<p>{% trans 'with comment:' %} <b>"{{ task_state.get_comment }}"</b></p>
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</section>
<section id="tab-timeline" role="tabpanel" data-tab="timeline" aria-labelledby="tab-label-timeline" hidden>
<table class="workflow-progress-table workflow-progress-table--timeline">
<colgroup width="20%"></colgroup>
<colgroup width="80%"></colgroup>
<tbody>
{% for timeline_item in timeline %}
<tr>
<td class="workflow-progress-table__left-column">
{{ timeline_item.time }}
</td>
<td>
{% if timeline_item.action == 'workflow_started' %}
<b>{% trans "Workflow started" %}</b>
{% elif timeline_item.action == 'workflow_completed' %}
<b>{% trans "Workflow completed" %}</b>
{% status timeline_item.workflow_state.get_status_display classname="w-status--primary" %}
{% elif timeline_item.action == 'edited' %}
{% trans "Edited" as action %}
{% if revision.user %}
{% blocktrans trimmed with '<b>'|add:action|add:'</b>' as action and timeline_item.revision.user|user_display_name as who %}
{{ action }} by <b>{{ who }}</b>
{% endblocktrans %}
{% else %}
<b>{{ action }}</b>
{% endif %}
{% elif timeline_item.action == 'task_completed' %}
<b>{{ timeline_item.task_state.task }}</b>
{% if timeline_item.task_state.finished_by %}
{% fragment as status_action %}{% status timeline_item.task_state.get_status_display classname="w-status--primary" %}{% endfragment %}
{% blocktrans trimmed with action=status_action|safe who=timeline_item.task_state.finished_by|user_display_name %}
{{ action }} by <b>{{ who }}</b>
{% endblocktrans %}
{% else %}
{% status timeline_item.task_state.get_status_display classname="w-status--primary" %}
{% endif %}
{% if timeline_item.task_state.specific.get_comment %}
{% trans 'with comment:' %} <b>"{{ timeline_item.task_state.specific.get_comment }}"</b>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,17 @@
{% extends "wagtailadmin/base.html" %}
{% load i18n wagtailadmin_tags %}
{% block titletag %}{% latest_str object as object_str %}{% blocktrans trimmed with title=object_str %}Workflow history for {{ title }}{% endblocktrans %}{% endblock %}
{% block content %}
{% latest_str object as object_str %}
{% include "wagtailadmin/shared/header.html" with title=_("Workflow history for") subtitle=object_str icon=header_icon %}
<div class="nice-padding">
<p style="margin-bottom: 30px;">
<a href="{% admin_edit_url object %}" class="button button-small button-secondary">{% trans "Edit" %}</a>
</p>
{% include "wagtailadmin/shared/workflow_history/results.html" %}
</div>
{% endblock %}

View File

@@ -0,0 +1,65 @@
{% load i18n wagtailadmin_tags %}
{% load l10n %}
<table class="listing">
<thead>
<tr>
<th>
{% trans 'Status' %}
</th>
<th>
{% trans 'Tasks' %}
</th>
<th>
{% trans 'Requested by' %}
</th>
<th>
{% trans 'Started at' %}
</th>
</tr>
</thead>
<tbody>
{% if workflow_states %}
{% for workflow_state in workflow_states %}
<tr>
<td>
{% url workflow_history_detail_url_name object.pk|admin_urlquote workflow_state.id as status_url %}
{% status workflow_state.get_status_display url=status_url classname="w-status--primary" %}
</td>
<td class="title">
<h2>
<a href="{% url workflow_history_detail_url_name object.pk|admin_urlquote workflow_state.id %}">
{{ workflow_state.workflow.name }}
</a>
</h2>
{% for task in workflow_state.all_tasks_with_status %}
<span tabindex="0" data-controller="w-tooltip" data-w-tooltip-content-value="{{ task.name }}: {{ task.status_display }}">
{% if task.status == 'approved' %}
{% icon "success" title=_("Approved task") classname="initial" %}
{% else %}
{% icon "radio-empty" title=_("Incomplete task") classname="initial" %}
{% endif %}
</span>
{% endfor %}
</td>
<td>{{ workflow_state.requested_by|user_display_name }}</td>
<td>{% human_readable_date workflow_state.created_at %}</td>
</tr>
{% endfor %}
{% else %}
{% block no_results %}
<tr><td class="no-results-message">
<p>
{% if page %}
{% trans "This page hasn't been submitted for moderation yet" %}
{% else %}
{% blocktrans trimmed with model_name=model_opts.verbose_name %}
This {{ model_name }} hasn't been submitted for moderation yet
{% endblocktrans %}
{% endif %}
</p>
</td></tr>
{% endblock %}
{% endif %}
</tbody>
</table>

View File

@@ -0,0 +1,17 @@
{% load i18n wagtailadmin_tags %}
{% if workflow_states %}
{% include "wagtailadmin/shared/workflow_history/list.html" %}
{% include "wagtailadmin/shared/pagination_nav.html" with items=workflow_states linkurl=workflow_history_url_name %}
{% else %}
<p>
{% if page %}
{% blocktrans trimmed %}This page hasn't been submitted for moderation yet{% endblocktrans %}
{% else %}
{% blocktrans trimmed with model_name=model_opts.verbose_name %}
This {{ model_name }} hasn't been submitted for moderation yet
{% endblocktrans %}
{% endif %}
</p>
{% endif %}