-
Notifications
You must be signed in to change notification settings - Fork 21
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
support for grappelli #4
Comments
I was able to fix most of the styling issues by overriding the templates in case someone wants a quick fix:
<div>
...
{% include 'admin/tabular_paginator.html' %}
</div>
{% load i18n static %}
<div class="grp-module">
<div class="grp-row">
{% spaceless %}
{% with inline_admin_formset.formset.page as page_obj %}
<nav class="grp-pagination">
<header style="display:none"><h1>Pagination</h1></header>
<ul>
{% if page_obj.has_previous %}
<li><a href="?page={{ page_obj.previous_page_number }}">{% trans 'previous' %}</a></li>
{% endif %}
{% if page_obj.number|add:"-5" > 0 %}
<li><a class="btn-page page-available" href="?page=0">1</a></li>
{% endif %}
{% if page_obj.number|add:"-5" > 1 %}
<li class="grp-separator"><span>...</span></li>
{% endif %}
{% for page_num in page_obj.paginator.page_range %}
{% if page_obj.number == page_num %}
<li><span class="btn-page page-selected">{{ page_num }}</span></li>
{% else %}
{% if page_num > page_obj.number|add:"-5" and page_num < page_obj.number|add:"5" %}
<li><a class="btn-page page-available" href="?page={{ page_num }}">{{ page_num }}</a></li>
{% endif %}
{% endif %}
{% endfor %}
{% if page_obj.number|add:"5" < page_obj.paginator.num_pages %}
<li class="grp-separator"><span>...</span></li>
{% endif %}
{% if page_obj.number|add:"4" < page_obj.paginator.num_pages %}
<li><a class="btn-page page-available" href="?page={{ page_obj.paginator.num_pages }}">{{ page_obj.paginator.num_pages }}</a></li>
{% endif %}
{% if page_obj.has_next %}
<li><a href="?page={{ page_obj.next_page_number }}">{% trans 'next' %}</a></li>
{% endif %}
<li class="grp-results"><span class='btn-page results'>{{ page_obj.paginator.count }} Results</span></li>
</ul>
</nav>
{% endwith %}
{% endspaceless %}
</div>
</div> |
Hello @Safrone, thanks for report this. is not a bug of this lib, but your and another user request this change. I've been thinking about the best way to do it... and start developing today, but i no have much time on this and next week... however i create a PR in I'll give you more news in the coming days. |
FYI this is how https://github.com/theatlantic/django-nested-admin handles this: nested_admin.nested.NestedStackedInlineMixin:
|
@Safrone I started de branch to support, and i testing it. |
Love the project, it worked exactly how I needed and expected.
I use django-grappelli for an updated admin interface: https://github.com/sehmaschine/django-grappelli
with that the styling on the paginated inlines don't look correct.
I was wondering if support for grappelli could be added to make using this seamless. I admit however I don't know how much is involved with that kind of change.
thanks!
The text was updated successfully, but these errors were encountered: