Skip to content

Commit

Permalink
Merge pull request Soaa-#13 from smcoll/master
Browse files Browse the repository at this point in the history
Layout fixes
  • Loading branch information
s-block committed Oct 20, 2014
2 parents 7300bab + 4915d37 commit 1d838af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions nested_inline/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def add_view(self, request, form_url='', extra_context=None):
formset = FormSet(instance=self.model(), prefix=prefix,
queryset=inline.queryset(request))
formsets.append(formset)
if hasattr(inline, 'inlines'):
if hasattr(inline, 'inlines') and inline.inlines:
self.add_nested_inline_formsets(request, inline, formset)

adminForm = helpers.AdminForm(form, list(self.get_fieldsets(request)),
Expand All @@ -221,7 +221,7 @@ def add_view(self, request, form_url='', extra_context=None):
fieldsets, prepopulated, readonly, model_admin=self)
inline_admin_formsets.append(inline_admin_formset)
media = media + inline_admin_formset.media
if hasattr(inline, 'inlines'):
if hasattr(inline, 'inlines') and inline.inlines:
media += self.wrap_nested_inline_formsets(request, inline, formset)

context = {
Expand Down Expand Up @@ -278,7 +278,7 @@ def change_view(self, request, object_id, form_url='', extra_context=None):
instance=new_object, prefix=prefix,
queryset=inline.queryset(request))
formsets.append(formset)
if hasattr(inline, 'inlines'):
if hasattr(inline, 'inlines') and inline.inlines:
self.add_nested_inline_formsets(request, inline, formset)

if self.all_valid_with_nesting(formsets) and form_validated:
Expand All @@ -299,7 +299,7 @@ def change_view(self, request, object_id, form_url='', extra_context=None):
formset = FormSet(instance=obj, prefix=prefix,
queryset=inline.queryset(request))
formsets.append(formset)
if hasattr(inline, 'inlines'):
if hasattr(inline, 'inlines') and inline.inlines:
self.add_nested_inline_formsets(request, inline, formset)

adminForm = helpers.AdminForm(form, self.get_fieldsets(request, obj),
Expand All @@ -317,7 +317,7 @@ def change_view(self, request, object_id, form_url='', extra_context=None):
fieldsets, prepopulated, readonly, model_admin=self)
inline_admin_formsets.append(inline_admin_formset)
media = media + inline_admin_formset.media
if hasattr(inline, 'inlines'):
if hasattr(inline, 'inlines') and inline.inlines:
media += self.wrap_nested_inline_formsets(request, inline, formset)

context = {
Expand Down
2 changes: 1 addition & 1 deletion nested_inline/static/admin/css/forms-nested.css
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ body.popup .submit-row {
}

.nested-inline {
margin: 10px;
margin: 5px;
}

td > .nested-inline {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n admin_static admin_modify %}
{% with recursive_formset=inline_admin_formset stacked_template='admin/edit_inline/stacked-nested.html' tabular_template='admin/edit_inline/tabular-nested.html'%}
<div class="inline-group{% if recursive_formset %} {{ recursive_formset.formset.prefix|default:"Root" }}-nested-inline{% if prev_prefix %} {{ prev_prefix }}-{{ loopCounter }}-nested-inline{% endif %} nested-inline{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-group">
{% with recursive_formset=inline_admin_formset stacked_template='admin/edit_inline/stacked-nested.html' tabular_template='admin/edit_inline/tabular-nested.html'%}
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}" id="{{ recursive_formset.formset.prefix }}">
{{ recursive_formset.formset.management_form }}
<fieldset class="module">
Expand Down

0 comments on commit 1d838af

Please sign in to comment.