1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- {% extends "admin/admin/layout.html" %}
- {% import "_forms.html" as form_theme with context %}
- {% block action_body %}
- <form action="{{ link }}" method="post">
- {% if tabbed %}
- {{ form_theme.form_hidden_widget(form) }}
- <ul class="nav nav-tabs" id="form-tabs">{% for fieldset in form.fieldsets %}
- <li{% if loop.first %} class="active"{% endif%}><a href="#form-tab-{{ loop.index }}" data-toggle="tab">{{ fieldset.legend }}</a></li>{% endfor %}
- </ul>
- <div class="tab-content">
- {% for fieldset in form.fieldsets %}
- <div class="tab-pane{% if loop.first %} active{% endif%}" id="form-tab-{{ loop.index }}">
- <fieldset>
- <legend>{{ fieldset.legend }}</legend>{% for field in fieldset.fields %}
- {{ form_theme.row_widget(field) }}{% endfor %}
- </fieldset>
- </div>
- {% endfor %}
- </div>
- {% else %}
- {{ form_theme.form_widget(form) }}
- {% endif %}
- <div class="form-actions">
- {% block form_actions %}
- {% block form_submit %}
- <button name="save" type="submit" class="btn btn-primary">{{ action.submit_button }}</button>
- {% endblock %}
- {% if action.get_edit_link -%}
- <button name="save_edit" type="submit" class="btn btn-warning">{% trans %}Save and Edit{% endtrans %}</button>
- {%- endif %}
- {% if action.get_new_link -%}
- <button name="save_new" type="submit" class="btn btn-success">{% trans %}Save and Add Another{% endtrans %}</button>
- {%- endif %}
- {% if fallback %}<a href="{{ fallback }}" class="btn">{% trans %}Cancel{% endtrans %}</a>{% endif %}
- {% endblock %}
- </div>
- </form>
- {% endblock %}
- {% block javascripts %}
- {{ super() }}
- {% if tabbed %}
- <script>
- $(function () {
- $('#form-tabs a').click(function (e) {
- e.preventDefault();
- $(this).tab('show');
- });
- });
- </script>
- {% endif %}
- {% endblock %}
|