diff --git a/AUTHORS.rst b/AUTHORS.rst index 49d1d90d..16602a25 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -146,6 +146,7 @@ Authors - `DanialErfanian `_ - `Sridhar Marella `_ - `Mattia Fantoni `_ +- `Trent Holliday `_ Background ========== diff --git a/CHANGES.rst b/CHANGES.rst index 95da1b52..a03ffd47 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,6 +13,8 @@ Unreleased - Dropped support for Python 3.8, which reached end-of-life on 2024-10-07 (gh-1421) - Added support for Django 5.1 (gh-1388) - Added pagination to ``SimpleHistoryAdmin`` (gh-1277) +- Fixed issue with history button not working when viewing historical entries in the + admin (gh-527) 3.7.0 (2024-05-29) ------------------ diff --git a/simple_history/templates/simple_history/object_history_form.html b/simple_history/templates/simple_history/object_history_form.html index e6fca0e2..84784c54 100644 --- a/simple_history/templates/simple_history/object_history_form.html +++ b/simple_history/templates/simple_history/object_history_form.html @@ -1,5 +1,5 @@ {% extends "admin/change_form.html" %} -{% load i18n %} +{% load i18n admin_urls %} {% load url from simple_history_compat %} {% block breadcrumbs %} @@ -21,6 +21,14 @@ {% include "simple_history/submit_line.html" %} {% endblock %} +{% block object-tools-items %} +{# We override this block from the django template to fix up the history link #} +
  • + {% translate "History" %} +
  • +{% if has_absolute_url %}
  • {% translate "View on site" %}
  • {% endif %} +{% endblock %} + {% block form_top %}

    {% if not revert_disabled %}{% blocktrans %}Press the 'Revert' button below to revert to this version of the object.{% endblocktrans %}{% endif %}{% if change_history %}{% blocktrans %}Press the 'Change History' button below to edit the history.{% endblocktrans %}{% endif %}

    {% endblock %}