From 5b66859a59b8600b5741f9344eadf48bf78d0c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Klepacki?= Date: Thu, 7 Jan 2021 19:56:07 +0100 Subject: [PATCH] push --- .../SocialHelper/static/color/00ff00.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/32ff00.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/64ff00.png | Bin 0 -> 124 bytes .../SocialHelper/static/color/96ff00.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/c0c0c0.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/c8ff00.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/ff0000.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/ff3200.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/ff6400.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/ff9600.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/ffc800.png | Bin 0 -> 120 bytes .../SocialHelper/static/color/ffff00.png | Bin 0 -> 120 bytes .../enGB/__pycache__/views.cpython-37.pyc | Bin 10911 -> 10875 bytes .../enGB/templates/enGB/user_profile.html | 58 ++++++++++++++-- SocialHelper/enGB/views.py | 2 - .../homepage/__pycache__/admin.cpython-37.pyc | Bin 315 -> 344 bytes .../__pycache__/models.cpython-37.pyc | Bin 1554 -> 1929 bytes .../homepage/__pycache__/views.cpython-37.pyc | Bin 10922 -> 10901 bytes SocialHelper/homepage/admin.py | 3 +- .../migrations/0003_merge_20210107_1740.py | 14 ++++ SocialHelper/homepage/migrations/0004_chat.py | 27 ++++++++ .../0003_merge_20210107_1740.cpython-37.pyc | Bin 0 -> 478 bytes .../__pycache__/0004_chat.cpython-37.pyc | Bin 0 -> 1077 bytes SocialHelper/homepage/models.py | 7 ++ .../templates/homepage/user_profile.html | 63 ++++++++++++++++-- SocialHelper/homepage/views.py | 4 +- 26 files changed, 162 insertions(+), 16 deletions(-) create mode 100644 SocialHelper/SocialHelper/static/color/00ff00.png create mode 100644 SocialHelper/SocialHelper/static/color/32ff00.png create mode 100644 SocialHelper/SocialHelper/static/color/64ff00.png create mode 100644 SocialHelper/SocialHelper/static/color/96ff00.png create mode 100644 SocialHelper/SocialHelper/static/color/c0c0c0.png create mode 100644 SocialHelper/SocialHelper/static/color/c8ff00.png create mode 100644 SocialHelper/SocialHelper/static/color/ff0000.png create mode 100644 SocialHelper/SocialHelper/static/color/ff3200.png create mode 100644 SocialHelper/SocialHelper/static/color/ff6400.png create mode 100644 SocialHelper/SocialHelper/static/color/ff9600.png create mode 100644 SocialHelper/SocialHelper/static/color/ffc800.png create mode 100644 SocialHelper/SocialHelper/static/color/ffff00.png create mode 100644 SocialHelper/homepage/migrations/0003_merge_20210107_1740.py create mode 100644 SocialHelper/homepage/migrations/0004_chat.py create mode 100644 SocialHelper/homepage/migrations/__pycache__/0003_merge_20210107_1740.cpython-37.pyc create mode 100644 SocialHelper/homepage/migrations/__pycache__/0004_chat.cpython-37.pyc diff --git a/SocialHelper/SocialHelper/static/color/00ff00.png b/SocialHelper/SocialHelper/static/color/00ff00.png new file mode 100644 index 0000000000000000000000000000000000000000..46079c1c36f84fefe128e06087be7f48b7f93283 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^(}4H{BQuaR@a|FrQp^E9A+8Mn8BF31tN?O33p^r= z85sDEfH31!Z9ZwBptPrpV~9uR+k=LTK;EGRU;T4=X?_wfUrhg3_KYjv*eMZx0$W0(plPeD%-ekzW90Hf(3)U%bP0l+XkKE%O|k literal 0 HcmV?d00001 diff --git a/SocialHelper/SocialHelper/static/color/c0c0c0.png b/SocialHelper/SocialHelper/static/color/c0c0c0.png new file mode 100644 index 0000000000000000000000000000000000000000..28f921ab7c31bc67e0dc348904dea05262430e41 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^(}4H{BQuaR@a|FrQp^E9A+84w97yxtmjdK+7I;J! zGcfQS0b$0e+I-SLL1|AH#}JRsw+9UwfxJTtzWV3#$S(jg8@4m@FJNHQdM?5QGpv5Z9suNW7I;J! zGcfQS0b$0e+I-SLL1|AH#}JRsw+9UwfxJTtzWV3#$S(jg8@4m@FJNHQdM?5QhV6{}3m6!+o{KO6c?_Pe KelF{r5}E*`h8o2H literal 0 HcmV?d00001 diff --git a/SocialHelper/SocialHelper/static/color/ff3200.png b/SocialHelper/SocialHelper/static/color/ff3200.png new file mode 100644 index 0000000000000000000000000000000000000000..e47d01864a611f4002779437c3b4e439c87da126 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^(}4H{BQuaR@a|FrQp^E9A+G<87`{x3bpvua3p^r= z85sDEfH31!Z9ZwBptPrpV~9uR+k=LTK;EGRU;T4=0TSO literal 0 HcmV?d00001 diff --git a/SocialHelper/SocialHelper/static/color/ff9600.png b/SocialHelper/SocialHelper/static/color/ff9600.png new file mode 100644 index 0000000000000000000000000000000000000000..62d34ecfb8da4ef02d247bce01105c723d3d02bb GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^(}4H{BQuaR@a|FrQp^E9A+G7TV_F1VGs;MjDV!?BIY#xiEdYSUYx2z1_7 z2BqCb$mZOPar_cUrU`p8F~kRLG@2OSjC(K|HNNn)2Te@$)%dW)c)k}BVq$O3r@wp8 zx##@OIrpqzcrvOT)ik9+{60JRcjn+H+8;J|@_7H{QZZM^PEXbw?Q>4*uU}UJ#P7S? z9ImSLP~k7#zmc2Q)n5L}rSM}lPeXh{>kmj0{r8e>=1_f2OG$Kwzw>@WqrBqlqhWsJ z8=;T5y=k0sJl}M~{fbDy^nf%=&4Yo*A}m>Hk%ycllPZ}L^()Pblo&;;cCZT^0;j-> z;50Y`hFS8*>1FQm571dI_+PkT;BgaZ1})$McnMe?St*R+)($R$5pV)r0@g4+h^%4G zAsPVZfi;mdqUV53knoxj#7Fb+HL#PuHJcco1;J%74z7SfFbrM=S=Jj{_fnvwBHiTO z9luhU)lf*c^4{72G_z)(5K+RhmHYw^g$|3&dOM`kt@=jjb8=dpmU*HxwWo-8_JXV6 z4MD}HKOc@nW65}8v6db`bohvAqOMf`wsVANiQDwh$(@zHhPrvMvx3&*Y1`wYY8l)H zZ-G0Y4^+6KhdA2k_njuBv-V5 znD_aI-3RtAA%UI4;>WFZCjRg1S>^rlNccY5EPxfkraD)gesdevtMLp?wZafJtx@+yZw&KfrF7tKb0-B+s_=$_$+(!wNW60D5u@PZIe_%K`pE?AW(!SyQuxGXEeJ=_EfTO>~f8GSQ~j_ZZEw=ANfpZ1Jp+%o)#nj%9sasuLvno@d(syB?N|)smB}B#>xQ z&uKGl8#J(pw>m)&I08Q;(s(j zNeo~V_ZdV>+#T-hF`kd1-TyyvL=!qYoCt4Hl79=24BaOEyR_<^Eo3K=)Q|KiV?tZM zB>l!_kLh>mZ=Q@?4gDnVtK0P3ej!$~ywI}JQ+Jfbnhgi5W~(`J68{)*X$c5%7dYHc# zebTNCIY|}LtBP7>XKawJ@!{CGRl^=exDpHQ7mQs9`uVb(S|1)>yGh;VTd_NIiZAxJ z`#;uas7l9*tE)<(+?$qVMOL@?^ZxPS$I9%(vWydARMV*SUb45@6^|U;!aGJ;84DNB z7xR@>C6zB`()s2&Fv@KlkSN~|w~P9OsZ4Y7JKTs5(GBf({16?Q#Yi$Z2eRN2xB@l- mYG)Kk-9~f+^y}Y@k4FZ_z2m~uf*_0v(}GJlC^!X+(DxtK8y-La diff --git a/SocialHelper/enGB/templates/enGB/user_profile.html b/SocialHelper/enGB/templates/enGB/user_profile.html index b236ac9..bf4e184 100644 --- a/SocialHelper/enGB/templates/enGB/user_profile.html +++ b/SocialHelper/enGB/templates/enGB/user_profile.html @@ -10,10 +10,60 @@

User Profile

-
{{ name }}
-
- - {% if user.email %} +
{{ name }}


+

Average Grade: {{ocena}}

+ 0 + + {% if ocena > 9 %} + + {% else %} + + {% endif %} + {% if ocena > 19 %} + + {% else %} + + {% endif %} + {% if ocena > 29 %} + + {% else %} + + {% endif %} + {% if ocena > 39 %} + + {% else %} + + {% endif %} + {% if ocena > 49 %} + + {% else %} + + {% endif %} + {% if ocena > 59 %} + + {% else %} + + {% endif %} + {% if ocena > 69 %} + + {% else %} + + {% endif %} + {% if ocena > 79 %} + + {% else %} + + {% endif %} + {% if ocena > 89 %} + + {% else %} + + {% endif %} + {% if ocena > 99 %} + + {% else %} + + {% endif %} 100 {% if user.email %}

{% endif %}
diff --git a/SocialHelper/enGB/views.py b/SocialHelper/enGB/views.py index cf03e2a..b694d2e 100644 --- a/SocialHelper/enGB/views.py +++ b/SocialHelper/enGB/views.py @@ -152,7 +152,6 @@ def enfilter(request): types = TYPE_T types_o = TYPE_O - print(types) context = { 'all_product': all_product, 'types': types, @@ -450,7 +449,6 @@ def enuser_profile(request, user_name): ocena = 0 suma = 0 for ocena_j in oceny: - print(ocena) ocena = ocena + ocena_j.ocena_jedn suma = suma + 1 ocena = ocena / suma diff --git a/SocialHelper/homepage/__pycache__/admin.cpython-37.pyc b/SocialHelper/homepage/__pycache__/admin.cpython-37.pyc index c18d5397cd2c3d79f53d34cb8f78b59af4875382..9b3b46f396b1b7aea50c8a258391b51d29bd1b64 100644 GIT binary patch delta 167 zcmdnZbc2c4iIjYjgcXhF^hcxM=J9|MmU=ViOq_{ zW}BELr^IrLJ)kH*r8K$Z7F$40VsdKnEmr^J)V#!7EXf&(C4QQm6PM`76|n=YyTwwR nS(18-qbM~!v$!O+XeC1tH&D2Ud*VwsK9GZW7$ul^7(oyKZ51o~ delta 139 zcmcb?w3~_7iIhdn)rnMmU=ViOo8(N=}CP z7JEQZeoAR_$t|{koW$hR;#;i#$*FmXewrK;cj-vpVkyonNxj8Ul$xGdT#{O}lA#D> XR}t4_7DhK74j_|f1W@k!z~ zcsR(f*=U^Vh$xQX10_%+TlsjX21@q4g@CHifIs>WK&s{8yttia`B*Zzio!}by9?K} z?V-fYxtc*S(n$u28sMje9?z8V`^L9&IZBFLZpaamnrV5jYjJ_2huNJRWO53zharhc yQ^(lzPkP4oQB0AWzw<~tBq0fKZ!RKUJvld|U)4@;+dP01ZhMqDjCDkZb(~)rCsIKG delta 68 zcmeC=pTxuG#LLUY00iy9@8c)3PUMqdOq!^k$db%j&<&LU diff --git a/SocialHelper/homepage/__pycache__/views.cpython-37.pyc b/SocialHelper/homepage/__pycache__/views.cpython-37.pyc index 94e5cfb78d969d39e27a234e10821cb00f077554..753de09dd6b46332317a9962666c706e829c7b1a 100644 GIT binary patch delta 2735 zcmcImO>7%Q6wdf(vySb?Y2w6=YDCy$aq=vP(jJLE@ zi3)-PLI_kn^@2bx;!u^J16aU?zXL)XxFHVR6A~Oi;?M&U65_ynvk)f%4ji!M@6F84 z%=_lOZ{GT?W0#MG?+Ax`y72S)-M=mcE`{Ul;H9z47aNIcf_3pO9yCW9$!b!zL*{5B zRZYou*c`2n@@>5L`L1f3M|dCF4ByWC(PsGokD|@-K|X{w&tp7}w!nvZ0&S6x@FdzX zKFU*QOFYdpXf>YYIke-voaY5>Ozw9|Z=m(iACnSI3+ zD0@nZaMH=2y`U@FqX6bQv&1%}ldHZ^o(6Im8 z^ufv_Evr`7&C?L^o$yWIAUx?AgkEJQeCXTD;&9WK4h+*;Hmj*H>d&R+R$4&x;i$+F zJle0M$n-%yiP}y=m`;VVH`g2-wqeM!*Ib9Mhd19r)N{}tP&3r z2QiKC|FhWNeH)vBXS(lA%0p}*i0<7O>NWc)oKj=(Qg;ecYBsWUCOoJPvmIcnZH!?$ zpee*(3s3+(A`5n4N^wI6*8-!g0AB|3!<~@rro;Y+xXtz)NZg8RY7BusVf>NO58$s= zX}{7FW$;cgJ``B>Tuu2ObJnq8<<1{8hao-@X>EvHQuj)BTvR&b167_ES%3)kOV_?fC7w zZ5oajk0NEYu;}=f>!xv`uUv2FD@LpQnBJ<_rq482#1t+R!%!Ybg5CST%AMX-~A zwsof*!j=={hU=nkHN`yK>^+jAOgmoPG{qdvy@lW)0r3+UYP+$wU(C+ zu~g@dT5q;&y;(ChUPGMegt%cEwy`8r7}0=l*fi!y>bn}SONhgc473?vmd2=Mzr@}dmtQJTFup5i_ln}i9Aduv{>g5ZpIzoF_LNp z8i_q|sg})jgn?^E+Mgy;>=fl=0k1Eq@IvHXEbUgh^@QHC&go4fqxA_%z;#9*<#x2l z@h{g!%N8cJz1R>HdM^3Ps@~C!O0NXXFN*MRGLw-PVKX7pyHv_q8*`KjN{ z1$A|VMO651_&9s&FJ)zO*}XEvGWcGcf&!LxRvwntxMA7ifbQTGSj$~5$@4RJ&E`o? z(6m;pv-T35{9UNzHTE;`{0s4~c=uWWe?8|%SN#XOP7baGR|BiT$3qY=Bmn5mU*^e2w5;DaRd{%6TTQbkndE= zEh^q17?>zc4$)r@vCh}6o&hA?EKL+8G5H?dnmV2HrJB`f7)|>d_^dR8FZ`ROpALyZ z+zpH0<9c(&nm%jS&6XIVA(i8wD!YzUW8{xiA<6_Z1hWJ?2&CBZkQkqhbX>~TI6N|5 kETugm7GkPb9h6@$wi4=Y^%hlCcd3WeUUf>{rux;)9||!lIsgCw delta 2731 zcmcImOK)366!!ReuOG4VaN;C(Y{!o6n|ISRA!$KL+9m}hMQV~lOpEJgZc<0rc9`7I z0yjiZKc^XWnzp zcfL8!*8J^x--OTSw!mNG507$v*L=-n>{@zjlUS&QdbHMJI2#siuNEn`W!psCr$w?6 zT0{NsS+Y?YptWFQw2sz;jnf7i1lvvN!mhN!FJFvjet$jHW~$+rZE}^ zo1yJA0al?&+VNhOCEH0;Gz|k?G(#1zPTEPkz;@Ga+5@(S_R>DEy?lk-B@TYrnyKWi zmq@S$f~iWnT3prgy2@Ii%c4B)s8?dxjN`Oxv0T#CEBfaamVy4`fs>=>W*446H(OpT zQjVi5yZShNttWBN0+$Rts&`j*vj`A|!dv(Gu*yCN58 z$em7;IR2&FMv%0oG_zxrPF(6`I}8ru=zpMb*nOOg^0(a0WTLX=4w9p~Y`CuyVljx} zHav#Sup17;X}AoD*4>adyt>=4-t-t=!*a`dmCRa{`qOg?VVHpHjv)WjGftZMpf^Rj z_$%IoN2GNpqiPKO6RMIgm$jT$Ud(F{z=7g`rB!E9)i0GPJBs`25bAN*vC0Z1ok=)g z15kXsI7p#>$6`1qv@-#%tn1BUK`oW?+w#K6{hGot)TR#KwP`-%8*L(z)k^k$BpXXq zZul07AAPF2F0%6FHI=b3UgHmu9-j6`ov1|C%%}au;5ar9BMcynA$0S5{zh_)Kk%Q4 zVq&Ydyr!`uI5mWD96?0f$j=5w!=u>8FwJ~#$9ftE!u*Rs7n$I{28NmsisuDbbepGZ z?~q~sTW#87Ubn33EW~>vp=a@E#U{wBO68>`mE{VwDium=dcL%%?tXHxvg)O(rs`@= zth`^jPMh!W6nUQ>2~W zYlt{a4)~*n$flrh7I%yx2y(?K)7U+RFoQ6MFpuz*FvV}`;yjMNim>CH@KtaY#)-2C zFCn~)fTA(o>{!5N7Gc-xhHllZ(t>Vs@v!oB@HMMbByEH%p#^vaS3{Fzr1E{}E^&%y zIl@0~Q9U9sAD(s;qN{)Mvg55vXvb|c#Z~(}DrV!eX!8-U%Bpw%3@4d6? z*_OaMxJD}Yh!yvk zZ*AWNSW9nmme|S&4v4vD@1m+lD=(MV^&Ce374J(bhAGGv$rULI;+Pj9iSV?XvJ=p)y331d zDW6+WX^Dx~CiEfUNQMRcK_1gx_5EPzP4V>XI^ zQ8jBz7mR=$2Kept@uX0`sHgj=*(E_6DhtQ93 z2tlYe!JVCl0z0>fmcpkxQ<<>UizL{jM)9#ht5q73h9yZFl%^!V)FahM4ypZLQhpa= diff --git a/SocialHelper/homepage/admin.py b/SocialHelper/homepage/admin.py index 32076e1..e5e4db8 100644 --- a/SocialHelper/homepage/admin.py +++ b/SocialHelper/homepage/admin.py @@ -1,6 +1,7 @@ from django.contrib import admin -from .models import Product, Places, Ocena +from .models import Product, Places, Ocena, chat admin.site.register(Product) admin.site.register(Places) admin.site.register(Ocena) +admin.site.register(chat) diff --git a/SocialHelper/homepage/migrations/0003_merge_20210107_1740.py b/SocialHelper/homepage/migrations/0003_merge_20210107_1740.py new file mode 100644 index 0000000..16fc841 --- /dev/null +++ b/SocialHelper/homepage/migrations/0003_merge_20210107_1740.py @@ -0,0 +1,14 @@ +# Generated by Django 3.1.4 on 2021-01-07 16:40 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('homepage', '0002_auto_20210103_1424'), + ('homepage', '0002_auto_20210103_1457'), + ] + + operations = [ + ] diff --git a/SocialHelper/homepage/migrations/0004_chat.py b/SocialHelper/homepage/migrations/0004_chat.py new file mode 100644 index 0000000..02c26a0 --- /dev/null +++ b/SocialHelper/homepage/migrations/0004_chat.py @@ -0,0 +1,27 @@ +# Generated by Django 3.1.4 on 2021-01-07 16:40 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('homepage', '0003_merge_20210107_1740'), + ] + + operations = [ + migrations.CreateModel( + name='chat', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sec_user_id', models.IntegerField(default='')), + ('text', models.TextField(default='', max_length=5000)), + ('pub_date', models.DateTimeField(verbose_name='date published')), + ('author_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.product')), + ], + ), + ] diff --git a/SocialHelper/homepage/migrations/__pycache__/0003_merge_20210107_1740.cpython-37.pyc b/SocialHelper/homepage/migrations/__pycache__/0003_merge_20210107_1740.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..287d9d89df9469911bb00880a86bdf9eba5535b5 GIT binary patch literal 478 zcmZut%SyvQ6rD#}(wMGwtGjH&h<> zTzRK$D1sO6;oRq(J6HX_hrpiCzWFgm=+g$RIY1`h%?W@+66dJEF~;ZyNh0Yxl2qXZ zd809r&I|>eFX%%7HeQjXwOD4lZ00uA8UZo^Z;k*Iim^m6iX}-&Oj8s)lENCt^zPgF zfEf2h7pfAeiVqoM5f`ha<`IiR7P27^N6{!CwUuiAub+;mLC3h9m!eRd8;|os%T;c< z&-v?0Zx* Nd)1}g*4SR3{sPo0bT9w_ literal 0 HcmV?d00001 diff --git a/SocialHelper/homepage/migrations/__pycache__/0004_chat.cpython-37.pyc b/SocialHelper/homepage/migrations/__pycache__/0004_chat.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f0121858705f1fa0a1d4dcd7890c231b6557307d GIT binary patch literal 1077 zcmY*YOK;Oa5VqHjV>?b8+VDJaLW)393P=?dLWDkO1uYUO2dqjfCo^>%{9^3@?G+AO z`WFx!`Ad7{#4kYN#H`)4Vx=9;H#7Fkd^7v3-F7uP?;ic(>!zmtQebfiYftGG8zevj zJ=PN4*L9_{m?eg9B&Kgx*oYgx^;`oJ8ecSMpfPKHHvA?SBdursrth_$F6{!#GD^du z$E2G?p$N(-OABcw8DLx-OjO+Bc%(d~TYMvdny-WAGc>-N*qB*AbkIZQHz|(|3=DK; zF6E}|U_tZDJZ4~%tpyIaXF8!4A&-y;?K4JriEta1p;LLU5L&|JS!d?VuFO_c23V=$ zR{!@vx3-5CTs>ohQXB_809?Z}v1xFb_iXZwv;52RuO$BELVlzcyGKtn;uL1cy74?QQi;=>_vL;}d~Fi6C3Kh>}2@@OOA3odQJ^#L+2A?*oc)Rv=G< z1ZAth37?afM<5l&O~B(|9+%QA@lzRnT_xg~=n#d(c<_nGn1#Nk->aYlJm5)XtjTCq;Rt;%{q=ShT@>t zl{T-cckmtde{D3*8fa&B!Fy&evzB%0GZ${g% z`Tnb|?U&NKh={O|t<8$JeYHqJEv|HiMCXpGL3(>>i6M#_Ifukdt+uzQ`NJr|8oE1~ zz$i>#5akxkf;7w|gR!)$=4n-Bb8|S_9Byq(H_P#SeSd1=E+wqQ-{JPg(dg~o(I}hH zz;-dFu>Zk=u%pWda70`3kgJ90=O>~;KeOo;U8NYVZkeXeSXW=tJ9Ka9RYcF0t-8ei zBukHLlALo3j4M8CB5qz7`}I5PFWM1zRNX4yWe2r(k8IL@T+ix>noVJm@TdaY_y?o< BI${6- literal 0 HcmV?d00001 diff --git a/SocialHelper/homepage/models.py b/SocialHelper/homepage/models.py index 2b7e3b6..b44dee8 100644 --- a/SocialHelper/homepage/models.py +++ b/SocialHelper/homepage/models.py @@ -34,3 +34,10 @@ class Ocena(models.Model): user_iden = models.ForeignKey(User, on_delete=models.CASCADE) comm = models.TextField(max_length=40, blank=False, default="") ocena_jedn = models.FloatField(max_length=40, blank=False, default="") + +class chat(models.Model): + product_id = models.ForeignKey(Product, on_delete=models.CASCADE) + author_id = models.ForeignKey(User, on_delete=models.CASCADE) + sec_user_id = models.IntegerField(blank=False, default="") + text = models.TextField(max_length=5000, blank=False, default="") + pub_date = models.DateTimeField('date published') diff --git a/SocialHelper/homepage/templates/homepage/user_profile.html b/SocialHelper/homepage/templates/homepage/user_profile.html index 0310e7a..29b6354 100644 --- a/SocialHelper/homepage/templates/homepage/user_profile.html +++ b/SocialHelper/homepage/templates/homepage/user_profile.html @@ -11,12 +11,63 @@

Profil użytkownika

-
{{ name }}
-
- - {% if user.email %} -

- {% endif %} +
{{ name }}


+

Średnia Ocena: {{ocena}}

+ 0 + + {% if ocena > 9 %} + + {% else %} + + {% endif %} + {% if ocena > 19 %} + + {% else %} + + {% endif %} + {% if ocena > 29 %} + + {% else %} + + {% endif %} + {% if ocena > 39 %} + + {% else %} + + {% endif %} + {% if ocena > 49 %} + + {% else %} + + {% endif %} + {% if ocena > 59 %} + + {% else %} + + {% endif %} + {% if ocena > 69 %} + + {% else %} + + {% endif %} + {% if ocena > 79 %} + + {% else %} + + {% endif %} + {% if ocena > 89 %} + + {% else %} + + {% endif %} + {% if ocena > 99 %} + + {% else %} + + {% endif %} 100 + {% if user.email %} +

+ {% endif %}
diff --git a/SocialHelper/homepage/views.py b/SocialHelper/homepage/views.py index c3083d1..277fa3a 100644 --- a/SocialHelper/homepage/views.py +++ b/SocialHelper/homepage/views.py @@ -7,7 +7,7 @@ from django.template import loader from django.contrib.auth import get_user_model from django.contrib import messages, auth -from .models import Product, TYPE_T, TYPE_O, Places, Ocena +from .models import Product, TYPE_T, TYPE_O, Places, Ocena, chat from django.utils import timezone from datetime import timedelta @@ -152,7 +152,6 @@ def filter(request): types = TYPE_T types_o = TYPE_O - print(types) context = { 'all_product': all_product, 'types': types, @@ -450,7 +449,6 @@ def user_profile(request, user_name): ocena = 0 suma = 0 for ocena_j in oceny: - print(ocena) ocena = ocena + ocena_j.ocena_jedn suma = suma + 1 ocena = ocena / suma