<commit_before>{% import 'TrezLogicielTrezBundle:Utils:forms.html.twig' as forms %}

<form class="form-horizontal" action="{{ path(route, route_options is defined ? route_options : {} ) }}" {{ form_enctype(form) }} method="post">
    <div>{{ form_errors(form) }}</div>

    <fieldset>
        {{ forms.field(form.edition, 'Édition') }}
        {{ forms.field(form.annee_1, 'Année 1', {'class': 'date-selects'}, '', "Seule l'année est importante") }}
        {{ forms.field(form.annee_2, 'Année 2', {'class': 'date-selects'}, '', "Seule l'année est importante") }}
    </fieldset>

    {{ form_rest(form) }}

    <div class="form-actions">
        <input type="submit" class="btn btn-primary" value="Valider">&nbsp;
        <a href="{{ path('exercice_index') }}" class="btn">Annuler</a>
    </div>
</form><commit_msg>Only year field is not disabled in exercice form<commit_after>{% import 'TrezLogicielTrezBundle:Utils:forms.html.twig' as forms %}

<form class="form-horizontal" action="{{ path(route, route_options is defined ? route_options : {} ) }}" {{ form_enctype(form) }} method="post">
    <div>{{ form_errors(form) }}</div>

    <fieldset>
        {{ forms.field(form.edition, 'Édition') }}
        {{ forms.field(form.annee_1, 'Année 1', {'class': 'date-selects'}, '', "Seule l'année est importante") }}
        {{ forms.field(form.annee_2, 'Année 2', {'class': 'date-selects'}, '', "Seule l'année est importante") }}
    </fieldset>

    {{ form_rest(form) }}

    <div class="form-actions">
        <input type="submit" class="btn btn-primary" value="Valider">&nbsp;
        <a href="{{ path('exercice_index') }}" class="btn">Annuler</a>
    </div>
</form>

<script type="text/javascript">
    // we set some values in useless selects and disable them
    $('#trez_logicieltrezbundle_exercicetype_annee_1_day').val(1).attr('disabled', 'disabled');
    $('#trez_logicieltrezbundle_exercicetype_annee_1_month').val(1).attr('disabled', 'disabled');
    $('#trez_logicieltrezbundle_exercicetype_annee_2_day').val(1).attr('disabled', 'disabled');
    $('#trez_logicieltrezbundle_exercicetype_annee_2_month').val(1).attr('disabled', 'disabled');
</script>
{'fraction_non_alphanumeric': 0.19953703703703704, 'fraction_numerical': 0.007407407407407408, 'mean_word_length': 4.686842105263158, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5218155', 'n_tokens_mistral': 753, 'n_tokens_neox': 729, 'n_words': 136}