{% if charge is defined and charge.id is not null %}
    {{ form_start(form, {'action': path('admin.charges.edit', {'id': charge.id}), 'method': 'POST'}) }}
{% else %}
    {{ form_start(form, {'action': path('admin.charges.new'), 'method': 'POST'}) }}
{% endif %}
{{ alert_infos('NB!', 'Tous les champs comportant un (*) sont obligatoires.') }}
<ul class="nav nav-tabs nav-tabs-highlight">
    <li class="nav-item">
        <a href="#vertical-left-infos" class="nav-link active" data-toggle="tab">
            <i class="icon-info22 mr-2"></i> Infos des charges
        </a>
    </li>
    
</ul>

<div class="tab-content">
    <div class="tab-pane fade show active" id="vertical-left-infos">
        <div class="row mb-2">
            <div class="col-sm-6">
                <label class="form-label">{{ form_label(form.properties) }}</label>
                {{ form_widget(form.properties) }}
                <a href="javascript:void(0)">{{ form_help(form.properties) }}</a>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="form-label">{{ form_label(form.type) }}</label>
                    {{ form_widget(form.type) }}
                    <a href="javascript:void(0)">{{ form_help(form.type) }}</a>
                </div>
            </div>
            
        </div>

        <div class="row mb-2">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="form-label">{{ form_label(form.montant) }}</label>
                    {{ form_widget(form.montant) }}
                    <a href="javascript:void(0)">{{ form_help(form.montant) }}</a>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="form-label">{{ form_label(form.date_intervention) }}</label>
                    {{ form_widget(form.date_intervention) }}
                    <a href="javascript:void(0)">{{ form_help(form.date_intervention) }}</a>
                </div>
            </div>

              <div class="col-sm-12">
                    <label class="form-label">{{ form_label(form.description) }}</label>
                    {{ form_widget(form.description) }}
                    <a href="javascript:void(0)">{{ form_help(form.description) }}</a>
                </div>
            
        </div>

        <!-- Boutons navigation - Tab 1 -->
        <div class="text-right mt-3">
              <a href="{{ path('admin.charges.index') }}" class="btn btn-sm btn-info">
                    <i class="icon-cross2"></i> Annuler
                </a>
                &nbsp;
            <button type="submit" id="sendChargesBtn" class="btn btn-sm btn-primary"><i class="icon-floppy-disk"></i> Enregistrer</button>
        </div>
    </div>

    
</div>

{{ form_end(form) }}

<script>
function nextTab() {
    $('.nav-tabs .nav-link.active').parent().next('li').find('a').tab('show');
}

function previousTab() {
    $('.nav-tabs .nav-link.active').parent().prev('li').find('a').tab('show');
}
</script>