<!DOCTYPE html>
<html>

<head>
    <% include ./Layout/Head.ejs %>
</head>

<body>
    <div id="root" class="g4caf50">

        <% include ./Layout/Navbar.ejs %>
        <!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->

        <p class="themePrimary white-text center flow-text">Unassigned</p>
        <div class="container">
            <ul class="collapsible popout">
                <%for(var i=0;i<Papers.length;i++){%>
                <%if(Papers[i]._status=='unassigned'){%>
                <li class="btnClose white">
                    <div class="row">
                        <div class="collapsible-header valign-wrapper">
                            <p class="flow-text col s5">
                                <%=Papers[i]._title%>
                            </p>
                            <p class="flow-text col s1"> | </p>
                            <p class="flow-text col s5">
                                <%=Papers[i]._author%>
                            </p>
                            <i class="material-icons">keyboard_arrow_down</i>
                        </div>
                    </div>
                    <div class="btnClose collapsible-body">
                        <blockquote>
                            <p class="flow-text"><b>Introduction:</b>
                                <%=Papers[i]._intro%>
                            </p>
                        </blockquote>
                        <form method="POST" action="/assign">
                            <div class="center">
                                <input hidden name="PAPER" value="<%=Papers[i]._id%>" />
                                <button class="btn waves-effect waves-light themeAccent z-depth-0 btn-small marginAll"
                                    type="submit" name="CONFERENCE" value="<%=Papers[i]._conference%>">Assign Reviewers</button>
                                <a onclick="btnClose()" class="z-depth-0 waves-effect waves-light btn-small marginAll">Close</a>
                            </div>
                        </form>
                        <form method="GET" action="/paper">
                            <div class="center">
                                <input hidden name="PAPER" value="<%=Papers[i]._id%>" />
                                <button type="submit" name="AS" value="view" class="z-depth-0 waves-effect waves-light btn-small marginAll">View</button>
                            </div>
                        </form>
                    </div>
                </li>
                <%}}%>
            </ul>
        </div>
        <br>

        <p class="themePrimary white-text center flow-text">Assigned</p>
        <div class="container">
            <ul class="collapsible popout">
                <%for(var i=0;i<Papers.length;i++){%>
                <%if(Papers[i]._status=='assigned'){%>
                <li class="btnClose white">
                    <div class="row">
                        <div class="collapsible-header valign-wrapper">
                            <p class="flow-text col s5">
                                <%=Papers[i]._title%>
                            </p>
                            <p class="flow-text col s1"> | </p>
                            <p class="flow-text col s5">
                                <%=Papers[i]._author%>
                            </p>
                            <i class="material-icons">keyboard_arrow_down</i>
                        </div>
                    </div>
                    <div class="btnClose collapsible-body">
                        <blockquote>
                            <p class="flow-text"><b>Introduction:</b>
                                <%=Papers[i]._intro%>
                            </p>
                        </blockquote>

                        <%for(var j=0;j<Papers[i]._reviews.length;j++){%>
                        <blockquote>
                            <p class="flow-text"><b>Reviewer
                                    <%=j+1%>:</b>
                                <%=Papers[i]._reviews[j]._comment4author%>
                            </p>
                            <p><b>Reviewer has: </b>
                                <%=Papers[i]._reviews[j]._tempStatus%>
                            </p>
                            <p><b>Notes:</b>
                                <%=Papers[i]._reviews[j]._comment4editor%>
                            </p>
                        </blockquote>
                        <%}%>

                        <form method="POST" action="/paper">
                            <div class="center">
                                <input hidden name="PAPER" value="<%=Papers[i]._id%>" />
                                <button type="submit" name="STATUS" value="accepted" class="z-depth-0 waves-effect waves-light btn-small marginAll">Accept</button>
                                <button type="submit" name="STATUS" value="rejected" class="red z-depth-0 waves-effect waves-light btn-small marginAll">Reject</button>
                                <a onclick="btnClose()" class="z-depth-0 waves-effect waves-light btn-small marginAll">Close</a>
                            </div>
                        </form>
                        <form method="GET" action="/paper">
                            <div class="center">
                                <input hidden name="PAPER" value="<%=Papers[i]._id%>" />
                                <button type="submit" name="AS" value="view" class="z-depth-0 waves-effect waves-light btn-small marginAll">View</button>
                            </div>
                        </form>
                    </div>
                </li>
                <%}}%>
            </ul>
        </div>
        <br>

        <p class="themePrimary white-text center flow-text">Accepted</p>
        <div class="container">
            <ul class="collapsible popout">
                <%for(var i=0;i<Papers.length;i++){%>
                <%if(Papers[i]._status=='accepted'){%>
                <li class="btnClose white">
                    <div class="row">
                        <div class="collapsible-header valign-wrapper">
                            <p class="flow-text col s5">
                                <%=Papers[i]._title%>
                            </p>
                            <p class="flow-text col s1"> | </p>
                            <p class="flow-text col s5">
                                <%=Papers[i]._author%>
                            </p>
                            <i class="material-icons">keyboard_arrow_down</i>
                        </div>
                    </div>
                    <div class="btnClose collapsible-body">
                        <blockquote>
                            <p class="flow-text"><b>Introduction:</b>
                                <%=Papers[i]._intro%>
                            </p>
                        </blockquote>
                        <%for(var k=0;k<Papers[i]._reviews.length;k++){%>
                        <blockquote>
                            <p class="flow-text"><b>Reviewer
                                    <%=k+1%>:</b>
                                <%=Papers[i]._reviews[k]._comment4author%>
                            </p>
                        </blockquote>
                        <%}%>

                        <form method="POST" action="/paper">
                            <div class="center">
                                <input hidden name="PAPER" value="<%=Papers[k]._id%>" />
                                <button type="submit" name="STATUS" value="published" class="z-depth-0 waves-effect waves-light btn-small marginAll">Publish</button>
                                <a onclick="btnClose()" class="z-depth-0 waves-effect waves-light btn-small marginAll">Close</a>
                            </div>
                        </form>
                        <form method="GET" action="/paper">
                            <div class="center">
                                <input hidden name="PAPER" value="<%=Papers[k]._id%>" />
                                <button type="submit" name="AS" value="view" class="z-depth-0 waves-effect waves-light btn-small marginAll">View</button>
                            </div>
                        </form>
                    </div>
                </li>
                <%}}%>
            </ul>
        </div>
        <br>

        <p class="themePrimary white-text center flow-text">Rejected</p>
        <div class="container">
            <ul class="collapsible popout">
                <%for(var i=0;i<Papers.length;i++){%>
                <%if(Papers[i]._status=='rejected'){%>
                <li class="btnClose white">
                    <div class="row">
                        <div class="collapsible-header valign-wrapper">
                            <p class="flow-text col s5">
                                <%=Papers[i]._title%>
                            </p>
                            <p class="flow-text col s1"> | </p>
                            <p class="flow-text col s5">
                                <%=Papers[i]._author%>
                            </p>
                            <i class="material-icons">keyboard_arrow_down</i>
                        </div>
                    </div>
                    <div class="btnClose collapsible-body">
                        <blockquote>
                            <p class="flow-text"><b>Introduction:</b>
                                <%=Papers[i]._intro%>
                            </p>
                        </blockquote>
                        <%for(var l=0;l<Papers[i]._reviews.length;l++){%>
                        <blockquote>
                            <p class="flow-text"><b>Reviewer
                                    <%=l+1%>:</b>
                                <%=Papers[i]._reviews[l]._comment4author%>
                            </p>
                        </blockquote>
                        <%}%>

                        <form method="GET" action="/paper">
                            <div class="center">
                                <input type="hidden" name="PAPER" value="<%=Papers[i]._id%>">
                                <button type="submit" name="AS" value="view" class="z-depth-0 waves-effect waves-light btn-small marginAll">View</button>
                                <a onclick="btnClose()" class="z-depth-0 waves-effect waves-light btn-small marginAll">Close</a>
                            </div>
                        </form>
                    </div>
                </li>
                <%}}%>
            </ul>
        </div>
        <br>

        <!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
        <% include ./Layout/Footer.ejs %>
    </div>
    <!-- //////////////////////////////////////////////////////////////////////////////////// -->
    <% include ./Layout/ScriptTag.ejs %>

</body>

</html>