<!DOCTYPE html>
<html>

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

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

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

        <div class="container">
            <br>

            <%if(Papers.length==0){%>
            <p class="flow-text">Papers repository currently empty...</p>
            <%}%>

            <ul class="collapsible popout">
                <%for(var i=0;i<Papers.length;i++){%>
                <li class="btnClose white">
                    <div class="row">
                        <div class="collapsible-header valign-wrapper">
                            <p class="flow-text col s9">
                                <%=Papers[i]._title%>
                            </p>
                            <i class="material-icons">keyboard_arrow_down</i>
                        </div>
                    </div>
                    <div class="btnClose collapsible-body">
                        <p class="flow-text">Introduction:
                            <%=Papers[i]._intro%>
                        </p>
                        <form method="POST" action="/review">
                            <div class="input-field">
                                <textarea id="textarea" class="materialize-textarea" data-length="325" name="FORAUTHOR"
                                    required="" aria-required="true"></textarea>
                                <label for="textarea">Comment for Author</label>
                            </div>
                            <div class="input-field">
                                <textarea id="textarea" class="materialize-textarea" data-length="325" name="FOREDITOR"
                                    required="" aria-required="true"></textarea>
                                <label for="textarea">Comment for Editor</label>
                            </div>
                            <div class="center">
                                <input type="hidden" name="PAPER" value="<%=Papers[i]._id%>">
                                <button type="submit" name="AS" value="accepted" class="z-depth-0 waves-effect waves-light btn-small marginAll">Accept</button>
                                <button type="submit" name="AS" value="rejected" class="z-depth-0 waves-effect waves-light btn-small marginAll red">Reject</button>
                                <a onclick="btnClose()" class="z-depth-0 waves-effect waves-light btn-small marginAll">Cancel</a>
                            </div>
                        </form>
                        <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>
                            </div>
                        </form>
                    </div>
                </li>
                <%}%>
            </ul>
        </div>
        <br>

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

</body>

</html>