<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <title>Getting Started: Serving Web Content</title>
        <!--/*/ <th:block th:include="fragments/head :: head"/> /*/-->
    </head>
    <body>
        <div class="container">
            <h1 th:text="'Hello, ' + ${name} + '!'"/>

            <div th:unless="${subject.authenticated}">
                <a th:href="@{/login.html}" class="btn btn-primary">Login</a>
            </div>
            <div th:if="${subject.authenticated}">
                <h4 th:text="'Principal: ' + ${subject.principal}"></h4>
                <form id="logoutForm" th:action="@{/logout}" method="post">
                    <input type="submit" class="btn btn-danger" value="Logout"/>
                </form>
            </div>

            <h4><a th:href="@{/account-info}" class="btn btn-primary">Account info</a>&nbsp;(Requires 'admin' role.)</h4>

        </div>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <script src="https://netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    </body>
</html>