{% extends 'gestion/base_minimale.html' %}
{% load i18n %}
{% load static %}

{% block contents %}
<h1>
 {{ nom_page }}
</h1>
<form method="post">
 {% csrf_token %}
 <table class="deux-colonnes-formulaire" style="display: inline-block; vertical-align: top;">
  {{ form.as_table }}
  <tr>
   <td>
    <button id="buttonPasse" onclick="changePasse()" type="button">
     {% translate "Changer le mot de passe ..." %}
    </button>
   </td>
   <td>
    <input style="width: 100%;" type="submit" value="{% translate 'Valider' %}"/>
   </td>
  </tr>
 </table>
</form>
<script>
 var passInputs = $("#id_passe1, #id_passe2");
  if ($(".errorlist").length){
      $("#buttonPasse").hide();
  } else {
      passInputs.parent().parent().hide();
  }
  function changePasse(){
      $("#buttonPasse").fadeOut();
      passInputs.parent().parent().fadeIn();
  }
</script>
{% endblock %}

