{% extends 'old-bootstrap-modal-layout.html.twig' %}

{% block title %}{{'admin.user.manage.change_password.heading_title'|trans({'%nickname%': user.nickname})}}{% endblock %}

{% block body %}

  <form class="form-horizontal" id="change-password-form"  action="{{ path('admin_v2_user_change_password', {userId:user.id}) }}"  method="post">

    <div class="row form-group">
      <div class="col-md-3 control-label"><label for="code">{{'user.fields.username_label'|trans}}</label></div>
      <div class="col-md-8 controls">
        <div style="margin-top: 7px;">
          {{user.nickname}}
        </div>
      </div>
    </div>

    <div class="row form-group">
      <div class="col-md-3 control-label"><label for="code">{{'admin.user.fields.user_email'|trans}}</label></div>
      <div class="col-md-8 controls">
        <div style="margin-top: 7px;">
          {% if not is_system_generated_email(user.email) %}
            {{ user.email }}
          {% else %}
            --
          {% endif %}
        </div>
      </div>
    </div>

    <div class="row form-group">
      <div class="col-md-3 control-label"><label for="newPassword">{{'admin.user.manage.change_password.new_password_label'|trans}}</label></div>
      <div class="col-md-8 controls">
        <input class="form-control" type="password" id="newPassword" value="" name="newPassword">
        <p class="help-block">{{'admin.user.fields.password_hint'|trans}}</p>
      </div>
    </div>

    <div class="row form-group">
      <div class="col-md-3 control-label"><label for="confirmPassword">{{'admin.user.fields.confirm_password_label'|trans}}</label></div>
      <div class="col-md-8 controls">
        <input class="form-control" type="password" id="confirmPassword" value=""
               name="confirmPassword" data-explain="{{'admin.user.manage.change_password.input_data_explain.confirm_password'|trans}}">
        <p class="help-block">{{'admin.user.fields.confirm_password_hint'|trans}}</p>
      </div>
    </div>
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  </form>

{% endblock %}

{% block footer %}
  <button id="change-password-btn" data-submiting-text="{{'form.btn.submit.submiting'|trans}}" class="btn btn-primary pull-right" data-toggle="form-submit" data-target="#change-password-form">{{'form.btn.submit'|trans}}</button>
  <button type="button" class="btn btn-link" data-dismiss="modal">{{'form.btn.cancel'|trans}}</button>

  <script>app.load('user/change-password');</script>
{% endblock %}