Pobieranie z bazy rzeczy do frontu

This commit is contained in:
Klaudia 2020-12-05 15:28:47 +01:00
parent 0880236fa9
commit 3b78d88071

View File

@ -1,22 +1,4 @@
{% load static %} {% load static %}
{% if all_product %}
<ul>
{% for product in all_product %}
<li>{{ product.user_owner }}<br>
{% if types.0.0 == product.type %}
Potrzebuje
{% endif %}
{% if types.1.0 == product.type %}
Oddam
{% endif %}
{{ product.title }}<br>
{{ product.place }}<br>
</li>
{% endfor %}
</ul>
{% else %}
<p>No polls are available.</p>
{% endif %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -40,66 +22,30 @@
</head> </head>
<body> <body>
<!--================Top Header Area =================-->
<div class="header_top_area">
<div class="container">
<div class="row">
<div class="col-lg-3">
<div class="top_header_left">
<div class="input-group">
<input type="text" class="form-control" placeholder="Wyszukaj" aria-label="Search">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button"><i class="icon-magnifier"></i></button>
</span>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="top_header_middle">
<!-- <a href="#"><i class="fa fa-phone"></i>Zadzwoń: <span>+00 000 000 000 </span></a> -->
<!-- <a href="#"><i class="fa fa-envelope"></i> Email: <span>pomoc@socialhelper.pl</span></a> -->
<br><br>
<!-- <img src="img/logo.png" alt=""> -->
<a href="index.html"><img src="{% static "img/Social.png" %}"></a>
</div>
</div>
<div class="col-lg-3">
<div class="top_right_header">
<ul class="header_social">
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-pinterest"></i></a></li>
<li><a href="#"><i class="fa fa-instagram"></i></a></li>
<li><a href="#"><i class="fa fa-youtube-play"></i></a></li>
</ul>
<ul class="top_right">
<li class="user"><a href="#"><i class="icon-user icons"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!--================End Top Header Area =================-->
<!--================Menu Area =================--> <header class="shop_header_area carousel_menu_area">
<header class="shop_header_area"> <div class="carousel_menu_inner">
<div class="container"> <div class="container">
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#"><img src="{% static "img/Social.png" %}"></a> <a class="navbar-brand" href="#"><img src="{% static "img/Social.png" %}"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav"> <ul class="navbar-nav">
<li class="nav-item"><a class="nav-link" href="#">Wszystko</a></li>
<li class="nav-item"><a class="nav-link" href="#">Produkty</a></li> <li class="nav-item"><a class="nav-link" href="#">Produkty</a></li>
<li class="nav-item"><a class="nav-link" href="#">Usługi</a></li> <li class="nav-item"><a class="nav-link" href="#">Usługi</a></li>
<li class="nav-item"><a class="nav-link" href="contact.html">Kontakt</a></li> <li class="nav-item"><a class="nav-link" href="contact.html">Kontakt</a></li>
</ul> </ul>
</div> </div>
<ul class="navbar-nav justify-content-end">
<li class="search_icon"><a href="#"><i class="icon-magnifier icons"></i></a></li>
<li class="user_icon"><a href="#"><i class="icon-user icons"></i></a></li>
<li class="cart_cart"><a href="#"><i class="icon-handbag icons"></i></a></li>
</ul>
</nav> </nav>
</div> </div>
</header> </header>
@ -114,33 +60,27 @@
<div class="col-lg-9 float-md-right"> <div class="col-lg-9 float-md-right">
<div class="showing_fillter"> <div class="showing_fillter">
<div class="row m0"> <div class="row m0">
<div class="first_fillter">
<h4>Showing 1 to 12 of 30 total</h4>
</div>
<div class="secand_fillter"> <div class="secand_fillter">
<h4>SORT BY :</h4> <h4>Sortuj po:</h4>
<select class="selectpicker"> <select class="selectpicker">
<option>Name</option> <option>Nazwa</option>
<option>Name 2</option> <option>Najnowsze</option>
<option>Name 3</option>
</select> </select>
</div> </div>
<div class="third_fillter"> <div class="third_fillter">
<h4>Show : </h4> <h4>Pokaż : </h4>
<select class="selectpicker"> <select class="selectpicker">
<option>09</option> <option>5</option>
<option>10</option>
<option>10</option> <option>10</option>
<option>20</option>
</select> </select>
</div> </div>
<div class="four_fillter">
<h4>View</h4>
<a class="active" href="#"><i class="icon_grid-2x2"></i></a>
<a href="#"><i class="icon_grid-3x3"></i></a>
</div>
</div> </div>
</div> </div>
<div class="c_product_grid_details"> <div class="c_product_grid_details">
{% if all_product %}
{% for product in all_product %}
<div class="c_product_item"> <div class="c_product_item">
<div class="row"> <div class="row">
<div class="col-lg-4 col-md-6"> <div class="col-lg-4 col-md-6">
@ -150,113 +90,22 @@
</div> </div>
<div class="col-lg-8 col-md-6"> <div class="col-lg-8 col-md-6">
<div class="c_product_text"> <div class="c_product_text">
<h3>Nike Max Air Vapor Power</h3> <h3>{{ product.title }}</h3>
<h5>$45.05</h5> {% if types.0.0 == product.type %}
<ul class="product_rating"> <h5>Potrzebuje</h5>
<li><a href="#"><i class="fa fa-star"></i></a></li> {% else %}
<li><a href="#"><i class="fa fa-star"></i></a></li> <h5>Oddam</h5>
<li><a href="#"><i class="fa fa-star"></i></a></li> {% endif %}
<li><a href="#"><i class="fa fa-star"></i></a></li> <h6>Z miejscowości: <span>{{ product.place }}</span></h6>
<li><a href="#"><i class="fa fa-star"></i></a></li> <p>{{ product.description }}</p>
</ul>
<h6>Available In <span>Stock</span></h6>
<p>Curabitur semper varius lectus sed consequat. Nam accumsan dapibus sem, sed lobortis nisi porta vitae. Ut quam tortor, facilisis nec laoreet consequat, malesuada a massa. Proin pretium tristique leo et imperdiet.</p>
<ul class="c_product_btn">
<li class="p_icon"><a href="#"><i class="icon_piechart"></i></a></li>
<li><a class="add_cart_btn" href="#">Add To Cart</a></li>
<li class="p_icon"><a href="#"><i class="icon_heart_alt"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="c_product_item">
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="c_product_img">
<img class="img-fluid" src="{% static "img/product/l-product-4.jpg" %}">
</div>
</div>
<div class="col-lg-8 col-md-6">
<div class="c_product_text">
<h3>Max Air Vapor Power</h3>
<h5>$110.50</h5>
<ul class="product_rating">
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
</ul>
<h6>Available In <span>Stock</span></h6>
<p>Curabitur semper varius lectus sed consequat. Nam accumsan dapibus sem, sed lobortis nisi porta vitae. Ut quam tortor, facilisis nec laoreet consequat, malesuada a massa. Proin pretium tristique leo et imperdiet.</p>
<ul class="c_product_btn">
<li class="p_icon"><a href="#"><i class="icon_piechart"></i></a></li>
<li><a class="add_cart_btn" href="#">Add To Cart</a></li>
<li class="p_icon"><a href="#"><i class="icon_heart_alt"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="c_product_item">
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="c_product_img">
<img class="img-fluid" src="{% static "img/product/l-product-7.jpg" %}">
</div>
</div>
<div class="col-lg-8 col-md-6">
<div class="c_product_text">
<h3>Fossil Watch</h3>
<h5>$250</h5>
<ul class="product_rating">
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
</ul>
<h6>Available In <span>Stock</span></h6>
<p>Curabitur semper varius lectus sed consequat. Nam accumsan dapibus sem, sed lobortis nisi porta vitae. Ut quam tortor, facilisis nec laoreet consequat, malesuada a massa. Proin pretium tristique leo et imperdiet.</p>
<ul class="c_product_btn">
<li class="p_icon"><a href="#"><i class="icon_piechart"></i></a></li>
<li><a class="add_cart_btn" href="#">Add To Cart</a></li>
<li class="p_icon"><a href="#"><i class="icon_heart_alt"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="c_product_item">
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="c_product_img">
<img class="img-fluid" src="{% static "img/product/l-product-8.jpg" %}">
</div>
</div>
<div class="col-lg-8 col-md-6">
<div class="c_product_text">
<h3>Jens T-Shirt</h3>
<h5>$45.05</h5>
<ul class="product_rating">
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
<li><a href="#"><i class="fa fa-star"></i></a></li>
</ul>
<h6>Available In <span>Stock</span></h6>
<p>Curabitur semper varius lectus sed consequat. Nam accumsan dapibus sem, sed lobortis nisi porta vitae. Ut quam tortor, facilisis nec laoreet consequat, malesuada a massa. Proin pretium tristique leo et imperdiet.</p>
<ul class="c_product_btn">
<li class="p_icon"><a href="#"><i class="icon_piechart"></i></a></li>
<li><a class="add_cart_btn" href="#">Add To Cart</a></li>
<li class="p_icon"><a href="#"><i class="icon_heart_alt"></i></a></li>
</ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{% endfor %}
{% else %}
<p>No polls are available.</p>
{% endif %}
<nav aria-label="Page navigation example" class="pagination_area"> <nav aria-label="Page navigation example" class="pagination_area">
<ul class="pagination"> <ul class="pagination">
<li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item"><a class="page-link" href="#">1</a></li>