<!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">

    <title>Sucherergebnisse</title>
    <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
</head>

<body>
<!-- Dirty hack to align the heading.-->
<nav th:replace="fragments/header :: header">Header</nav>
<main class=" content-width">
    <div class="sidebar-layout" style="min-height: 75vh;">
        <nav th:replace="fragments/shop :: sidebar(categories=${categories})"></nav>
        <div class="content-width">
            <div class="detailgrid">
                <div class="s">

                    <h1 th:text="${article.title}"></h1>
                    <script th:src="@{/js/back.js}"></script>
                    <div class="back" data-group="shop" data-insert="true"></div>

                    <h2><span
                            th:text="${#numbers.formatDecimal(article.getPriceGross() * 0.01, 1, 'POINT', 2, 'COMMA')}"></span><span> EUR</span>
                    </h2>
                    <p th:text="${article.description}"></p>
                </div>
                <div class="s">
                    <img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}"/>
                </div>
                <div class="s"></div>
                <form class="s" method="POST">
                    <div class="detailgrid m">
                        <h2><span
                                th:text="${#numbers.formatDecimal(article.getPriceGross() * 0.01, 1, 'POINT', 2, 'COMMA')}"></span><span> EUR</span>
                        </h2>
                        <div>
                            <label class="nolinebreak">Menge:</label>
                            <select name="quantity" size="1">
                                <option th:each="quantity : ${#numbers.sequence(1,10)}"
                                        th:value="${quantity}"
                                        th:text="${quantity}"></option>
                            </select>
                        </div>
                        <h3 class="no-margin secondarytext" th:text="${inStock} ? 'AUF LAGER' : 'NICHT AUF LAGER'"></h3>
                        <button class="no-margin secondary" name="fastcheckout" value="false">In den Einkaufswagen
                        </button>
                        <button class="no-margin" name="fastcheckout" value="true">Schneller Checkout</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="sidebar-layout">
        <div></div>
        <div>
            <h1>Weitere Schnäppchen</h1>
            <div class='grid m base shadow'>
                <section th:each="article: ${commercialArticles}"><a
                        th:href="@{/shop/articles/{id}(id = ${article.id})}" class="section">
                    <img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}"/>
                    <h2 th:text="${article.title}"></h2>
                    <p class='price'><span
                            th:text="${#numbers.formatDecimal(article.getPriceGross() * 0.01, 1, 'POINT', 2, 'COMMA')}"></span><span> EUR</span>
                    </p>
                    <p th:text="${article.description}"></p>
                </a>
                </section>
            </div>
        </div>
</main>
<footer th:replace="fragments/footer :: footer"></footer>
</body>

</html>
