Skip to content
New issue

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

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

Already on GitHub? # to your account

Add inline_admin_formset associated classes #137

Closed
marcoooo opened this issue Jan 11, 2017 · 1 comment
Closed

Add inline_admin_formset associated classes #137

marcoooo opened this issue Jan 11, 2017 · 1 comment

Comments

@marcoooo
Copy link

Hi, I just run into this (little issue): il you use Django 1.10 and add a SortableMixin with TabularInline, you will loose the classes elements associated with inline classes definition (such as collapse functionnality).

You may correct this very simply modifying templates/adminsortable2/tabular.html
replacing :

<div class="inline-group sortable" id="{{ inline_admin_formset.formset.prefix }}-group">
  <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module">
   <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
   {{ inline_admin_formset.formset.non_form_errors }}
   <table>
     <thead><tr><th>{% trans "Sort" %}</th>

with

{% load i18n admin_urls admin_static admin_modify %}
<div class="inline-group sortable" id="{{ inline_admin_formset.formset.prefix }}-group">
  <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module **{{ inline_admin_formset.classes }}**">
   <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
   {{ inline_admin_formset.formset.non_form_errors }}
   <table>

Would you like a PR ?
M.

@jrief
Copy link
Owner

jrief commented Jan 23, 2017

sorry for now answering in time.
Yes a pull request would be nice.

@jrief jrief closed this as completed in d5c6625 Sep 14, 2017
jrief added a commit that referenced this issue Sep 14, 2017
fix #137 proposition to allow standard collapsible tabular inline.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants