<!--
- Copyright 2019 Jason H House
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>Gaps</title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
    <link th:href="@{/images/gaps.ico}" rel="shortcut icon"/>
    <link th:href="@{/css/libraries/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/libraries/datatables.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/libraries/dataTables.bootstrap4.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/input.min.css}" rel="stylesheet">

    <!--Let browser know website is optimized for mobile-->
    <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
</head>

<body>
<div th:insert="fragments/header :: navBar"></div>

<div class="container">
    <h3 class="top-margin">RSS</h3>

    <div th:if="${!foundPlexLibraries}" th:remove="tag">
        <div class="top-margin bottom-margin">
            <div class="card mx-auto" style="width: 24rem;">
                <img loading="lazy" alt="..." class="card-img-top" th:src="@{/images/mind_the_gap.png}">
                <div class="card-body">
                    <h5 class="card-title">Your movies are really missing</h5>
                    <p class="card-text">You need to run Gaps at least once to have found the missing movies.</p>
                    <a class="btn btn-primary" th:href="@{/recommended}">Search</a>
                </div>
            </div>
        </div>
    </div>

    <div th:if="${foundPlexLibraries}" th:remove="tag">
        <p class="top-margin text-muted">Select the RSS feed to view.</p>

        <form action="/rss" class="top-margin" method="get">
            <div th:each="instance : ${plexServerMap}" class="form-check">
                <a th:href="(@{'/rss/'} + ${instance.value.getMachineIdentifier()} + '/' + ${instance.key.getKey()})"
                   th:text="${instance.value.getFriendlyName() + ' - ' + instance.key.getTitle()}">
                </a>
            </div>
        </form>
    </div>

</div>

<script th:src="@{/js/libraries/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/js/libraries/bootstrap.bundle.min.js}" type="text/javascript"></script>
</body>
</html>