generated from Code-Institute-Org/gitpod-full-template
/
product_detail.html
167 lines (162 loc) · 8.12 KB
/
product_detail.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{% extends "base.html" %}
{% load static %}
{% block page_header %}
<div class="container header-container">
<div class="row">
<div class="col"></div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="overlay"></div>z
<!--product-details-wrapper-->
<section class="product-details-wrapper pt-lg-1">
<div class="container p-3 my-0 mx-auto">
<div class="row">
<div class="col-12 mt-5">
<h1 class="display-font text-center">{{ product.title }}</h1>
</div>
</div>
<!--product-image-row-->
<div class="row d-flex justify-content-between my-5 py-5 my-lg-5 pt-0 pt-lg-5">
<!-- product image card-->
<div class="col-sm-12 col-lg-6 my-0 mx-auto pt-sm-3">
{% if product.image.url %}
<div class="card my-0 align-items-center border-0 mx-auto mb-4 p-3">
<img id="productdetails1" class="img-fluid" oncontextmenu="return false"
onselectstart="return false" ondragstart="return false""
src=" {{ product.image.url }}" alt="{{ product.title }}"> </a>
{% else %}
<img id="productdetails2" class="img-fluid" src="{{ MEDIA_URL }}noimage.png"
alt="{{ product.title }}">
</div>
{% endif %}
</div>
</div>
<!--./end-product-image-card-->
<!--col-12-starts-here-->
<div class="col-sm-12 col-lg-6 my-0 mx-auto p-5 mt-sm-2">
<div class="me-lg-5 pb-3">
<div class="d-flex justify-content-between align-items-start mb-2">
<div class="col-6 text-start">
<h3 class="display-font heading-md">
{{ product.title }}</h3>
</div>
<div class="col-6 text-start">
<p class="fw-normal heading-md lead mb-0 text-end fw-bold">
${{ product.price }}
</p>
</div>
</div>
</div>
<div class="d-flex justify-content-between border-bottom py-2 my-3">
{% if product.medium %}
<div class="py-2">
<div class="fw-bold body-font text-dark">Medium</div>
</div>
<div class="body-font text-muted body-sm">{{ product.medium }}</div>
{% endif %}
</div>
{% if product.artwork_description %}
<div class="d-flex justify-content-between border-bottom py-2 my-3">
<div class="col-6">
<div class="fw-bold body-font text-dark">Prompt</div>
</div>
<div class="col-6">
<div class="body-font text-muted body-sm">{{ product.artwork_description }}</div>
</div>
</div>
{% endif %}
{% if product.orientation %}
<div class="d-flex justify-content-between border-bottom py-2 my-3">
<div class="py-2">
<div class="fw-bold body-font text-dark">Orientation</div>
</div>
{% if product.orientation == '3' %}
<div class="body-font text-muted body-sm">Portrait/Vertical</div>
{% endif %}
{% if product.orientation == '4' %}
<div class="body-font text-muted body-sm">Landscape/Horizontal</div>
{% endif %}
{% if product.orientation == '5' %}
<div class="body-font text-muted body-sm">Square</div>
{% endif %}
</div>
{% endif %}
<div class="row">
<div class=" d-flex justify-content-between border-0 py-2 my-3">
<form class="row" method="POST" action="{% url 'add_to_cart' product.id %}">
{% csrf_token %}
<div class="col-auto">
{% with product.has_dimensions as d %}
{% if d %}
<select class="form-select rounded-0 w-auto" name="product_dimension"
id='id_product_dimension'>
<option value="s">S</option>
<option value="m" selected>M</option>
<option value="l">L</option>
<option value="xl">XL</option>
</select>
</div>
{% endif %}
{% endwith %}
<!--quantity-input-->
<div class="d-flex justify-content-between border-0 py-2 my-3">
<div class="py-2">
<div class="fw-bold body-font text-dark">Quantity:</div>
</div>
<div class="col-auto input-group my-0 mx-auto justify-content-end pe-5">
<div class="bg-transparent border-0">
<button class="decrement-qty my-0 mx-auto btn rounded-0"
data-item_id="{{ product.id }}" id="decrement-qty_{{ product.id }}">
<span class="icon">
<i class="fas fa-minus fa-xs"></i>
</span>
</button>
</div>
<input class="form-control-sm qty_input body-small" type="number" name="quantity"
value="1" min="1" max="99" data-item_id="{{ product.id }}"
id="id_qty_{{ product.id }}">
<div class="bg-transparent border-0">
<button class="increment-qty btn rounded-0" data-item_id="{{ product.id }}"
id="increment-qty_{{ product.id }}">
<span class="icon">
<i class="fas fa-plus fa-xs"></i>
</span>
</button>
</div>
</div>
</div>
<!--./end-quantity-input-->
<!--buttons-row-->
<div class="row">
<div class="col-12 text-center pt-5 me-auto">
<a href="{% url 'shop' %}" class="btn btn-outline-dark btn-dark rounded-1">
<span class="icon text-light">
<i class="fas fa-chevron-left fa-sm"></i>
</span>
<span class="text-uppercase fw-bold text-light">Keep Shopping</span>
</a>
<div class="btn btn-outline-dark btn-dark text-light fw-bold rounded-1">
<input type="submit"
class="bg-transparent body-small border-0 text-light text-uppercase fw-bold "
value="Add to Cart">
<span class='icon text-center me-auto'>
<i class="fas fa-plus"></i>
</span>
</div>
<input type="hidden" name="redirect_url" value="{{ request.path }}">
</div>
<!--./end-buttons-row-->
</form>
</div>
<!--./-end-product-details-->
</div>
</section>
<!--./end-product-details-->
{% endblock %}
{% block postloadjs %}
{{ block.super }}
{% include 'shop/includes/qty-script.html' %}
<script src="{% static 'shop/js/shop.js' %}"></script>
{% endblock %}