{{ form_start(form) }}

<div class="well clearfix">
    {{ form_row(form.title) }}
    {{ form_row(form.policyDescription) }}
    {{ form_row(form.default) }}
</div>

<div class="well clearfix">
    {{ form_row(form.errorMessages) }}
</div>

<div class="well clearfix">
    <div class="form-group">
        {{ form_label(form.passwordPolicyValidations) }}
        <em>(Define multiple regular expressions that needs to match on a given password for it to be valid.)</em>
        {{ form_errors(form.passwordPolicyValidations) }}
        {{ form_widget(form.passwordPolicyValidations) }}
    </div>
</div>

<div class="well clearfix">
    <div class="form-group">
        {{ form_label(form.validityDuration) }}
        <em>(How long the password stays valid before it expires and the user must set a new one.)</em>
        {{ form_widget(form.validityDuration) }}
        {{ form_errors(form.validityDuration) }}
    </div>
    {{ form_row(form.validityDurationErrorMessages) }}
</div>

<div class="well clearfix">
    <div class="form-group">
        {{ form_label(form.historySize) }}
        <em>(How many previous passwords should be remembered? A password in the history can not be used as a new
            password.)</em>
        {{ form_widget(form.historySize) }}
        {{ form_errors(form.historySize) }}
    </div>
    {{ form_row(form.historySizeErrorMessages) }}
</div>

<div class="well clearfix">
    <div class="form-group">
        {{ form_label(form.editDistance) }}
        <em>(How many characters must be different in the new password compared to the old/current one.)</em>
        {{ form_widget(form.editDistance) }}
        {{ form_errors(form.editDistance) }}
    </div>
    {{ form_row(form.editDistanceErrorMessages) }}
</div>

<div class="well clearfix">
    <div class="form-group">
        {{ form_label(form.changeDelay) }}
        <em>(How long the user must wait after setting a new password until he can change it again.)</em>
        {{ form_widget(form.changeDelay) }}
        {{ form_errors(form.changeDelay) }}
    </div>
    {{ form_row(form.changeDelayErrorMessages) }}
</div>

<h3>Deprecated Fields</h3>

<div class="well clearfix">
    <div class="form-group">
        {{ form_label(form.regEx) }}
        <em>(Regular expression that needs to match on a given password for it to be valid.)</em>
        {{ form_widget(form.regEx) }}
        {{ form_errors(form.regEx) }}
    </div>
    {{ form_row(form.regexErrorMessages) }}
</div>

<div class="pull-right">
    <a class="btn btn-warning" href="{{ path('_admin_backend_passwordpolicy_list') }}">Cancel</a>
    {{ form_widget(form.submit) }}
</div>

{{ form_end(form) }}
