123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- {% extends "admin/base_site.html" %}
- {% load i18n jet_tags static %}
- {% block extrahead %}
- {{ block.super }}
- <script type="text/javascript" src="{% static "admin/js/jquery.js" %}"></script>
- <script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
- <script type="text/javascript" src="{% static "admin/js/inlines.js" %}"></script>
- {% endblock %}
- {% if not is_popup %}
- {% block breadcrumbs %}
- <div class="breadcrumbs">
- <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
- {% if app %}
- › <a href="{{ app.app_url }}">{% if app.name != app.app_label|capfirst|escape %}{{ app.name }}{% else %}{% trans app.app_label as app_label %}{{ app_label|capfirst|escape }}{% endif %}</a>
- {% endif %}
- › {{ object.title|capfirst }}
- </div>
- {% endblock %}
- {% endif %}
- {% block content %}
- <form action="" method="POST">
- <div class="changeform">
- {% csrf_token %}
- {{ form.media }}
- {{ settings_form.media }}
- {{ children_formset.media }}
- <ul class="changeform-tabs">
- <li class="changeform-tabs-item selected{% if form.errors or settings_form.errors %} errors{% endif %}">
- <a href="#" class="changeform-tabs-item-link" data-module-id="module_0">
- {% trans "General" %}
- </a>
- </li>
- {% if children_formset %}
- {% formset_has_errors children_formset as errors %}
- <li class="changeform-tabs-item{% if errors %} errors{% endif %}">
- <a href="#" class="changeform-tabs-item-link" data-module-id="module_1">
- {{ child_name_plural }}
- </a>
- </li>
- {% endif %}
- </ul>
- <div class="module selected" id="module_0">
- {{ form.non_field_errors }}
- {{ settings_form.non_field_errors }}
- {% if form.errors or settings_form.errors %}
- <fieldset class="module aligned">
- <p class="errornote">
- {% trans "Please correct the errors below." %}
- </p>
- </fieldset>
- {% endif %}
- {% include "jet.dashboard/update_module_fieldset.html" with form=form %}
- {% if settings_form %}
- {% include "jet.dashboard/update_module_fieldset.html" with form=settings_form %}
- {% endif %}
- </div>
- {% if children_formset %}
- <div class="module" id="module_1">
- <div class="inline-group">
- {{ children_formset.management_form }}
- {{ children_formset.non_form_errors }}
- <div class="stacked-inline side cf">
- <div class="stacked-inline-side">
- <div class="stacked-inline-side-top"></div>
- <ul class="stacked-inline-list">
- {% for form in children_formset %}
- <li class="stacked-inline-list-item{% if forloop.first %} selected{% endif %}{% if form.errors %} errors{% endif %}">
- <a href="#" class="stacked-inline-list-item-link" data-inline-related-id="{{ children_formset.prefix }}-{{ forloop.counter0 }}">
- {% if not form.initial %}
- <span class="icon-new"></span>
- {% endif %}
- <b>{{ child_name }}:</b>
- <span class="inline_label">
- #{{ forloop.counter }}
- </span>
- </a>
- </li>
- {% endfor %}
- <li class="stacked-inline-list-item empty">
- <a href="#" class="stacked-inline-list-item-link" data-inline-related-id="{{ children_formset.prefix }}-empty">
- <span class="icon-new"></span>
- <b>{{ child_name }}:</b>
- <span class="inline_label">
- #{{ children_formset|length }}
- </span>
- </a>
- </li>
- </ul>
- <div class="stacked-inline-side-bottom"></div>
- </div>
- <div class="stacked-inline-content">
- {% for form in children_formset %}
- <div class="stacked {% if forloop.first %}selected {% endif %}inline-related {% if forloop.last %} last-related{% endif %}" id="{{ children_formset.prefix }}-{{ forloop.counter0 }}">
- {% if form.non_field_errors %}{{ form.non_field_errors }}{% endif %}
- {% include "jet.dashboard/update_module_fieldset.html" with form=form %}
- </div>
- {% endfor %}
- {% with form=children_formset.empty_form %}
- <div class="stacked inline-related empty-form last-related" id="{{ children_formset.prefix }}-empty">
- {% if form.non_field_errors %}{{ form.non_field_errors }}{% endif %}
- {% include "jet.dashboard/update_module_fieldset.html" with form=form %}
- </div>
- {% endwith %}
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- (function($) {
- $("#module_1 .inline-related").stackedFormset({
- prefix: '{{ children_formset.prefix }}',
- adminStaticPrefix: '{% static "admin/" %}',
- deleteText: "{% trans "Remove" %}",
- addText: "<span class=\"icon-add\"></span> {% blocktrans with verbose_name=child_name|capfirst %}Add another {{ verbose_name }}{% endblocktrans %}"
- });
- })(django.jQuery);
- </script>
- {% endif %}
- <div class="submit-row">
- <input type="submit" value="{% trans 'Save' %}" class="default" name="_save" />
- </div>
- </div>
- </form>
- {% endblock %}
|