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

  	<h2 class="block">Menu des pages</h2>
  	<aside class="menu">
		<ul class="menu-list" id="menuPages">
		    <c:forEach var="page" items="${listePages}">
		      <li>
		      	<button class="delete delete-page-btn is-pulled-right has-background-danger" data-id="${page.id}"></button>
		      	<a href="AfficherPage?id=${page.id}">${page.titre}</a>
		      	
		      </li>
		    </c:forEach>
		    <hr>
		    <c:forEach var="pagePartagees" items="${listePagesPartagees}">
		      <li>
		      	<i class="fa-solid fa-share-nodes is-pulled-right"></i>
		      	<a href="AfficherPage?id=${pagePartagees.id}">${pagePartagees.titre}</a>
		      </li>
		    </c:forEach>
		    <li>
		    	<form action="NouvellePage" method="POST">
			    	<input
					  class="input is-primary is-small"
					  type="text"
					  name="titre"
					  id="titrePage"
					  placeholder="Nom de votre nouvelle page"
					  onkeydown="if(event.key === 'Enter') this.form.submit();"
					>
				</form>
		  	</li>
		</ul>
	</aside>	