<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
>
<head>
    <title>WebWolf</title>
    <div th:replace="~{fragments/header :: header-css}"/>
</head>
<body>

<div th:replace="~{fragments/header :: header}"/>

<div class="container">

    <div class="row" style="margin-top:100px">
        <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3" th:style="'background:url(' + @{/images/wolf.png} + ') no-repeat right;'">
            <form th:action="@{/login}" method="post">
                <fieldset>
                    <h2>Sign in</h2>
                    <br/>
                    <div th:if="${param.error}">
                        <div class="alert alert-danger">
                            Invalid username or password.
                        </div>
                    </div>
                    <div th:if="${param.logout}">
                        <div class="alert alert-info">
                            You have been logged out.
                        </div>
                    </div>

                    <div class="input-group mb-3">
                        <input type="text" name="username" id="username" class="form-control"
                               placeholder="Username WebGoat" required="true" autofocus="true"/>
                    </div>
                    <div class="input-group mb-3">
                        <input type="password" name="password" id="password" class="form-control"
                               placeholder="Password WebGoat" required="true"/>
                    </div>

                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <input type="submit" class="btn btn-lg btn-primary btn-block" value="Sign In"/>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6">
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
        <div th:if="${oauth}">
        <h3 class="form-signin-heading">Login with OAuth 2.0</h3>
            <table class="table table-striped">
                <tr><td></tr><a href="oauth2/authorization/github">GitHub</a></td></tr>
            </table>
        </div>
    </div>

</div>

<div th:replace="~{fragments/footer :: footer}"/>

</body>
</html>
