<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<spring:url value="/resources/static/css/backlog.css" var="backlogCss" />
<link href="${backlogCss}" rel="stylesheet" />

<div class="container">
    <div class="feedback">
        <div class="alert alert-success general-success" role="alert">
            <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
            <span><strong>Success: </strong></span>
            <span class="text"></span>
            <span class="glyphicon glyphicon-remove"></span>
        </div>

        <div class="alert alert-danger general-error" role="alert">
            <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            <span class="sr-only">Error:</span>
            <span class="text"></span>
            <span class="glyphicon glyphicon-remove"></span>
        </div>
    </div>

    <div class="search-content">
        <div class="search-bar">
            <div class="row">
                <div class="col-lg-6">
                    <div class="input-group">
                        <input type="text" class="form-control" placeholder="Search for #ref or tags">

                        <span class="input-group-btn remove-search">
                            <button class="btn btn-secondary" type="button">
                                <span class="glyphicon glyphicon-remove"></span>
                            </button>
                        </span>

                        <span class="input-group-btn search">
                            <button class="btn btn-primary" type="button">
                                <span class="glyphicon glyphicon-search"></span>
                            </button>
                        </span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="tasks-content"></div>

    <button type="button" class="btn btn-info add-task-btn" data-toggle="modal" data-target="#add-task-modal">
        <span class="glyphicon glyphicon-plus"></span>
        Add a new task
    </button>

    <!-- modal add task -->
    <div class="modal fade" id="add-task-modal" tabindex="-1" role="dialog" aria-labelledby="#add-task-modal-label">
        <div class="modal-dialog">
            <div class="modal-content">
                <form id="add-task">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="add-task-modal-label">New task</h4>
                    </div>

                    <div class="modal-body">
                        <div class="taskType">
                            <select required>
                                <option value="">Select a type</option>
                                <option value="New feature">New feature</option>
                                <option value="Bug fix">Bug fix</option>
                                <option value="Spike">Spike</option>
                                <option value="Other">Other</option>
                            </select>
                        </div>

                        <input type="text" name="taskTitle" id="taskTitle" class="form-control" placeholder="Title" maxlength="50" required />
                        <input type="number" name="taskCost" id="taskCost" class="form-control" placeholder="Cost" min="0" max="300" />

                        <div id="summernote">Hello Summernote</div>

                        <div class="assignMemberTask">
                            <select>
                                <option value="">Assigned to</option>
                                <c:forEach var="member" items="${members}" >
                                    <option value="${member.email}">${member.firstName} ${member.lastName}</option>
                                </c:forEach>
                            </select>
                        </div>

                        <input type="text" name="taskTags" id="taskTags" class="form-control" placeholder="tag1 tag2 ... " maxlength="47" />

                        <div class="alert alert-danger" role="alert">
                            <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                            <span class="sr-only">Error:</span>
                            <span class="message"></span>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" id="add-task-close" class="btn btn-default" data-dismiss="modal">Cancel</button>
                        <button type="submit" id="add-task-btn" class="btn btn-primary">Add task</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<spring:url value="/resources/static/js/backlog.js" var="backlogJs" />
<script src="${backlogJs}"></script>