From d4ecffc0a2fd67708f0775f5d202383da4734b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Klepacki?= Date: Sun, 20 Dec 2020 23:39:57 +0100 Subject: [PATCH] navbar --- .../homepage/__pycache__/urls.cpython-37.pyc | Bin 894 -> 1017 bytes .../homepage/__pycache__/views.cpython-37.pyc | Bin 5791 -> 6609 bytes SocialHelper/homepage/templates/navbar.html | 6 +-- SocialHelper/homepage/urls.py | 5 ++ SocialHelper/homepage/views.py | 47 +++++++++++++++++- 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/SocialHelper/homepage/__pycache__/urls.cpython-37.pyc b/SocialHelper/homepage/__pycache__/urls.cpython-37.pyc index 49a7c78088860c6c58cbe09a37c046e06a46c429..3b77f07bae3debbbfee55982184be3341292196b 100644 GIT binary patch delta 461 zcmY+=J5K^Z5C`zvz4JiseaAh0B+?KlwAY51*xFbaZ3uA|l@K8ZCR&l$Q<(cqegVsC zD5(4hHpW?R&^Vi&{r`57E%rPuBH zFoZTTz$96yZK#p-f3i^~*feuc7C0mqWrIudP!4z`ALW8i3Q!(27sL?hLqv*E0mP&P z)r5qUqC!YX87hK|wDUK+^+a9hqZoGryGtG`*D35>D4qQe`4JsnYSY2|t~g=6qiH^Y z$D4U+-9LbM>TkF;84g8W8r5wDbubauU-BP&Z}kn delta 306 zcmXxfzYYOG5C-twTh6)Lz5nNsh|pZTf=VPx8imkk=17!0fKI27eIvD35Ct!x5wkHS znJ?cjQ_Z{fv5T=%F2h;f9_wm_v8Ta*A}k}^gLNrp$2vG?QF3t0%FY9qF+--1ks80F(N>jCY40-J2IOZeXR92V zb2ez{4WH^4zw@TPT8qrXm-fQ(WjTN(%&)I-#vlBFpQvE^TeC zF9M;nDghD*2?;c!PmyS)O7M#O7Z8C2ZRZ%wo|Hyi5R z^tIN_M!R;kG26T)8}H0q^KafzS)Kt$Jb{LtFL_awB8PgKG0uoH4l#xpX@+2g37(^# zVLOLk*)Kfh>SZ_DswK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&2X}vd)l2jvyw!f#v9g$#rBt8F?>xPU%s)8V zp-a9N0l*FX<3zQ87Z+* diff --git a/SocialHelper/homepage/urls.py b/SocialHelper/homepage/urls.py index 08bc1ab..70791ff 100644 --- a/SocialHelper/homepage/urls.py +++ b/SocialHelper/homepage/urls.py @@ -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'), diff --git a/SocialHelper/homepage/views.py b/SocialHelper/homepage/views.py index e2632ff..8b52b2c 100644 --- a/SocialHelper/homepage/views.py +++ b/SocialHelper/homepage/views.py @@ -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') @@ -231,7 +276,7 @@ def login(request): return redirect(login) return render(request , 'homepage/login.html') -def logout_user(request): +def logout_user(request): auth.logout(request) messages.success(request, 'Zostałeś wylogowany!') return redirect( index)