<!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">
    <!-- CSS only -->
	<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"
            integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
            crossorigin="anonymous">
    <title>Document</title>
	<link rel="stylesheet" type="text/css" href="/styles/admin.css">
</head>
<body>
	<div class = "container">
        <h1>A list of all articles that are waiting for an approval</h1>
    <div class = "row">
        <% articles.filter(article => !article.IsApproved).map(article => { %>
        <div class="col-md-4">
            <div class="card" style="width: 18rem;">
                <img src="" class="card-img-top" alt="">
                <div class="card-body">
                    <h5 class="card-title">Article Title: <%= article.Title %> </h5>
                    <p class="card-text">Author: <%= article.First_name %></p>
                    <a href="/taenpanel/articles/edit/<%= article.Id%>" class="btn btn-primary">Edit article</a>
                </div>
            </div>
        </div>
        <% })%>
    </div>
	    <h1>A list of all approved articles</h1>
    <div class = "row">
        <% articles.filter(article => article.IsApproved).map(article => { %>
        <div class="col-md-4">
            <div class="card" style="width: 18rem;">
                <img src="" class="card-img-top" alt="">
                <div class="card-body">
                    <h5 class="card-title">Article Title: <%= article.Title %> </h5>
                    <p class="card-text">Author: <%= article.First_name %></p>
                    <a href="/taenpanel/articles/edit/<%= article.Id%>" class="btn btn-primary">Edit article</a>
                </div>
            </div>
        </div>
        <% })%>
    </div>


	<h1>All available tags</h1>
    <div class = "row">
        <% tags.map(tag => { %>
        <div class="col-md-4">
            <div class="card" style="width: 18rem;">
                <img src="" class="card-img-top" alt="">
                <div class="card-body">
                    <h5 class="card-title">Tag Name: <%= tag.Name %> </h5>
                    <p class="card-text">Tag ID: <%= tag.Id %></p>
                </div>
            </div>
        </div>
        <% })%>
		<center>
		<br>
		<a href="/taenpanel/articles/tags" class="btn btn-primary">Add new tag</a>
		</center>
    </div>
</div>
</body>
