From 35b36b3300c763d38bac5250bec684e87fcdaf7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Klepacki?= Date: Mon, 11 Jan 2021 17:13:05 +0100 Subject: [PATCH] fix --- .../__pycache__/settings.cpython-37.pyc | Bin 2604 -> 2604 bytes SocialHelper/SocialHelper/settings.py | 2 +- .../homepage/__pycache__/views.cpython-37.pyc | Bin 13275 -> 13336 bytes .../homepage/templates/homepage/index.html | 12 +++++++++++ .../homepage/templates/homepage/my_offer.html | 15 ++++++++++++- .../templates/homepage/user_profile.html | 20 ++++++++++++++---- SocialHelper/homepage/views.py | 5 ++++- 7 files changed, 47 insertions(+), 7 deletions(-) diff --git a/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc b/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc index 8248d3a435249d9adb2128336820b3eb4cddfab2..3f237a56881b204b843d3593055fe2f46eab4ecb 100644 GIT binary patch delta 20 acmZ1@vPOj4iIUoW!{iioxn19sv9gDj#>dvb4^co z8@=HFigH6mVqYE2GlZE79b6rkCR@BlZt%u@s8#X|ZaTW~=7XJElE|8;C}%jqxbSY6 z8;`*=3jMlc_#;A85|S`ixGLlg`3MhllLs7gNAn_XlxyWC9>Ig|JD_3IvRZ0dX?`}7 zE>6{gKAB@h$By9z>uj(Vm@3W}T-Ju8S}VHNX^7&6)h)AU_|ZzKPsRP&6MUF##Urb^ z>5>Q~P$33!IVQ(I$IhPixB|K?1HFomy3AJaO3%->=R&<09WOeWLb3B+aW-3UGi;G9 z;q^ogR`5fj%Uq%bC4y!Akr;(TOxV4!TD@t10a(M1-p=T{sM=6drtfE58`wHt>-}YJ zQA(lzpL9x1%{}NA;Fq}n&M^`sQsb{?0}zR$C3)^Uf{RBNq^mO zAFJR`TgaWq#laESuYMYQ b11DCfzDnSKpj~47I6IWndi0ZepC11U!O6ie delta 713 zcmY*VOHUI~6rMAkna+bwYiWc)#1i^oQXDC`l7#`;o3J5Kv1ynBsoLu8m=H1(7jD2> zkQ_u7P)aayVO*FlT;sy%4=@_|3A!;F4Lk1{OwhSG-}&x$9&^s!S~!|FCn6DD;9uwQ zapC>c8}mgfYVxbX?JBq0F98oyQxDy68Oov;Dl3lM0AF_1mgXpX;47}~hh4*0|IcWJ z_5}993Hus1eX-AzCxw}_zTs(}QSRsxe9hAxm3#gE#d}q;G+Y$xKGH&fv|=fXKRWJluu5nSLsE{u{9pG;82>oQ*w8NM7EhVSh!LlTTqC-#(Jm5L;{v`8H< z^NS@18aqvCQrm5f&$gitU)dJywm;cBFh>3UsqLhz9W>y;e?f7Y{lw7- zmK03RHu3dvQF+c4wuOoO#8`{y$%_!9^;od&HfPt32elF_++)?b!U)@;*vXp2_HaF) qh7o+5zXJR1-}xr=)Jbm;1aGxVY@Z;9{n<`@H+n5Rp!TR2)WjcKp|w^3 diff --git a/SocialHelper/homepage/templates/homepage/index.html b/SocialHelper/homepage/templates/homepage/index.html index 27c9c2b..0e15589 100644 --- a/SocialHelper/homepage/templates/homepage/index.html +++ b/SocialHelper/homepage/templates/homepage/index.html @@ -6,7 +6,19 @@ +
diff --git a/SocialHelper/homepage/templates/homepage/my_offer.html b/SocialHelper/homepage/templates/homepage/my_offer.html index 38453f3..7f78cce 100644 --- a/SocialHelper/homepage/templates/homepage/my_offer.html +++ b/SocialHelper/homepage/templates/homepage/my_offer.html @@ -14,6 +14,19 @@
+ @@ -40,7 +53,7 @@
-

{{ product.title }}

+

{{ product.title }}

{% if types.0.0 == product.type %}
Potrzebuje {% else %} diff --git a/SocialHelper/homepage/templates/homepage/user_profile.html b/SocialHelper/homepage/templates/homepage/user_profile.html index bfac27a..71598e1 100644 --- a/SocialHelper/homepage/templates/homepage/user_profile.html +++ b/SocialHelper/homepage/templates/homepage/user_profile.html @@ -4,6 +4,19 @@ + @@ -12,7 +25,6 @@

Profil użytkownika

{{ name }}


-

Ilość ocen: {{suma_ocen}}

Średnia Ocena: {{ocena_2}}

1 @@ -81,10 +93,10 @@
@@ -108,7 +120,7 @@
-

{{ product.title }}

+

{{ product.title }}

{% if types.0.0 == product.type %}
Potrzebuje {% else %} diff --git a/SocialHelper/homepage/views.py b/SocialHelper/homepage/views.py index 6f67214..5c00188 100644 --- a/SocialHelper/homepage/views.py +++ b/SocialHelper/homepage/views.py @@ -441,6 +441,7 @@ def user_profile(request, user_name): user_prof = User.objects.filter(email=user_name).first() all_product = Product.objects.filter(active = True, user_iden = user_prof.id) + suma_prod = all_product.count() oceny = Ocena.objects.filter(user_iden = user_prof.id) template = loader.get_template('homepage/user_profile.html') @@ -458,6 +459,7 @@ def user_profile(request, user_name): ocena = int (ocena) else: ocena = 50 + suma_oc = 0 ocena_2 = ocena/10 context = { 'all_product': all_product, @@ -465,7 +467,8 @@ def user_profile(request, user_name): 'ocena': ocena, 'name': user_prof.email, 'ocena_2': ocena_2, - 'suma_ocen': suma, #suma wszystkich ocen uzytkownika + 'suma_oc': suma, #suma wszystkich ocen uzytkownika + 'suma_prod': suma_prod, } return HttpResponse(template.render(context, request))