diff --git a/docs/releases/5.1.md b/docs/releases/5.1.md index a55308c21b..c3b6af0c1f 100644 --- a/docs/releases/5.1.md +++ b/docs/releases/5.1.md @@ -244,6 +244,25 @@ This will be different to the previous ordering which never intentionally implem This default ordering is now `["content_type__app_label", "content_type__model", "codename"]`, which can now be customised [](customising_group_views_permissions_order). +### Shared include `wagtailadmin/shared/last_updated.html` is no longer available + +The undocumented shared include `wagtailadmin/shared/last_updated.html` is no longer available as it used the legacy Bootstrap tooltips and was not accessible. If you need to achieve a similar output, an element that shows a simple date with a tooltip for the full date, use the `human_readable_date` template tag instead. + +**Before** + +```html+django +{% include "wagtailadmin/shared/last_updated.html" with last_updated=my_model.timestamp %} +``` + +**After** + +```html+django +{% load wagtailadmin_tags %} + + +{% human_readable_date my_model.timestamp %} +``` + ### Tag (Tagit) field usage now relies on data attributes The `AdminTagWidget` widget has now been migrated to a Stimulus controller, if using this widget in Python, no changes are needed to adopt the new approach. diff --git a/wagtail/admin/templates/wagtailadmin/shared/last_updated.html b/wagtail/admin/templates/wagtailadmin/shared/last_updated.html deleted file mode 100644 index 17e6dfa4cc..0000000000 --- a/wagtail/admin/templates/wagtailadmin/shared/last_updated.html +++ /dev/null @@ -1,6 +0,0 @@ -{% load i18n wagtailadmin_tags %} -{% if last_updated %} - - {% if since_text %}{{ since_text }}{% endif %} {% timesince_last_update last_updated show_time_prefix=show_time_prefix %} - -{% endif %} diff --git a/wagtail/contrib/modeladmin/templates/modeladmin/includes/header_with_history.html b/wagtail/contrib/modeladmin/templates/modeladmin/includes/header_with_history.html index f7f4f64b43..72dd45dd30 100644 --- a/wagtail/contrib/modeladmin/templates/modeladmin/includes/header_with_history.html +++ b/wagtail/contrib/modeladmin/templates/modeladmin/includes/header_with_history.html @@ -8,7 +8,7 @@
  • {% avatar user=latest_log_entry.user size="small" tooltip=latest_log_entry.user_display_name %} {% trans "Last updated" %} - {% include "wagtailadmin/shared/last_updated.html" with last_updated=latest_log_entry.timestamp show_time_prefix=True %} + {% human_readable_date latest_log_entry.timestamp %}
  • {% if history_url %}
  • {% icon "history" classname="default" %} {% trans "History" %}
  • diff --git a/wagtail/snippets/templates/wagtailsnippets/snippets/_header_with_history.html b/wagtail/snippets/templates/wagtailsnippets/snippets/_header_with_history.html index 3880cab268..c0b2cc36fc 100644 --- a/wagtail/snippets/templates/wagtailsnippets/snippets/_header_with_history.html +++ b/wagtail/snippets/templates/wagtailsnippets/snippets/_header_with_history.html @@ -8,7 +8,7 @@
  • {% avatar user=latest_log_entry.user size="small" tooltip=latest_log_entry.user_display_name %} {% trans "Last updated" %} - {% include "wagtailadmin/shared/last_updated.html" with last_updated=latest_log_entry.timestamp show_time_prefix=True %} + {% human_readable_date date=latest_log_entry.timestamp %}
  • {% if history_url %}
  • {% icon "history" classname="default" %} {% trans "History" %}