123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- {#
- This file is part of the Sonata package.
- (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- For the full copyright and license information, please view the LICENSE
- file that was distributed with this source code.
- #}
- {% extends base_template %}
- {% block actions %}
- <div class="sonata-actions">
- <ul>
- <li class="sonata-action-element"><a href="{{ admin.generateUrl('create') }}">{% trans "link_action_create" from admin.translationdomain %}</a></li>
- <li class="sonata-action-element"><a href="{{ admin.generateUrl('list') }}">{% trans "link_action_list" from admin.translationdomain %}</a></li>
- </ul>
- </div>
- {% endblock %}
- {% block side_menu %}{% if side_menu %}{{ side_menu.render|raw }}{% endif %}{% endblock %}
- {% block form %}
- <form action="{{ admin.generateUrl('update', {'id': object.id}) }}" enctype="multipart/form-data" method="POST">
- {{ form_hidden(form) }}
-
- {% if form.errors %}
- <div class="sonata-ba-form-error">
- {{ form_errors(form) }}
- </div>
- {% endif %}
-
- {% for name, form_group in form_groups %}
- {% if name %}
- <fieldset>
- <legend>
- {{ name }}
- {% if form_group.collapsed %}
- <a href="" class="sonata-ba-collapsed">{% trans 'link_expand' from 'BaseApplicationBundle' %}</a>
- {% endif %}
- </legend>
-
- <div class="sonata-ba-collapsed-fields">
- {% endif %}
- {% for field_name in form_group.fields %}
- {% if fields[field_name] is defined %}
- {{ fields[field_name]|render_form_element(form, object) }}
- {% endif %}
- {% endfor %}
- {% if name %}
- </div>
- </fieldset>
- {% endif %}
- {% endfor %}
- {% if app.request.isxmlhttprequest %}
- {% if object.id %}
- <input type="submit" name="btn_update" value="{% trans "btn_update" from admin.translationdomain %}"/>
- {% else %}
- <input type="submit" name="btn_create" value="{% trans "btn_create" from admin.translationdomain %}"/>
- {% endif %}
- {% else %}
- {% if object.id %}
- <input type="submit" name="btn_update_and_edit" value="{% trans "btn_update_and_edit_again" from admin.translationdomain %}"/>
- <input type="submit" name="btn_update_and_list" value="{% trans "btn_update_and_return_to_list" from admin.translationdomain %}"/>
- {% else %}
- <input type="submit" name="btn_create_and_edit" value="{% trans "btn_create_and_edit_again" from admin.translationdomain %}"/>
- <input type="submit" name="btn_create_and_create" value="{% trans "btn_create_and_create_a_new_one" from admin.translationdomain %}"/>
- {% endif %}
- {% endif %}
- </form>
- {% endblock %}
|