2024年6月4日 星期二

在Django網站中採用Bootstrap 5 電子商務樣版 - 迴圈和條件判斷





















index.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
<!DOCTYPE html>
<html lang="en">

    <head>
        {% load static %}	
        <meta charset="utf-8">
        <title>Fruitables - Vegetable Website Template</title>
        <meta content="width=device-width, initial-scale=1.0" name="viewport">
        <meta content="" name="keywords">
        <meta content="" name="description">

        <!-- Google Web Fonts -->
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Raleway:wght@600;800&display=swap" rel="stylesheet"> 

        <!-- Icon Font Stylesheet -->
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"/>
        <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">

        <!-- Libraries Stylesheet -->
        <link href="{% static 'lib/lightbox/css/lightbox.min.css' %}" rel="stylesheet">
        <link href="{% static 'lib/owlcarousel/assets/owl.carousel.min.css' %}" rel="stylesheet">


        <!-- Customized Bootstrap Stylesheet -->
        <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">

        <!-- Template Stylesheet -->
        <link href="{% static 'css/style.css' %}" rel="stylesheet">
    </head>

    <body>

        <!-- Spinner Start -->
        <div id="spinner" class="show w-100 vh-100 bg-white position-fixed translate-middle top-50 start-50  d-flex align-items-center justify-content-center">
            <div class="spinner-grow text-primary" role="status"></div>
        </div>
        <!-- Spinner End -->


        <!-- Navbar start -->
        <div class="container-fluid fixed-top">
            <div class="container topbar bg-primary d-none d-lg-block">
                <div class="d-flex justify-content-between">
                    <div class="top-info ps-2">
		    {% for item in topinfo %}
                        <small class="me-3"><i class="fas {{ item.icon }} me-2 text-secondary"></i> <a href="{{ item.href }}" class="text-white">{{ item.text }}</a></small>
                    {% endfor %}
		    </div>
                    <div class="top-link pe-2">
		    {% for item in toplink %}
                        <a href="{{ item.href }}" class="text-white"><small class="text-white mx-2">{{ item.text }}</small>/</a>
                    {% endfor %}
		    </div>
                </div>
            </div>
            <div class="container px-0">
                <nav class="navbar navbar-light bg-white navbar-expand-xl">
                    <a href="index" class="navbar-brand"><h1 class="text-primary display-6">Fruitables</h1></a>
                    <button class="navbar-toggler py-2 px-3" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse">
                        <span class="fa fa-bars text-primary"></span>
                    </button>
                    <div class="collapse navbar-collapse bg-white" id="navbarCollapse">
                        <div class="navbar-nav mx-auto">
                            <a href="index.html" class="nav-item nav-link active">Home</a>
                            <a href="shop.html" class="nav-item nav-link">Shop</a>
                            <a href="shop-detail.html" class="nav-item nav-link">Shop Detail</a>
                            <div class="nav-item dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">Pages</a>
                                <div class="dropdown-menu m-0 bg-secondary rounded-0">
                                    <a href="cart.html" class="dropdown-item">Cart</a>
                                    <a href="chackout.html" class="dropdown-item">Chackout</a>
                                    <a href="testimonial.html" class="dropdown-item">Testimonial</a>
                                    <a href="404.html" class="dropdown-item">404 Page</a>
                                </div>
                            </div>
                            <a href="contact.html" class="nav-item nav-link">Contact</a>
                        </div>
                        <div class="d-flex m-3 me-0">
                            <button class="btn-search btn border border-secondary btn-md-square rounded-circle bg-white me-4" data-bs-toggle="modal" data-bs-target="#searchModal"><i class="fas fa-search text-primary"></i></button>
                            <a href="#" class="position-relative me-4 my-auto">
                                <i class="fa fa-shopping-bag fa-2x"></i>
                                <span class="position-absolute bg-secondary rounded-circle d-flex align-items-center justify-content-center text-dark px-1" style="top: -5px; left: 15px; height: 20px; min-width: 20px;">3</span>
                            </a>
                            <a href="#" class="my-auto">
                                <i class="fas fa-user fa-2x"></i>
                            </a>
                        </div>
                    </div>
                </nav>
            </div>
        </div>
        <!-- Navbar End -->


        <!-- Modal Search Start -->
        <div class="modal fade" id="searchModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-fullscreen">
                <div class="modal-content rounded-0">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel">Search by keyword</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                    </div>
                    <div class="modal-body d-flex align-items-center">
                        <div class="input-group w-75 mx-auto d-flex">
                            <input type="search" class="form-control p-3" placeholder="keywords" aria-describedby="search-icon-1">
                            <span id="search-icon-1" class="input-group-text p-3"><i class="fa fa-search"></i></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Modal Search End -->


        <!-- Hero Start -->
        <div class="container-fluid py-5 mb-5 hero-header">
            <div class="container py-5">
                <div class="row g-5 align-items-center">
                    <div class="col-md-12 col-lg-7">
                        <h4 class="mb-3 text-secondary">100% Organic Foods</h4>
                        <h1 class="mb-5 display-3 text-primary">Organic Veggies & Fruits Foods</h1>
                        <div class="position-relative mx-auto">
                            <input class="form-control border-2 border-secondary w-75 py-3 px-4 rounded-pill" type="number" placeholder="Search">
                            <button type="submit" class="btn btn-primary border-2 border-secondary py-3 px-4 position-absolute rounded-pill text-white h-100" style="top: 0; right: 25%;">Submit Now</button>
                        </div>
                    </div>
                    <div class="col-md-12 col-lg-5">
                        <div id="carouselId" class="carousel slide position-relative" data-bs-ride="carousel">
                            <div class="carousel-inner" role="listbox">
                                {% for item in carousel %}
				<div class="carousel-item {{ item.active }} {{ item.rounded }}">
                                    <img src="{% static 'img/' %}{{ item.img }}" class="img-fluid w-100 h-100 bg-secondary rounded" alt="First slide">
                                    <a href="{{ item.href }}" class="btn px-4 py-2 text-white rounded">{{ item.title }}</a>
                                </div>
                                {% endfor %}
                            </div>
                            <button class="carousel-control-prev" type="button" data-bs-target="#carouselId" data-bs-slide="prev">
                                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                                <span class="visually-hidden">Previous</span>
                            </button>
                            <button class="carousel-control-next" type="button" data-bs-target="#carouselId" data-bs-slide="next">
                                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                                <span class="visually-hidden">Next</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Hero End -->


        <!-- Featurs Section Start -->
        <div class="container-fluid featurs py-5">
            <div class="container py-5">
                <div class="row g-4">
					{% for featur in featurs %}
                    <div class="col-md-6 col-lg-3">
                        <div class="featurs-item text-center rounded bg-light p-4">
                            <div class="featurs-icon btn-square rounded-circle bg-secondary mb-5 mx-auto">
                                <i class="fas {{ featur.icon }} fa-3x text-white"></i>
                            </div>
                            <div class="featurs-content text-center">
                                <h5>{{ featur.title }}</h5>
                                <p class="mb-0">{{ featur.content }}</p>
                            </div>
                        </div>
                    </div>
					{% endfor %}
                </div>
            </div>
        </div>
        <!-- Featurs Section End -->


        <!-- Fruits Shop Start-->
        <div class="container-fluid fruite py-5">
            <div class="container py-5">
                <div class="tab-class text-center">
                    <div class="row g-4">
                        <div class="col-lg-4 text-start">
                            <h1>Our Organic Products</h1>
                        </div>
                        <div class="col-lg-8 text-end">
                            <ul class="nav nav-pills d-inline-flex text-center mb-5">
                                {% for item in nav %}
								<li class="nav-item">
                                    <a class="d-flex m-2 py-2 bg-light rounded-pill {{ item.active }}" data-bs-toggle="pill" href="{{ item.href }}">
                                        <span class="text-dark" style="width: 130px;">{{ item.title }}</span>
                                    </a>
                                </li>
                                {% endfor %}
                            </ul>
                        </div>
                    </div>
                    <div class="tab-content">
                        {% for tab in tabContent %}
						<div id="{{ tab.id }}" class="tab-pane fade show p-0 {{ tab.active }}">
                            <div class="row g-4">
                                <div class="col-lg-12">
                                    <div class="row g-4">
                                        {% for item in tab.content %}
										<div class="col-md-6 col-lg-4 col-xl-3">
                                            <div class="rounded position-relative fruite-item">
                                                <div class="fruite-img">
                                                    <img src="{% static 'img/' %}{{ item.img }}" class="img-fluid w-100 rounded-top" alt="">
                                                </div>
                                                <div class="text-white bg-secondary px-3 py-1 rounded position-absolute" style="top: 10px; left: 10px;">Fruits</div>
                                                <div class="p-4 border border-secondary border-top-0 rounded-bottom">
                                                    <h4>{{ item.title }}</h4>
                                                    <p>{{ item.content }}</p>
                                                    <div class="d-flex justify-content-between flex-lg-wrap">
                                                        <p class="text-dark fs-5 fw-bold mb-0">${{ item.price }} / kg</p>
                                                        <a href="{{ item.href }}" class="btn border border-secondary rounded-pill px-3 text-primary"><i class="fa fa-shopping-bag me-2 text-primary"></i> Add to cart</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {% endfor %}
                                    </div>
                                </div>
                            </div>
                        </div>
                        {% endfor %}
                    </div>
                </div>      
            </div>
        </div>
        <!-- Fruits Shop End-->


        <!-- Featurs Start -->
        <div class="container-fluid service py-5">
            <div class="container py-5">
                <div class="row g-4 justify-content-center">
                    {% for item in FeatursStart %}
					<div class="col-md-6 col-lg-4">
                        <a href="#">
                            <div class="service-item bg-secondary rounded border border-secondary">
                                <img src="{% static 'img/'%}{{ item.img }}" class="img-fluid rounded-top w-100" alt="">
                                <div class="px-4 rounded-bottom">
                                    <div class="service-content bg-primary text-center p-4 rounded">
                                        <h5 class="text-white">{{ item.title }}</h5>
                                        <h3 class="mb-0">{{ item.feature }}</h3>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </div>
					{% endfor %}
                </div>
            </div>
        </div>
        <!-- Featurs End -->


        <!-- Vesitable Shop Start-->
        <div class="container-fluid vesitable py-5">
            <div class="container py-5">
                <h1 class="mb-0">Fresh Organic Vegetables</h1>
                <div class="owl-carousel vegetable-carousel justify-content-center">
                    {% for item in VesitableShopStart %}
					<div class="border border-primary rounded position-relative vesitable-item">
                        <div class="vesitable-img">
                            <img src="{% static 'img/'%}{{ item.img }}" class="img-fluid w-100 rounded-top" alt="">
                        </div>
                        <div class="text-white bg-primary px-3 py-1 rounded position-absolute" style="top: 10px; right: 10px;">{{ item.class }}</div>
                        <div class="p-4 rounded-bottom">
                            <h4>{{ item.title }}</h4>
                            <p>{{ item.content }}</p>
                            <div class="d-flex justify-content-between flex-lg-wrap">
                                <p class="text-dark fs-5 fw-bold mb-0">${{ item.price }} / kg</p>
                                <a href="{{ item.href }}" class="btn border border-secondary rounded-pill px-3 text-primary"><i class="fa fa-shopping-bag me-2 text-primary"></i> Add to cart</a>
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
        </div>
        <!-- Vesitable Shop End -->


        <!-- Banner Section Start-->
        <div class="container-fluid banner bg-secondary my-5">
            <div class="container py-5">
                <div class="row g-4 align-items-center">
                    <div class="col-lg-6">
                        <div class="py-4">
                            <h1 class="display-3 text-white">Fresh Exotic Fruits</h1>
                            <p class="fw-normal display-3 text-dark mb-4">in Our Store</p>
                            <p class="mb-4 text-dark">The generated Lorem Ipsum is therefore always free from repetition injected humour, or non-characteristic words etc.</p>
                            <a href="#" class="banner-btn btn border-2 border-white rounded-pill text-dark py-3 px-5">BUY</a>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="position-relative">
                            <img src="{% static 'img/baner-1.png' %}" class="img-fluid w-100 rounded" alt="">
                            <div class="d-flex align-items-center justify-content-center bg-white rounded-circle position-absolute" style="width: 140px; height: 140px; top: 0; left: 0;">
                                <h1 style="font-size: 100px;">1</h1>
                                <div class="d-flex flex-column">
                                    <span class="h2 mb-0">50$</span>
                                    <span class="h4 text-muted mb-0">kg</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Banner Section End -->


        <!-- Bestsaler Product Start -->
        <div class="container-fluid py-5">
            <div class="container py-5">
                <div class="text-center mx-auto mb-5" style="max-width: 700px;">
                    <h1 class="display-4">Bestseller Products</h1>
                    <p>Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable.</p>
                </div>
                <div class="row g-4">
                    {% for item in BestsellerProductsType1 %}
					<div class="col-lg-6 col-xl-4">
                        <div class="p-4 rounded bg-light">
                            <div class="row align-items-center">
                                <div class="col-6">
                                    <img src="{% static 'img/' %}{{ item.img }}" class="img-fluid rounded-circle w-100" alt="">
                                </div>
                                <div class="col-6">
                                    <a href="#" class="h5">{{ item.title }}</a>
                                    <div class="d-flex my-3">
                                    {% for i in item.star %}
										{% if i == 1 %}
										<i class="fas fa-star text-primary"></i>
										{% else %}
                                        <i class="fas fa-star"></i>
										{% endif %}
                                    {% endfor %}
									</div>
                                    <h4 class="mb-3">{{ item.price }} $</h4>
                                    <a href="{{ item.href }}" class="btn border border-secondary rounded-pill px-3 text-primary"><i class="fa fa-shopping-bag me-2 text-primary"></i> Add to cart</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                    {% for item in BestsellerProductsType2 %}
					<div class="col-md-6 col-lg-6 col-xl-3">
                        <div class="text-center">
                            <img src="{% static 'img/' %}{{ item.img }}" class="img-fluid rounded" alt="">
                            <div class="py-4">
                                <a href="#" class="h5">{{ item.title }}</a>
                                <div class="d-flex my-3 justify-content-center">
                                    {% for i in item.star %}
										{% if i == 1 %}
										<i class="fas fa-star text-primary"></i>
										{% else %}
                                        <i class="fas fa-star"></i>
										{% endif %}
                                    {% endfor %}								
                                </div>
                                <h4 class="mb-3">{{ item.price }} $</h4>
                                <a href="{{ item.href }}" class="btn border border-secondary rounded-pill px-3 text-primary"><i class="fa fa-shopping-bag me-2 text-primary"></i> Add to cart</a>
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
        </div>
        <!-- Bestsaler Product End -->


        <!-- Fact Start -->
        <div class="container-fluid py-5">
            <div class="container">
                <div class="bg-light p-5 rounded">
                    <div class="row g-4 justify-content-center">
                        {% for item in FactStart %}
						<div class="col-md-6 col-lg-6 col-xl-3">
                            <div class="counter bg-white rounded p-5">
                                <i class="fa {{ item.icon }} text-secondary"></i>
                                <h4>{{ item.title }}</h4>
                                <h1>{{ item.content }}</h1>
                            </div>
                        </div>
                        {% endfor %}
                    </div>
                </div>
            </div>
        </div>
        <!-- Fact Start -->


        <!-- Tastimonial Start -->
        <div class="container-fluid testimonial py-5">
            <div class="container py-5">
                <div class="testimonial-header text-center">
                    <h4 class="text-primary">Our Testimonial</h4>
                    <h1 class="display-5 mb-5 text-dark">Our Client Saying!</h1>
                </div>
                <div class="owl-carousel testimonial-carousel">
                    {% for item in TastimonialStart %}
					<div class="testimonial-item img-border-radius bg-light rounded p-4">
                        <div class="position-relative">
                            <i class="fa fa-quote-right fa-2x text-secondary position-absolute" style="bottom: 30px; right: 0;"></i>
                            <div class="mb-4 pb-4 border-bottom border-secondary">
                                <p class="mb-0">{{ item.content }}
                                </p>
                            </div>
                            <div class="d-flex align-items-center flex-nowrap">
                                <div class="bg-secondary rounded">
                                    <img src="{% static 'img/testimonial-1.jpg' %}" class="img-fluid rounded" style="width: 100px; height: 100px;" alt="">
                                </div>
                                <div class="ms-4 d-block">
                                    <h4 class="text-dark">{{ item.name }}</h4>
                                    <p class="m-0 pb-3">{{ item.title }}</p>
                                    <div class="d-flex pe-5">
									{% for i in item.star %}
										{% if i == 1 %}
										<i class="fas fa-star text-primary"></i>
										{% else %}
                                        <i class="fas fa-star"></i>
										{% endif %}
                                    {% endfor %}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
        </div>
        <!-- Tastimonial End -->


        <!-- Footer Start -->
        <div class="container-fluid bg-dark text-white-50 footer pt-5 mt-5">
            <div class="container py-5">
                <div class="pb-4 mb-4" style="border-bottom: 1px solid rgba(226, 175, 24, 0.5) ;">
                    <div class="row g-4">
                        <div class="col-lg-3">
                            <a href="#">
                                <h1 class="text-primary mb-0">Fruitables</h1>
                                <p class="text-secondary mb-0">Fresh products</p>
                            </a>
                        </div>
                        <div class="col-lg-6">
                            <div class="position-relative mx-auto">
                                <input class="form-control border-0 w-100 py-3 px-4 rounded-pill" type="number" placeholder="Your Email">
                                <button type="submit" class="btn btn-primary border-0 border-secondary py-3 px-4 position-absolute rounded-pill text-white" style="top: 0; right: 0;">Subscribe Now</button>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="d-flex justify-content-end pt-3">
                                <a class="btn  btn-outline-secondary me-2 btn-md-square rounded-circle" href=""><i class="fab fa-twitter"></i></a>
                                <a class="btn btn-outline-secondary me-2 btn-md-square rounded-circle" href=""><i class="fab fa-facebook-f"></i></a>
                                <a class="btn btn-outline-secondary me-2 btn-md-square rounded-circle" href=""><i class="fab fa-youtube"></i></a>
                                <a class="btn btn-outline-secondary btn-md-square rounded-circle" href=""><i class="fab fa-linkedin-in"></i></a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row g-5">
                    <div class="col-lg-3 col-md-6">
                        <div class="footer-item">
                            <h4 class="text-light mb-3">Why People Like us!</h4>
                            <p class="mb-4">typesetting, remaining essentially unchanged. It was 
                                popularised in the 1960s with the like Aldus PageMaker including of Lorem Ipsum.</p>
                            <a href="" class="btn border-secondary py-2 px-4 rounded-pill text-primary">Read More</a>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="d-flex flex-column text-start footer-item">
                            <h4 class="text-light mb-3">Shop Info</h4>
                            <a class="btn-link" href="">About Us</a>
                            <a class="btn-link" href="">Contact Us</a>
                            <a class="btn-link" href="">Privacy Policy</a>
                            <a class="btn-link" href="">Terms & Condition</a>
                            <a class="btn-link" href="">Return Policy</a>
                            <a class="btn-link" href="">FAQs & Help</a>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="d-flex flex-column text-start footer-item">
                            <h4 class="text-light mb-3">Account</h4>
                            <a class="btn-link" href="">My Account</a>
                            <a class="btn-link" href="">Shop details</a>
                            <a class="btn-link" href="">Shopping Cart</a>
                            <a class="btn-link" href="">Wishlist</a>
                            <a class="btn-link" href="">Order History</a>
                            <a class="btn-link" href="">International Orders</a>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="footer-item">
                            <h4 class="text-light mb-3">Contact</h4>
                            <p>Address: 1429 Netus Rd, NY 48247</p>
                            <p>Email: Example@gmail.com</p>
                            <p>Phone: +0123 4567 8910</p>
                            <p>Payment Accepted</p>
                            <img src="{% static 'img/payment.png' %}" class="img-fluid" alt="">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Footer End -->

        <!-- Copyright Start -->
        <div class="container-fluid copyright bg-dark py-4">
            <div class="container">
                <div class="row">
                    <div class="col-md-6 text-center text-md-start mb-3 mb-md-0">
                        <span class="text-light"><a href="#"><i class="fas fa-copyright text-light me-2"></i>Your Site Name</a>, All right reserved.</span>
                    </div>
                    <div class="col-md-6 my-auto text-center text-md-end text-white">
                        <!--/*** This template is free as long as you keep the below author’s credit link/attribution link/backlink. ***/-->
                        <!--/*** If you'd like to use the template without the below author’s credit link/attribution link/backlink, ***/-->
                        <!--/*** you can purchase the Credit Removal License from "https://htmlcodex.com/credit-removal". ***/-->
                        Designed By <a class="border-bottom" href="https://htmlcodex.com">HTML Codex</a> Distributed By <a class="border-bottom" href="https://themewagon.com">ThemeWagon</a>
                    </div>
                </div>
            </div>
        </div>
        <!-- Copyright End -->



        <!-- Back to Top -->
        <a href="#" class="btn btn-primary border-3 border-primary rounded-circle back-to-top"><i class="fa fa-arrow-up"></i></a>   

        
    <!-- JavaScript Libraries -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{% static 'lib/easing/easing.min.js' %}"></script>
    <script src="{% static 'lib/waypoints/waypoints.min.js' %}"></script>
    <script src="{% static 'lib/lightbox/js/lightbox.min.js' %}"></script>
    <script src="{% static 'lib/owlcarousel/owl.carousel.min.js' %}"></script>

    <!-- Template Javascript -->
    <script src="{% static 'js/main.js' %}"></script>
    </body>

</html>

views.py程式碼:

 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
from django.shortcuts import render

# Create your views here.
def index(request):
    topinfo = [{"icon":"fa-map-marker-alt", "href":"#", "text":"123 Street, New York"},
                    {"icon":"fa-envelope", "href":"#", "text":"Email@Example.com"}]
    toplink = [{"href":"#", "text":"Privacy Policy"},
                    { "href":"#", "text":"Terms of Use"},
                    {"href":"#", "text":"Sales and Refunds"}]
    carousel = [{"active":"active", "img":"hero-img-1.png", "rounded":"bg-secondary rounded", "alt":"First slide", "href":"#", "title":"Fruites"},
                   {"active":"", "img":"hero-img-2.jpg", "rounded":"rounded", "alt":"Second slide", "href":"#", "title":"Vesitables"}]
    nav = [{"active":"active", "href":"#tab-1", "title":"All Products"},
                    {"active":"", "href":"#tab-2", "title":"Vegetables"},
                    {"active":"", "href":"#tab-3", "title":"Fruits"},
                    {"active":"", "href":"#tab-4", "title":"Bread"},
                    {"active":"", "href":"#tab-5", "title":"Meat"}]
    featurs = [{"icon":"fa-car-side", "title":"Free Shipping", "content":"Free on order over $300"},
                    {"icon":"fa-user-shield", "title":"Security Payment", "content":"100% security payment"},
                    {"icon":"fa-exchange-alt", "title":"30 Day Return", "content":"30 day money guarantee"},
                    {"icon":"fa-phone-alt", "title":"24/7 Support", "content":"Support every time fast"}]
    allProducts = [{"class":"Fruits","img":"fruite-item-5.jpg", "title":"Grapes", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-5.jpg", "title":"Grapes", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-2.jpg", "title":"Raspberries", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-4.jpg", "title":"Apricots", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-3.jpg", "title":"Banana", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-1.jpg", "title":"Oranges", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-2.jpg", "title":"Raspberries", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","class":"Fruits","img":"fruite-item-5.jpg", "title":"Grapes", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"}]
    vegetables = [{"class":"Fruits","img":"fruite-item-5.jpg", "title":"Grapes", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-2.jpg", "title":"Raspberries", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"}]
    fruits = [{"class":"Fruits","img":"fruite-item-1.jpg", "title":"Oranges", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-6.jpg", "title":"Apple", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"}]
    bread = [{"class":"Fruits","img":"fruite-item-5.jpg", "title":"Grapes", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-4.jpg", "title":"Apricots", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"}]	
    meat = [{"class":"Fruits","img":"fruite-item-3.jpg", "title":"Banana", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-2.jpg", "title":"Raspberries", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"class":"Fruits","img":"fruite-item-1.jpg", "title":"Oranges", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},]	
    tabContent = [{"id":"tab-1", "active":"active", "content":allProducts}, 
					{"id":"tab-2", "active":"", "content":vegetables},
					{"id":"tab-3", "active":"", "content":fruits},
					{"id":"tab-4", "active":"", "content":bread},
					{"id":"tab-5", "active":"", "content":meat}]
    FeatursStart = [{"img":"featur-1.jpg", "title":"Fresh Apples", "feature":"20% OFF"},
					{"img":"featur-2.jpg", "title":"Tasty Fruits", "feature":"Free delivery"},
					{"img":"featur-3.jpg", "title":"Exotic Vegitable", "feature":"Discount 30$"}]
    VesitableShopStart = [{"img":"vegetable-item-6.jpg", "class":"Vegetable", "title":"Parsely", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"img":"vegetable-item-1.jpg", "class":"Vegetable", "title":"Parsely", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"img":"vegetable-item-3.png", "class":"Vegetable", "title":"Banana", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"img":"vegetable-item-4.jpg", "class":"Vegetable", "title":"Bell Papper", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"img":"vegetable-item-5.jpg", "class":"Vegetable", "title":"Potatoes", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"img":"vegetable-item-6.jpg", "class":"Vegetable", "title":"Parsely", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"img":"vegetable-item-5.jpg", "class":"Vegetable", "title":"Potatoes", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"},
					{"img":"vegetable-item-6.jpg", "class":"Vegetable", "title":"Parsely", "content":"Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod te incididunt", "price":"4.99", "href":"#"}]
    BestsellerProductsType1 = [{"img":"best-product-1.jpg", "title":"Organic Tomato1", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"best-product-2.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"best-product-3.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"best-product-4.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"best-product-5.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"best-product-6.jpg", "title":"Organic Tomato", "star":[1,1,1,0,0], "price": "3.12", "href":"#"}]
    BestsellerProductsType2 = [{"img":"fruite-item-1.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"fruite-item-2.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"fruite-item-3.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"},
					{"img":"fruite-item-4.jpg", "title":"Organic Tomato", "star":[1,1,1,1,0], "price": "3.12", "href":"#"}]					
    FactStart = [{"icon":"fa-users", "title":"satisfied customers", "content":"1963"},
					{"icon":"fa-users", "title":"quality of service", "content":"99%"},
					{"icon":"fa-users", "title":"quality certificates", "content":"33"},
					{"icon":"fa-users", "title":"Available Products", "content":"789"}]
    TastimonialStart = [{"content":"Lorem Ipsum is simply dummy text of the printing Ipsum has been the industry's standard dummy text ever since the 1500s,", "img":"testimonial-1.jpg", "name":"Client Name", "title":"Profession", "star":[1,1,1,1,0]},
					{"content":"Lorem Ipsum is simply dummy text of the printing Ipsum has been the industry's standard dummy text ever since the 1500s,", "img":"testimonial-1.jpg", "name":"Client Name", "title":"Profession", "star":[1,1,1,1,0]},
					{"content":"Lorem Ipsum is simply dummy text of the printing Ipsum has been the industry's standard dummy text ever since the 1500s,", "img":"testimonial-1.jpg", "name":"Client Name", "title":"Profession", "star":[1,1,1,1,0]}]
    return render(request, "index.html", locals())


沒有留言:

張貼留言