compact.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {% load i18n admin_urls admin_static %}
  2. <div class="inline-group compact" id="{{ inline_admin_formset.formset.prefix }}-group" data-inline-prefix="{{ inline_admin_formset.formset.prefix }}" data-inline-verbose-name="{{ inline_admin_formset.opts.verbose_name|capfirst }}" data-inline-delete-text="{% trans "Remove" %}">
  3. <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
  4. {{ inline_admin_formset.formset.management_form }}
  5. {{ inline_admin_formset.formset.non_form_errors }}
  6. <div class="inline-navigation">
  7. <div class="inline-navigation-top"></div>
  8. <div class="inline-navigation-bottom"></div>
  9. <div class="add-row">
  10. <a href="#">{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|capfirst %}Add another {{ verbose_name }}{% endblocktrans %}</a>
  11. </div>
  12. <div class="inline-navigation-content">
  13. <div class="inline-navigation-items">
  14. {% for inline_admin_form in inline_admin_formset %}
  15. <a href="#" class="inline-navigation-item{% if forloop.last %} empty{% endif %}" data-inline-related-id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
  16. {% if inline_admin_form.original %}
  17. {{ inline_admin_form.original }}
  18. {% else %}
  19. {{ inline_admin_formset.opts.verbose_name|capfirst }} #{{ forloop.counter }}
  20. {% endif %}
  21. </a>
  22. {% endfor %}
  23. </div>
  24. </div>
  25. </div>
  26. {% for inline_admin_form in inline_admin_formset %}
  27. <div class="inline-related compact{% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last %} empty-form last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
  28. <h3>
  29. <b>{{ inline_admin_formset.opts.verbose_name|capfirst }}:</b>&nbsp;
  30. <span class="inline_label">
  31. {% if inline_admin_form.original %}
  32. {{ inline_admin_form.original }}
  33. {% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
  34. <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="inlinechangelink">{% trans "Change" %}</a>
  35. {% endif %}
  36. {% else %}
  37. #{{ forloop.counter }}
  38. {% endif %}
  39. </span>
  40. {% if inline_admin_form.show_url %}<a href="{{ inline_admin_form.absolute_url }}">{% trans "View on site" %}</a>{% endif %}
  41. {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
  42. </h3>
  43. {% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
  44. {% for fieldset in inline_admin_form %}
  45. {% include "admin/includes/fieldset.html" %}
  46. {% endfor %}
  47. {% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
  48. {{ inline_admin_form.fk_field.field }}
  49. </div>
  50. {% endfor %}
  51. </div>