123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- {% load i18n admin_urls admin_static admin_modify %}
- <div class="module" id="inline_module_{{ index }}">
- <div class="inline-group" 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">
- {% if errors %}
- <p class="errornote">
- {% trans "Please correct the errors below." %}
- </p>
- {% endif %}
- {{ inline_admin_formset.formset.non_form_errors }}
- <table>
- <thead><tr>
- <th></th>
- {% for field in inline_admin_formset.fields %}
- {% if not field.widget.is_hidden %}
- <th{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}
- {% if field.help_text %} <img src="{% static "admin/img/icon-unknown.gif" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %}
- </th>
- {% endif %}
- {% endfor %}
- {% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
- </tr></thead>
- <tbody>
- {% for inline_admin_form in inline_admin_formset %}
- {% if inline_admin_form.form.non_field_errors %}
- <tr><td colspan="{{ inline_admin_form|cell_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr>
- {% endif %}
- <tr class="form-row {% cycle "row1" "row2" %} {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last %} empty-form{% endif %}"
- id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
- <td class="original">
- {% if inline_admin_form.original or inline_admin_form.show_url %}<p>
- {% if inline_admin_form.original %}
- {% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
- <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" title="{% trans "Change" %} {{ inline_admin_form.original }}" class="inlinechangelink">
- <span class="icon-edit"></span>
- </a>
- {% endif %}
- {% endif %}
- {% if inline_admin_form.show_url %}
- <a href="{{ inline_admin_form.absolute_url }}" title="{% trans "View on site" %}">
- <span class="icon-open-external"></span>
- </a>
- {% endif %}
- </p>{% endif %}
- {% if not inline_admin_form.original %}
- <span class="icon-new"></span>
- {% endif %}
- {% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
- {{ inline_admin_form.fk_field.field }}
- {% spaceless %}
- {% for fieldset in inline_admin_form %}
- {% for line in fieldset %}
- {% for field in line %}
- {% if field.field.is_hidden %} {{ field.field }} {% endif %}
- {% endfor %}
- {% endfor %}
- {% endfor %}
- {% endspaceless %}
- </td>
- {% for fieldset in inline_admin_form %}
- {% for line in fieldset %}
- {% for field in line %}
- {% if not field.field.is_hidden %}
- <td{% if field.field.name %} class="field-{{ field.field.name }}"{% endif %}>
- {% if field.is_readonly %}
- <p>{{ field.contents }}</p>
- {% else %}
- {{ field.field.errors.as_ul }}
- {{ field.field }}
- {% endif %}
- </td>
- {% endif %}
- {% endfor %}
- {% endfor %}
- {% endfor %}
- {% if inline_admin_formset.formset.can_delete %}
- <td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </fieldset>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- (function($) {
- $("#{{ inline_admin_formset.formset.prefix }}-group .tabular.inline-related tbody tr").tabularFormset({
- prefix: "{{ inline_admin_formset.formset.prefix }}",
- adminStaticPrefix: '{% static "admin/" %}',
- addText: "<span class=\"icon-add\"></span> {% blocktrans with inline_admin_formset.opts.verbose_name|capfirst as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}",
- deleteText: "{% trans 'Remove' %}"
- });
- })(django.jQuery);
- </script>
|