PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/django/contrib/admin/templates/mako/admin/includes/fieldset.html

https://code.google.com/p/mango-py/
HTML | 70 lines | 44 code | 26 blank | 0 comment | 0 complexity | 8f9ec16468e45183c43a3fb39fd46377 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <%def name="fieldsets(fieldset)">
  2. <fieldset class="module aligned ${fieldset.classes}">
  3. % if fieldset.name:
  4. <h2>${fieldset.name}</h2>
  5. % endif
  6. % if fieldset.description:
  7. <div class="description">${fieldset.description}</div>
  8. % endif
  9. % for line in fieldset:
  10. <div class="form-row${' errors' if line.errors() else ''} ${' '.join([field.field.name for field in line])}">
  11. ${line.errors()}
  12. % for field in line:
  13. <div ${'class="field-box"' if len(line.fields)!=1 else ''}>
  14. % if field.is_checkbox:
  15. ${field.field}${field.label_tag()}
  16. % elif field.is_inline:
  17. % for i, informset in enumerate(inline_admin_formsets):
  18. % if informset.opts.__class__.__name__ == field.field.name:
  19. <%namespace name="tabular" file="admin/edit_inline/tabular.html"/>
  20. <%namespace name="stacked" file="admin/edit_inline/stacked.html"/>
  21. % if informset.opts.template == "admin/edit_inline/tabular.html":
  22. ${tabular.inline_edit(informset, i)}
  23. % else:
  24. ${stacked.inline_edit(informset, i)}
  25. % endif
  26. % endif
  27. % endfor
  28. % else:
  29. ${field.label_tag()}
  30. % if getattr(field, 'is_readonly', False):
  31. <p>${field.contents()}</p>
  32. % else:
  33. ${field.field}
  34. % endif
  35. % endif
  36. % if hasattr(field.field.field, "help_text") and field.field.field.help_text:
  37. <p class="help">${field.field.field.help_text}</p>
  38. % endif
  39. </div>
  40. % endfor
  41. </div>
  42. % endfor
  43. </fieldset>
  44. </%def>