Menu



Manage

Cord > Project_Bookmarket_따라하기 전체 다운로드
파일 목록
Project_Bookmarket_따라하기 > BookMarket/src/main/resources/templates/cart.html Lines 80 | 4.2 KB
다운로드

                        <html>
<head> 
    <meta charset="UTF-8">
    <title>장바구니</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <link href="/BookMarket/css/bootstrap.min.css" rel="stylesheet">
    <script src="/BookMarket/js/controllers.js"></script>
</head>
<body>
<div class="container py-4">
    <header class="pb-3 mb-4 border-bottom">  
        <div class="container d-flex flex-wrap justify-content-center">
            <a href="/BookMarket/home" class="d-flex align-items-center text-body-emphasis text-decoration-none mb-3 mb-lg-0 me-lg-auto">
                <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-book-half me-2" viewBox="0 0 16 16">
                    <path d="M8.5 2.687c.654-.689 1.782-.886 3.112-.752 1.234.124 2.503.523 3.388.893v9.923c-.918-.35-2.107-.692-3.287-.81-1.094-.111-2.278-.039-3.213.492zM8 1.783C7.015.936 5.587.81 4.287.94c-1.514.153-3.042.672-3.994 1.105A.5.5 0 0 0 0 2.5v11a.5.5 0 0 0 .707.455c.882-.4 2.303-.881 3.68-1.02 1.409-.142 2.59.087 3.223.877a.5.5 0 0 0 .78 0c.633-.79 1.814-1.019 3.222-.877 1.378.139 2.8.62 3.681 1.02A.5.5 0 0 0 16 13.5v-11a.5.5 0 0 0-.293-.455c-.952-.433-2.48-.952-3.994-1.105C10.413.809 8.985.936 8 1.783"/>
                </svg>
                <span class="fs-4">BookMarket</span>
            </a>
        </div>
    </header>

    <div class="p-5 mb-4 bg-body-tertiary rounded-3">
        <div class="container-fluid py-5">
            <h1 class="display-5 fw-bold">장바구니</h1>
            <p class="col-md-8 fs-4">BookMarket</p>       
        </div>
    </div>

    <div class="row align-items-md-stretch">
        <div class="col-md-12">
            <form name="clearForm" method="post">
                <input type="hidden" name="_method" value="delete"/>
                <a th:if="${cart != null}" th:href="|javascript:clearCart('${cart.cartId}')|" class="btn btn-danger" style="float:left">삭제하기</a>
                <a th:unless="${cart != null}" href="#" class="btn btn-secondary disabled" style="float:left">삭제하기</a>

                <a th:href="'/BookMarket/order/' + ${cartId}" class="btn btn-success text-right" style="float:right">주문하기</a>
            </form>
        </div>  
        <div style="padding-top: 50px">
            <table class="table table-hover">
                <tr>
                    <th>도서</th>
                    <th>가격</th>
                    <th>수량</th>
                    <th>소계</th>
                    <th>비고</th>
                    <th></th>
                </tr>

                <form name="removeForm" id="removeForm" method="post">
                    <input type="hidden" name="_method" value="delete"/>
                    <div th:if="${cart != null}">
                        <tr th:each="item:${cart.cartItems}">
                            <td th:text="${item.value.book.bookId} + ' - ' + ${item.value.book.name}"></td>
                            <td th:text="${item.value.book.unitPrice}"></td>
                            <td th:text="${item.value.quantity}"></td>
                            <td th:text="${item.value.totalPrice}"></td>
                            <td><a th:href="|javascript:removeFromCart('${item.value.book.bookId}')|"><span class="badge text-bg-danger" th:text="삭제"></span></a></td>
                            <td></td>
                        </tr>
                    </div>
                </form>
            </table>
        </div>
        <div class="text-end" style="padding-right:30px">
            <b>총액
                <span th:if="${cart != null}">
                    [[${cart.grandTotal}]]
                </span>
            </b>
        </div>
        <br>
        <a href="/BookMarket/books" class="btn btn-secondary">&laquo;쇼핑 계속하기</a>
        <footer class="pt-3 mt-4 text-body-secondary border-top">
            <span class="text-body-secondary"> &copy; BookMarket</span>
        </footer>
    </div>
</div>
</body>
</html>