209 lines
9.2 KiB
HTML
209 lines
9.2 KiB
HTML
{% extends "dashboard/layout.html" %}
|
|
|
|
{% block title %}Shopping Cart - ThreeFold Dashboard{% endblock %}
|
|
|
|
{% block dashboard_content %}
|
|
<div class="my-4">
|
|
<!-- Header with marketplace navigation -->
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<div>
|
|
<h1 class="mb-1">
|
|
<i class="bi bi-cart3 me-2"></i>Shopping Cart
|
|
</h1>
|
|
<p class="lead mb-0">Review and manage your selected services</p>
|
|
</div>
|
|
<div class="d-flex gap-2">
|
|
<a href="/" class="btn btn-outline-primary">
|
|
<i class="bi bi-shop me-1"></i> Browse Marketplace
|
|
</a>
|
|
<a href="/orders" class="btn btn-outline-secondary">
|
|
<i class="bi bi-receipt me-1"></i> Order History
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Cart Content -->
|
|
<div class="row">
|
|
<!-- Cart Items -->
|
|
<div class="col-lg-8">
|
|
<div class="card shadow-sm">
|
|
<div class="card-header bg-light">
|
|
<h5 class="mb-0">
|
|
<i class="bi bi-list-ul me-2"></i>Cart Items
|
|
</h5>
|
|
</div>
|
|
<div class="card-body" id="cartItemsContainer">
|
|
<!-- Cart items will be loaded here -->
|
|
<div class="text-center py-5" id="emptyCartMessage">
|
|
<i class="bi bi-cart-x display-1 text-muted mb-3"></i>
|
|
<h4 class="text-muted">Your cart is empty</h4>
|
|
<p class="text-muted mb-4">Browse our marketplace to find services for your projects</p>
|
|
<a href="/marketplace" class="btn btn-primary">
|
|
<i class="bi bi-shop me-1"></i> Browse Marketplace
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Cart Summary -->
|
|
<div class="col-lg-4">
|
|
<div class="card shadow-sm">
|
|
<div class="card-header bg-light">
|
|
<h5 class="mb-0">
|
|
<i class="bi bi-calculator me-2"></i>Order Summary
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="summary-section" id="cartSummary">
|
|
<div class="d-flex justify-content-between mb-2">
|
|
<span>Subtotal:</span>
|
|
<span id="cartSubtotal">{{ currency_symbol | default(value="$") }}0.00</span>
|
|
</div>
|
|
<div class="d-flex justify-content-between mb-2">
|
|
<span>Estimated Deploy Time:</span>
|
|
<span id="cartDeployTime">0 minutes</span>
|
|
</div>
|
|
<hr>
|
|
<div class="d-flex justify-content-between mb-3">
|
|
<strong>Total:</strong>
|
|
<strong id="cartTotal">{{ currency_symbol | default(value="$") }}0.00</strong>
|
|
</div>
|
|
|
|
<!-- Wallet Balance Check -->
|
|
<div class="wallet-status mb-3">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<span>Your {{ display_currency | default(value="USD") }} Credits:</span>
|
|
<span class="fw-bold" id="userBalance">{{ currency_symbol | default(value="$") }}0.00</span>
|
|
</div>
|
|
<div class="balance-indicator mt-2" id="balanceIndicator">
|
|
<!-- Balance status will be shown here -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Action Buttons -->
|
|
<div class="d-grid gap-2">
|
|
<button class="btn btn-primary btn-lg" id="checkoutBtn" data-action="proceed-checkout" disabled>
|
|
<i class="bi bi-credit-card me-1"></i>
|
|
Proceed to Checkout
|
|
</button>
|
|
<button class="btn btn-outline-danger" id="clearCartBtn" disabled data-bs-toggle="modal" data-bs-target="#clearCartModal">
|
|
<i class="bi bi-trash me-1"></i>
|
|
Clear Cart
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Actions -->
|
|
<div class="card shadow-sm mt-3">
|
|
<div class="card-header bg-light">
|
|
<h6 class="mb-0">
|
|
<i class="bi bi-lightning me-2"></i>Quick Actions
|
|
</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="d-grid gap-2">
|
|
<a href="/dashboard/wallet" class="btn btn-outline-success btn-sm">
|
|
<i class="bi bi-wallet2 me-1"></i>
|
|
Top Up Wallet
|
|
</a>
|
|
<button class="btn btn-outline-info btn-sm" data-action="save-for-later">
|
|
<i class="bi bi-bookmark me-1"></i>
|
|
Save for Later
|
|
</button>
|
|
<button class="btn btn-outline-secondary btn-sm" data-action="share-cart">
|
|
<i class="bi bi-share me-1"></i>
|
|
Share Cart
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Cart Item Template -->
|
|
<template id="cartItemTemplate">
|
|
<div class="cart-item border-bottom py-3" data-item-id="">
|
|
<div class="row align-items-center">
|
|
<div class="col-md-6">
|
|
<div class="d-flex align-items-center">
|
|
<div class="service-icon me-3">
|
|
<i class="bi bi-server display-6 text-primary"></i>
|
|
</div>
|
|
<div>
|
|
<h6 class="mb-1 service-name"></h6>
|
|
<p class="text-muted mb-0 service-specs"></p>
|
|
<small class="text-muted added-time"></small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3 text-center">
|
|
<div class="price-display">
|
|
<span class="h5 mb-0 service-price"></span>
|
|
<small class="text-muted d-block">per month</small>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3 text-end">
|
|
<div class="item-actions d-flex align-items-center">
|
|
<!-- Quantity Controls -->
|
|
<div class="quantity-controls d-flex align-items-center me-3">
|
|
<button class="btn btn-sm btn-outline-secondary" data-action="decrease-qty" title="Decrease quantity">
|
|
<i class="bi bi-dash"></i>
|
|
</button>
|
|
<span class="quantity-display mx-2 fw-bold" style="min-width: 30px; text-align: center;">1</span>
|
|
<button class="btn btn-sm btn-outline-secondary" data-action="increase-qty" title="Increase quantity">
|
|
<i class="bi bi-plus"></i>
|
|
</button>
|
|
</div>
|
|
<!-- Remove Button -->
|
|
<button class="btn btn-sm btn-outline-danger" data-action="remove-item" title="Remove item">
|
|
<i class="bi bi-trash"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- Clear Cart Confirmation Modal (Dashboard) -->
|
|
<div class="modal fade" id="clearCartModal" tabindex="-1" aria-labelledby="clearCartModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="clearCartModalLabel"><i class="bi bi-trash me-2"></i>Clear Cart</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
Are you sure you want to clear your cart? This action cannot be undone.
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-danger" id="confirmClearCartBtn" data-action="confirm-clear-cart">
|
|
<i class="bi bi-trash me-1"></i> Clear Cart
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block hydration %}
|
|
{{ super() }}
|
|
<script id="hydration-dashboard-cart" type="application/json">
|
|
{
|
|
"currency_symbol": {{ currency_symbol | default(value="$") | json_encode() }},
|
|
"display_currency": {{ display_currency | default(value="USD") | json_encode() }}
|
|
}
|
|
</script>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
{{ super() }}
|
|
<script src="/static/js/dashboard_cart.js"></script>
|
|
{% endblock %}
|