From 6a9e0f3b096b52ee65eafef51f6d59596e7075c5 Mon Sep 17 00:00:00 2001 From: Trent Date: Fri, 4 Oct 2024 14:51:25 -0400 Subject: [PATCH] #527 Fixes issue where the history button doesn't work when viewing a historical entry --- .../templates/simple_history/object_history_form.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/simple_history/templates/simple_history/object_history_form.html b/simple_history/templates/simple_history/object_history_form.html index e6fca0e2a..84784c545 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 %}