<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<jsp:include page="Header.jsp">
	<jsp:param name="titre" value="Accueil" />
</jsp:include>

<c:set var="erreur" value="${erreur}" />

	
	<c:if test="${erreur == 1}">
	    <div class="columns is-centered">
	      <div class="column is-half">
	        <article class="message is-danger">
	          <div class="message-header">
	            <p>Erreur</p>
	          </div>
	          <div class="message-body">
	            <p>Mauvais login ou mot de passe.</p>
	          </div>
	        </article>
	      </div>
	    </div>
	</c:if>
	
	<c:if test="${erreur == 2}">
	    <div class="columns is-centered">
	      <div class="column is-half">
	        <article class="message is-danger">
	          <div class="message-header">
	            <p>Erreur</p>
	          </div>
	          <div class="message-body">
	            <p>Login déjà utilisé.</p>
	          </div>
	        </article>
	      </div>
	    </div>
	</c:if>
	
	<div class="columns is-centered">
	  <div class="column is-half">
	    <form class="box" method="post" action=".">
	      
	      <div class="field">
	        <label class="label" for="login">Login</label>
	        <div class="control">
	          <input 
	            class="input" 
	            type="text" 
	            name="login" 
	            id="login"
	            value="${erreur == 1 ? param.login : ''}"
	            placeholder="Entrez votre login">
	        </div>
	      </div>
	
	      <div class="field">
	        <label class="label" for="mdp">Mot de passe</label>
	        <div class="control">
	          <input
	          	class="input"
	          	type="password"
	          	name="mdp"
	          	id="mdp"
	          	placeholder="Entrez votre mot de passe" >
	        </div>
	      </div>
	
	      <button class="button is-primary" name="action" value="connexion">Se connecter</button>
	      <button class="button is-primary is-light" name="action" value="inscription">S'inscrire</button>
	    </form>
	  </div>
	</div>

<jsp:include page="Footer.jsp" />