Commits

salvator committed a7111ac Merge

Merged in artscoop/django-admintools-bootstrap/default (pull request #5)

  • Participants
  • Parent commits 57b3d61, d16b74a

Comments (0)

Files changed (2)

File admintools_bootstrap/templates/admin/change_form.html

 {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
 {% if save_on_top %}{% submit_row %}{% endif %}
 
+{% block field_sets %}
 {% for fieldset in adminform %}
   {% include "admin/includes/fieldset.html" %}
 {% endfor %}
+{% endblock %}
 
 {% block after_field_sets %}{% endblock %}
 
+{% block inline_field_sets %}
 {% for inline_admin_formset in inline_admin_formsets %}
     {% include inline_admin_formset.opts.template %}
 {% endfor %}
+{% endblock %}
 
 {% block after_related_objects %}{% endblock %}
 

File admintools_bootstrap/templatetags/admintools_bootstrap.py

         out = '<ul class="breadcrumb">'
         curr = 0
         for d in lines:
-            if d[0][0] == '*':
-                active = ' class="active"'
-                d[0] = d[0][1:]
-            else:
-                active = ''
+            if len(d[0]) > 0:
+                if d[0][0] == '*':
+                    active = ' class="active"'
+                    d[0] = d[0][1:]
+                else:
+                    active = ''
 
-            curr += 1
-            if (len(lines) == curr):
-                # last
-                divider = ''
-            else:
-                divider = '<span class="divider">/</span>'
+                curr += 1
+                if (len(lines) == curr):
+                    # last
+                    divider = ''
+                else:
+                    divider = '<span class="divider">/</span>'
 
-            if len(d) == 2:
-                out += '<li%s><a href="%s">%s</a>%s</li>' % (active, d[0], d[1], divider)
-            elif len(d) == 1:
-                out += '<li%s>%s%s</li>' % (active, d[0], divider)
-            else:
-                raise ValueError('Invalid breadcrumb line: %s' % self.delimiter.join(d))
+                if len(d) == 2:
+                    out += '<li%s><a href="%s">%s</a>%s</li>' % (active, d[0], d[1], divider)
+                elif len(d) == 1:
+                    out += '<li%s>%s%s</li>' % (active, d[0], divider)
+                else:
+                    raise ValueError('Invalid breadcrumb line: %s' % self.delimiter.join(d))
         out += '</ul>'
         return out