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

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>SpringFriend registration</title>

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

        <spring:url value="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" var="bootstrapCss" />
        <spring:url value="/resources/static/css/header.css" var="headerCss" />
        <spring:url value="/resources/static/css/footer.css" var="footerCss" />
        <spring:url value="/resources/static/css/registration.css" var="registrationCss" />
        <spring:url value="/resources/static/js/registration.js" var="registrationJs" />
        <link rel="stylesheet" href="${bootstrapCss}" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
        <link href="${headerCss}" rel="stylesheet" />
        <link href="${footerCss}" rel="stylesheet" />
        <link href="${registrationCss}" rel="stylesheet" />
        <script src="${registrationJs}"></script>
    </head>

    <body>
        <header>
            <div class="header-top" >
                <nav class="navbar navbar-inverse navbar-static-top" role="navigation" style="margin-bottom: 0" >
                    <div class="container" >
                        <div class="navbar-header" >
                            <a class="navbar-brand" href="/" >
                                <i class="glyphicon glyphicon-king" data-original-title title ></i>
                                <strong>Scrum</strong>Friend
                            </a>
                        </div>
                    </div>
                </nav>
            </div>
        </header>

        <div id="body">
            <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="forms">
                    <div class="sign-up">
                        <tiles:insertAttribute name="sign-up" />
                    </div>

                    <div class="sign-in">
                        <tiles:insertAttribute name="sign-in" />
                    </div>
                </div>
            </div>
        </div>

        <tiles:insertAttribute name="footer" />

        <c:if test="${registered}">
            <script>
                showSuccessMessage('Successfully registered. Please Sign in your account.');
            </script>
        </c:if>

        <c:if test="${logout}">
            <script>
                showSuccessMessage('Logged out from ScrumFriend successfully.');
            </script>
        </c:if>

        <spring:url value="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" var="bootstrapJs" />
        <spring:url value="/resources/static/js/header.js" var="headerJs" />
        <spring:url value="/resources/static/js/footer.js" var="footerJs" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <script src="${bootstrapJs}" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
        <script src="${headerJs}"></script>
    </body>
</html>