theatlantic / django-nested-admin

Django admin classes that allow for nested inlines
http://django-nested-admin.readthedocs.org/
Other
690 stars 97 forks source link

Feature request: work with Jazzmin #222

Open DanielSwain opened 2 years ago

DanielSwain commented 2 years ago

It's great that nested admin works with Grappelli, but IMHO Django Jazzmin looks much nicer than Grappelli: https://github.com/farridav/django-jazzmin

It would be outstanding if nested admin would be made to work with Jazzmin. Thanks for your consideration.

mrfoggg commented 1 year ago

Jazzmin really much nicer than Grappell, django baton also fine and works with django-nested-admin. I want try me project with django-nested-admin and Jazzmin. Waiting compatibility

avilags commented 1 year ago

hola tambien tengo problema con jazzmin. AL USAR ESTA LIBRERIA SE DEFORMA TODA LA VISTA

mardukbp commented 11 months ago

I found a simple solution for integrating django-nested-admin with jazzmin when using stacked inlines.

  1. In the project root create the directory templates/nesting/admin/inlines
  2. Copy jazzmin's stacked.html template (site-packages/jazzmin/templates/admin/edit_inline/stacked.html) to this directory.
  3. In this template add to the end of the innermost div.card-body
{% if inline_admin_form.form.inlines %}
{% for nested in inline_admin_form.form.inlines %}
    {% include nested.opts.template with inline_admin_formset=nested %}
{% endfor %}
{% endif %}

For a tabbed inline the solution should be similar. Just compare the corresponding templates and copy the relevant macros to the jazzmin template.

When we in this thread have worked out a solution for both kinds of inline, we can submit a pull request with jazzmin.html templates and solve this issue :)