{% if registration_errors_pers is not defined %}
  {% set registration_errors_pers = null %}
{% endif %}

{% form_theme form 'MuzichCoreBundle:Form:errors.html.twig' %}

{{ form_errors(form) }}

{% if registration_errors_pers|length > 0 %}
<ul class="error_list">
  {% for error in registration_errors_pers %}
    <li>{{ error }}</li>
  {% endfor %}
</ul>
{% endif %}

<div class="field">
  {{ form_errors(form.username) }}
  {{ form_label(form.username, 'username'|trans({}, 'userform')) }}
  {{ form_widget(form.username, {'attr':{'class':'niceinput'}}) }}
</div>   
    
<div class="field">
  {{ form_errors(form.email) }}
  {{ form_label(form.email, 'email'|trans({}, 'userform')) }}
  {{ form_widget(form.email, {'attr':{'class':'niceinput'}}) }}
</div> 

<div class="field">
  {{ form_errors(form.plainPassword.first) }}
  {{ form_label(form.plainPassword.first, 'password.first'|trans({}, 'userform')) }}
  {{ form_widget(form.plainPassword.first, {'attr':{'class':'niceinput'}}) }}
</div> 

<div class="field">
  {{ form_errors(form.plainPassword.second) }}
  {{ form_label(form.plainPassword.second, 'password.second'|trans({}, 'userform')) }}
  {{ form_widget(form.plainPassword.second, {'attr':{'class':'niceinput'}}) }}
</div> 

<span class="help">{{ 'help.token'|trans({}, 'userform') }}</span>

<div class="field">
  {{ form_errors(form.token) }}
  {{ form_label(form.token, 'token'|trans({}, 'userform')) }}
  {{ form_widget(form.token, {'attr':{'class':'niceinput'}}) }}
</div>

<div class="field">
  {{ form_errors(form.cgu_accepted) }}
  {{ form_widget(form.cgu_accepted, {'attr':{}}) }}
  {% autoescape false %}
  {{ 'cgu_accepted'|trans({'%url%':path('info_cgu')}, 'userform') }}
  {% endautoescape %}
</div>

<div class="field">
  {{ form_errors(form.mail_newsletter) }}
  {{ form_widget(form.mail_newsletter, {'attr':{}}) }}
  {{ 'mail_newsletter'|trans({}, 'userform') }}
</div>

<div class="field">
  {{ form_errors(form.mail_partner) }}
  {{ form_widget(form.mail_partner, {'attr':{}}) }}
  {{ 'mail_partner'|trans({}, 'userform') }}
</div> 

{{ form_rest(form) }}

<div class="alignright">
  <img class="loader" style="display: none;" src="{{ asset('/bundles/muzichcore/img/ajax-loader.gif') }}" alt="loading" />
  <input type="submit" class="button" value="{{ 'registration.submit'|trans({}, 'userui') }}" />
</div>
