Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object tools showing compare_links_partial.html are duplicated #255

Open
florianm opened this issue Oct 25, 2024 · 0 comments
Open

Object tools showing compare_links_partial.html are duplicated #255

florianm opened this issue Oct 25, 2024 · 0 comments

Comments

@florianm
Copy link

florianm commented Oct 25, 2024

image
Using django-grappelli (not sure that's related) I can see duplicated object tools from reversion_compare/templates/reversion-compare/compare_links_partial.html (the previous and next links) in both the header and the main content.

From all templates referencing compare_links_partial.html as per
https://github.com/search?q=repo%3Ajedie%2Fdjango-reversion-compare%20reversion-compare%2Fcompare_links_partial.html&type=code
I can only see compare.html used in the screenshot shown above. I'm puzzled where the second object tools are invoked here.

This is just a mild inconvenience I can fix by overriding the template of compare.py.

I can fix the duplication by moving the object-tools block in compare.html out of the content block:

{% block object-tools %}
   <ul class="object-tools">
     {% block object-tools-items %}
       {% include "reversion-compare/compare_links_partial.html"  %}
     {% endblock %}
   </ul>
{% endblock %}

{% block content %}
    <div id="content-main">

        <p class="help">
            {% blocktrans with date1=version1.revision.date_created|date:_("DATETIME_FORMAT") date2=version2.revision.date_created|date:_("DATETIME_FORMAT") %}
                Compare <strong>{{ date1 }}</strong> with <strong>{{ date2 }}</strong>:
            {% endblocktrans %}
        </p>

        {% include "reversion-compare/compare_partial.html" %}

        &lsaquo; <a href="{{ history_url }}">{% trans "Go back to history list" %}</a>
        &vert;
        <a href="{{ save_url }}">{% trans "Revert to this version" %}</a> &rsaquo;
    </div>
{% endblock %}

Now the admin looks like this:
image
Unrelated, I've removed the duplicated actions above compare_partial.

Does anyone else see this duplication of the content tools block?

@florianm florianm changed the title Object tools are duplicated Object tools showing compare_links_partial.html are duplicated Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant