<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/css/style.css">
    <script src="https://kit.fontawesome.com/2ecee89ad8.js" crossorigin="anonymous"></script>
    <title>CineWiki | Home</title>
</head>
<body>
    <%- include("./partials/header.ejs") %> 
    <main>
        <nav>
            <ul>
                <a href="/"> <li><i class="fa-solid fa-house"></i></li> </a>
                <a href="/register"> <li><i class="fa-solid fa-plus"></i></li> </a>
            </ul>
        </nav>
        <div class="films-container">
            <% movieList.forEach(element => { %>
                <a href="/details/<%= element.id %>"><article class="film-card">
                    <div id="image-box">
                        <img src="<%= element.poster_link %> " alt="<%= element.name %>">
                    </div>
                    <div id="card-info">
                        <span id="movie-name"><%= element.name %></span>
                    </div>
                </article></a>
                <div class="card-icons">
                    <a href="/delete/<%= element.id %>"><i class="fa-solid fa-trash-can"></i></a>
                    <a href="/edit/<%= element.id %> "><i class="fa-solid fa-pen"></i></a>
                </div>
            <% }) %>
        </div>
    </main>
    <%- include("./partials/footer.ejs") %>
</body>
</html>