Ignore:
Timestamp:
07/07/23 12:14:58 (12 months ago)
Author:
HristijanMitic00 <hristijan.mitic.01@…>
Branches:
main
Parents:
1dd9226
Message:

First commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/resources/templates/cart.html

    r1dd9226 rd14176d  
    1 <!DOCTYPE html>
    2 <html lang="en">
    3 <head>
    4   <meta charset="UTF-8">
    5   <title>$Title$</title>
    6 </head>
    7 <body>
    8 $END$
    9 </body>
    10 </html>
     1<th:block xmlns:th="http://www.thymeleaf.org">
     2    <section class="jumbotron text-center">
     3        <div class="container">
     4            <h3 class="jumbotron-heading">Shopping cart for
     5                <th:block th:if="${#request.getRemoteUser() != null}" th:text="${#request.getRemoteUser()}"></th:block>
     6            </h3>
     7        </div>
     8    </section>
     9
     10    <div th:if="${hasError}">
     11        <h5 class="text-center text-danger" th:text="${error}"></h5>
     12    </div>
     13
     14    <div class="container mb-4">
     15        <div class="row">
     16            <div class="col-12" th:if="${products.size() > 0}">
     17                <div class="table-responsive">
     18                    <table class="table table-striped">
     19                        <thead>
     20                        <tr>
     21                            <th scope="col">Product</th>
     22                            <th scope="col">Total Price for product</th>
     23                            <th scope="col">Quantity</th>
     24                        </tr>
     25                        </thead>
     26                        <tbody>
     27                        <span th:each="p:${po}">
     28                        <tr th:each="product : ${products}" th:if="${product.getIdProdukt()}  == ${p.getIdProdukt()}" class="cart-item">
     29                            <td th:text="${product.getIme()}"></td>
     30                            <td th:text="${p.getCena()}">Cena</td>
     31                            <td th:text="${p.getKolicina()}"></td>
     32                        </tr>
     33                            </span>
     34                        </tbody>
     35                    </table>
     36
     37                    <div>
     38                        <label>Total price </label>
     39                    <span th:text="${order.getVkupnoSuma()}"></span></div>
     40
     41                    <form  th:action="@{'/order/{id}/success' (id=${order.getIdNaracka()})}" th:method="POST">
     42                        <label>Adresa za dostava</label>
     43                        <input type="text" name="address" id="address" placeholder="/">
     44                        <button type="submit"
     45                                class="btn btn-sm btn-primary cart-product">
     46                            <i class="fa fa-trash">Order</i>
     47                        </button>
     48                    </form>
     49                </div>
     50            </div>
     51        </div>
     52    </div>
     53</th:block>
     54
Note: See TracChangeset for help on using the changeset viewer.