<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" >

    <link rel="stylesheet" href="/css/tags.css">
    <link rel="stylesheet" href="/css/style.css">
    <link rel="stylesheet" href="/css/loader.css">

    <!-- stylesheet for fontawesome icons -->
    <link  rel="stylesheet" href="/css/all.min.css">
    <link rel="stylesheet" href="/css/fontawesome.min.css">

    <title>AUCTION</title>
</head>
<body>

    <%-include('./includes/header')%>

    <div class="header">
        <div class="back"><i class="fa fa-chevron-left"></i></div>
        <div class="tag-info">
            <div class="tag-title"><%=tagInfo.tag%></div>
            <div class="post-no"><span class="digit"><%=tagInfo.count%></span> <span class="text">posts</span></div>
        </div>
    </div>

    <section>
        <div class="topic">
            <div class="icon">
                <i class="fa fa-hashtag"></i>
            </div>
            <div class="tag-info">
                <div class="tag-title"><%=tagInfo.tag%></div>
                <div class="post-no"><span class="digit"><%=tagInfo.count%></span> <span class="text">posts</span></div>
            </div>
        </div>
        <div class="all-posts">
            <% for(var i = 0; i < tagPosts.length; i++) { %>
                <a href="/post/<%=tagPosts[i]._id%>"><img src="/assets/postpictures/<%=tagPosts[i].image%>"></a>
            <% } %>
        </div>
    </section>


    <footer>
        <div><a href="/home"><i class="fa fa-home"></i></a></div>
        <div><a href="/search"><i class="fa fa-search"></i></a></div>
        <div><a href="/newpost"><i class="fa fa-camera"></i></a></div>
        <!-- <div><a href="/notifications"><i class="fa fa-bell"></i></a></div> -->
        <div class="user-profile">
            <a href="/user/<%=userSession.username%>">
                <button class="with-image">
                    <% if(userSession.image) { %>
                        <Img src="/assets/profilepictures/<%=userSession.image%>">
                    <% } else { %>
                        <Img src="/assets/userpicture.png">
                    <% } %>
                    <div class="username"><%=userSession.username %></div>
                    <i class="fa fa-caret-down options-indicator"></i>
                </button>
            </a>
        </div>
    </footer>

    <div class="loader-wrapper">
        <div class="loadingio-spinner-rolling-r42hcymfq0f">
            <div class="ldio-jay0zj72el">
                <div></div>
            </div>
        </div>
    </div>
    <script src="/js/jquery-3.5.1.js"></script>
    <script src="/js/tags.js"></script>
    <script src="/js/search.js"></script>
</body>
</html>