12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- {#
- 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 title %}
- <a href="{{ admin.generateUrl('list') }}">{{ admin.label }}</a> >
- {% if object.id %}
- {% trans 'title_edit' from 'BaseApplicationBundle'%}
- {% else %}
- {% trans 'title_create' from 'BaseApplicationBundle'%}
- {% endif %}
- {% endblock %}
- {% block actions %}
- <div class="sonata-actions">
- <ul>
- <li class="sonata-action-element"><a href="{{ admin.generateUrl('create') }}">{% trans "link_action_create" from "BaseApplicationBundle" %}</a></li>
- <li class="sonata-action-element"><a href="{{ admin.generateUrl('list') }}">{% trans "link_action_list" from "BaseApplicationBundle" %}</a></li>
- </ul>
- </div>
- {% endblock %}
- {% block form %}
- <form action="{{ admin.generateUrl('update', {'id': object.id}) }}" method="POST">
- {{ form_hidden(form) }}
-
- {% 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 %}
- {{ fields[field_name]|render_form_element(form, object) }}
- {% 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 "BaseApplicationBundle" %}"/>
- {% else %}
- <input type="submit" name="btn_create" value="{% trans "btn_create" from "BaseApplicationBundle" %}"/>
- {% endif %}
- {% else %}
- {% if object.id %}
- <input type="submit" name="btn_update_and_edit" value="{% trans "btn_update_and_edit_again" from "BaseApplicationBundle" %}"/>
- <input type="submit" name="btn_update_and_list" value="{% trans "btn_update_and_return_to_list" from "BaseApplicationBundle" %}"/>
- {% else %}
- <input type="submit" name="btn_create_and_edit" value="{% trans "btn_create_and_edit_again" from "BaseApplicationBundle" %}"/>
- <input type="submit" name="btn_create_and_create" value="{% trans "btn_create_and_create_a_new_one" from "BaseApplicationBundle" %}"/>
- {% endif %}
- {% endif %}
- </form>
- {% endblock %}
|