{% extends 'base.html.twig' %}

{% block title %}Kyvala Sign in{% endblock %}

{% block body %}
    {% if error %}
        <div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
    {% endif %}
    
    <div class="col-md-12">      
      {% for message in app.flashes('success') %}
          <div class="alert alert-success tost text-center">
              <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>
              <span>
                  <b> {#{'success'|trans}#} - </b>
                  {{ message }}
              </span>
          </div>
      {% endfor %}
      {% for message in app.flashes('danger') %}
          <div class="alert alert-danger tost text-center">
              <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>
              <span>
                  <b> {#{'Danger'|trans}#} - </b>
                  {{ message }}
              </span>
          </div>
      {% endfor %}
      {% for message in app.flashes('info') %}
          <div class="alert alert-info tost text-center">
              <button type="button" aria-hidden="true" class="close">
                  <i class="material-icons">close</i>
              </button>
              <span>
                  <b> {#{'Info'|trans}#} - </b>
                  {{ message }}
              </span>
          </div>
      {% endfor %}
      {% for message in app.flashes('warning') %}
          <div class="alert alert-warning tost text-center">
              <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>
              <span>
                  <b> {#{'warning'|trans}#} - </b>
                  {{ message }}
              </span>
          </div>
      {% endfor %}
    </div>

    <div class="container text-center mt-5 pt-5">
      <div class="row">
        <div class="offset-md-3 col-6 align-self-center card"><br>
          <form action="{{ path('app_login') }}" method="post">
            <h1 class="h3 mb-3 font-weight-normal">Please sign in</h1><hr>
            <label for="inputEmail" class="sr-only">User name</label>
            <input type="text" class="form-control" placeholder="login" required="" autofocus="" id="username" name="_username" value="{{ last_username }}"/>
            <br>
            <label for="inputPassword" class="sr-only">Password</label>
            <input type="password" name="_password" id="_password" class="form-control" placeholder="Password" required="">
            <div class="checkbox mb-3"><br>
              <label>
                <input type="checkbox" value="remember-me"> Remember me
              </label>
            </div>
            {# If you want to control the URL the user is redirected to on success
            <input type="hidden" name="_target_path" value="/account"/> #}
            <button class="btn btn-lg btn-outline-primary" type="submit">Sign in</button>
          </form><hr>
          <p><a href="{{ path('app_homepage')}}">Back to homepage</a></p>
        </div>
      </div>
    </div>

{% endblock %}

    



