{% extends 'accueil.html' %}

{% block main %}

<div class="site-wrapper">

    <div class="site-wrapper-inner">

        <div class="cover-container">

          <div class="masthead clearfix">
            <div class="inner">
              <h3 class="masthead-brand">Pywallter</h3>
              <ul class="nav masthead-nav">
                  <li><a href="/login/">Login</a></li>

                  {% if signin_enable  %}
                  <li class="active"><a href="/inscription/">Inscription</a></li>
                  {% endif %}
                  <li><a href="#">Contact</a></li>
              </ul>
            </div>
          </div>

          <div class="inner cover">
            <h1 class="cover-heading">Inscription</h1>
            <br>

                {% if signin_enable  %}
            <form method="POST" action="{{ url_inscription }}">
                    <input type="text" name="user" id="user" placeholder="Pseudo" class="form-control"><br />
                    {% if MAIL_SERVER %}
                    <div class="col-sm-7">
                        <input type="text" name="mail" id="mail" placeholder="Adresse mail" class="form-control" size="2"> <br/>
                    </div>
                    <h4>@{{hostname}}</h4>
                    <br/>
                    {% endif %}
                <input type="password" name="passwd" id="passwd" placeholder="Mot de passe" class="form-control"><br />
                <input type="password" name="passwdconfirm" id="passwdconfirm" placeholder="Confirmation du mot de passe" class="form-control"><br />
                <br>
                <button id="tada" class="btn btn-default btn-primary" type="submit">Envoyer</button>
                </form>
                {% else %}
                <p class="lead">
                    Désolé les inscriptions ne sont pas activés sur le serveur
                </p>
                {%endif%}
             {% for i in users %}
             <p>{{i}}</p>
             {% endfor %}
          </div>

          <div class="msginfo">
                 {# On affiche les messages d'erreur puis les messages de succés #}
                 {% for categorie in ['error', 'succes'] %}
                   {% with msgs = get_flashed_messages(category_filter=[categorie]) %}
                     {% if msgs %}
                       <div class="flashed {{ categorie }}">
                         {% for m in msgs %}
                           <p>{{ m|safe }}</p>
                         {% endfor %}
                       </div>
                     {% endif %}
                   {% endwith %}
                 {% endfor %}
          </div>

          <div class="mastfoot">
            <div class="inner">
              <p>Cover template for <a href="http://getbootstrap.com">Bootstrap</a>, by <a href="https://twitter.com/mdo">@mdo</a>.</p>
            </div>
          </div>

        </div>

    </div>

</div>

{% endblock %}