This commit is contained in:
Jędrzej Klepacki 2020-12-20 23:39:57 +01:00
parent 9bdd149c8f
commit d4ecffc0a2
5 changed files with 54 additions and 4 deletions

View File

@ -15,9 +15,9 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<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="#">Usługi</a></li>
<li class="nav-item"><a class="nav-link" href="all">Wszystko</a></li>
<li class="nav-item"><a class="nav-link" href="product">Produkty</a></li>
<li class="nav-item"><a class="nav-link" href="offer">Usługi</a></li>
<li class="nav-item"><a class="nav-link" href="contact">Kontakt</a></li>
</ul>
</div>

View File

@ -5,6 +5,11 @@ from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', views.index, name='index'),
path('product', views.index_product, name='index_product'),
path('offer', views.index_offer, name='index_offer'),
path('all', views.index, name='index'),
path('', views.index, name='index'),
path('contact', views.contact, name='contact'),
path('regulamin',views.regulamin, name='regulamin'),

View File

@ -36,6 +36,51 @@ def index(request):
}
return HttpResponse(template.render(context, request))
def index_product(request):
all_product = Product.objects.filter(active = True, offer=2)
template = loader.get_template('homepage/index.html')
types = TYPE_T
types_o = TYPE_O
place_local = ""
oddam_local = ""
potrzebuje_local = ""
usluga_local = ""
przedmiot_local = "1"
context = {
'all_product': all_product,
'types': types,
'place_local': place_local,
'oddam_local': oddam_local,
'potrzebuje_local': potrzebuje_local,
'types_o': types_o,
'usluga_local': usluga_local,
'przedmiot_local': przedmiot_local,
}
return HttpResponse(template.render(context, request))
def index_offer(request):
all_product = Product.objects.filter(active = True, offer=1)
template = loader.get_template('homepage/index.html')
types = TYPE_T
types_o = TYPE_O
place_local = ""
oddam_local = ""
potrzebuje_local = ""
usluga_local = "1"
przedmiot_local = ""
context = {
'all_product': all_product,
'types': types,
'place_local': place_local,
'oddam_local': oddam_local,
'potrzebuje_local': potrzebuje_local,
'types_o': types_o,
'usluga_local': usluga_local,
'przedmiot_local': przedmiot_local,
}
return HttpResponse(template.render(context, request))
def contact(request):
return render(request , 'homepage/contact.html')