reformat edit forms (#1192)

This commit is contained in:
Kevin Papst
2019-10-30 13:59:53 +01:00
committed by GitHub
parent ed1154af67
commit bda9584346
8 changed files with 279 additions and 8 deletions

View File

@@ -6,9 +6,91 @@
{% block page_actions %}{{ actions.customer(customer, 'edit') }}{% endblock %}
{% block main %}
{{ include(app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig', {
{% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}
{% set formOptions = {
'title': customer.name|default('create'|trans),
'form': form,
'back': path('admin_customer')
}) }}
} %}
{% embed formEditTemplate with formOptions %}
{% block form_body %}
<div class="row">
<div class="col-md-10">
{{ form_row(form.name) }}
</div>
<div class="col-md-2">
{{ form_row(form.color) }}
</div>
</div>
{{ form_row(form.comment) }}
<fieldset>
{#<legend>Company data</legend>#}
{{ form_row(form.company) }}
{{ form_row(form.address) }}
<div class="row">
<div class="col-md-4">
{{ form_row(form.country) }}
</div>
<div class="col-md-4">
{{ form_row(form.currency) }}
</div>
<div class="col-md-4">
{{ form_row(form.timezone) }}
</div>
</div>
</fieldset>
<fieldset>
{#<legend>Contact data</legend>#}
<div class="row">
<div class="col-md-4">
{{ form_row(form.contact) }}
</div>
<div class="col-md-4">
{{ form_row(form.email) }}
</div>
<div class="col-md-4">
{{ form_row(form.homepage) }}
</div>
</div>
<div class="row">
<div class="col-md-4">
{{ form_row(form.mobile) }}
</div>
<div class="col-md-4">
{{ form_row(form.phone) }}
</div>
<div class="col-md-4">
{{ form_row(form.fax) }}
</div>
</div>
</fieldset>
<fieldset>
{#<legend>Financial data</legend>#}
<div class="row">
<div class="col-md-6">
{{ form_row(form.fixedRate) }}
</div>
<div class="col-md-6">
{{ form_row(form.hourlyRate) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{{ form_row(form.budget) }}
</div>
<div class="col-md-6">
{{ form_row(form.timeBudget) }}
</div>
</div>
</fieldset>
{{ form_row(form.visible) }}
{% if form.metaFields is defined and form.metaFields is not empty %}
<fieldset>
{#<legend>Custom fields</legend>#}
{{ form_row(form.metaFields) }}
</fieldset>
{% endif %}
{{ form_widget(form) }}
{% endblock %}
{% endembed %}
{% endblock %}