diff options
Diffstat (limited to 'pyblackbird_cc/templates/payments')
-rw-r--r-- | pyblackbird_cc/templates/payments/cart_detail.html | 71 | ||||
-rw-r--r-- | pyblackbird_cc/templates/payments/cart_lineitem.html | 17 |
2 files changed, 51 insertions, 37 deletions
diff --git a/pyblackbird_cc/templates/payments/cart_detail.html b/pyblackbird_cc/templates/payments/cart_detail.html index 3f95b83..e38e2ae 100644 --- a/pyblackbird_cc/templates/payments/cart_detail.html +++ b/pyblackbird_cc/templates/payments/cart_detail.html @@ -6,45 +6,42 @@ <h1 class="mb-4">My basket</h1> <p class="text-body-secondary">{% lorem %}</p> {% if cart %} - <div class="my-5 bg-secondary-subtle border border-1 rounded border-dark"> - <div class="my-4 bg-white rounded"> - <table class="table"> - <thead> - <tr> - <th>Product</th> - <th>Price</th> - </tr> - </thead> - <tbody> - {% for item in cart.items.all %} - <tr> - <td> - <div class="d-flex flex-row justify-content-between"> - <p>TODO: we don't have access to thumbnails yet!</p> - <div> - {{ item.resource.name }} - </div> - {% for tn_url, tn_filename in item.resource.thumbnails %} - <p>{{ tn_url }}</p> - <div> - <img class="img-fluid rounded" src="{{ tn_url }}" alt=" {{ tn_filename }}"/> - </div> - {% endfor %} - </div> - </td> - <td>£{{ item.product.price }}</td> - </tr> - {% endfor %} - </tbody> - <tfoot> - <tr> - <th class="text-end">Total:</th> - <th>£{{ cart_total }}</th> - </tr> - </tfoot> - </table> + <div class="row justify-content-md-center"> + <div class="col-8 my-5 bg-secondary-subtle border border-1 rounded border-dark"> + <div class="my-4 bg-white rounded"> + + <div class="d-flex"> + </div> + + <table class="table"> + <thead> + <tr> + <th>Product</th> + <th>Price</th> + </tr> + </thead> + <tbody> + {% for item in cart.items.all %} + <tr> + <td> + {% include "payments/cart_lineitem.html" with item=item %} + </td> + <td>£{{ item.product.price }}</td> + </tr> + {% endfor %} + </tbody> + <tfoot> + <tr> + <th class="text-end">Total:</th> + <th>£{{ cart_total }}</th> + </tr> + </tfoot> + </table> + + </div> </div> + </div> <div class="d-flex justify-content-end"> <a href="#" class="btn btn-primary">Checkout</a> diff --git a/pyblackbird_cc/templates/payments/cart_lineitem.html b/pyblackbird_cc/templates/payments/cart_lineitem.html new file mode 100644 index 0000000..b639a7f --- /dev/null +++ b/pyblackbird_cc/templates/payments/cart_lineitem.html @@ -0,0 +1,17 @@ +<div class="container my-2"> + <div class="col-10"> + <div class="p-2 border border-1 border-success"> + {{ item.resource.name }} + </div> + <div class="p-2 border border-1 border-success"> + {{ item.resource.card_description }} + </div> + <div class="d-flex flex-row border border-2 border-danger p-1"> + {% for tn_url in item.resource.thumbnail_urls %} + <div class="flex-shrink border border-2 border-alert p-1"> + <img class="img-fluid rounded" src="{{ tn_url }}" alt="unknown"/> + </div> + {% endfor %} + </div> + </div> +</div> |