From f6d68449b21b880f98b90690f13ed4fdc72b2867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Klepacki?= Date: Fri, 15 Jan 2021 19:27:40 +0100 Subject: [PATCH] =?UTF-8?q?panel=20admin=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/settings.cpython-37.pyc | Bin 2604 -> 2744 bytes .../__pycache__/urls.cpython-37.pyc | Bin 521 -> 561 bytes SocialHelper/SocialHelper/settings.py | 1 + SocialHelper/SocialHelper/urls.py | 1 + SocialHelper/control/__init__.py | 0 .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 141 bytes .../control/__pycache__/admin.cpython-37.pyc | Bin 0 -> 374 bytes .../control/__pycache__/apps.cpython-37.pyc | Bin 0 -> 359 bytes .../control/__pycache__/models.cpython-37.pyc | Bin 0 -> 1605 bytes .../control/__pycache__/urls.cpython-37.pyc | Bin 0 -> 1294 bytes .../control/__pycache__/views.cpython-37.pyc | Bin 0 -> 6486 bytes SocialHelper/control/admin.py | 7 + SocialHelper/control/apps.py | 5 + .../control/migrations/0001_initial.py | 58 +++++ SocialHelper/control/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-37.pyc | Bin 0 -> 1454 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 152 bytes SocialHelper/control/models.py | 28 +++ .../templates/control/OfferNotification.html | 23 ++ .../control/templates/control/UserList.html | 18 ++ .../templates/control/UserMessager.html | 21 ++ .../templates/control/UserNotification.html | 23 ++ .../templates/control/VIPUserList.html | 20 ++ .../control/templates/control/pulpit.html | 11 + SocialHelper/control/tests.py | 3 + SocialHelper/control/urls.py | 29 +++ SocialHelper/control/views.py | 203 ++++++++++++++++++ .../homepage/__pycache__/urls.cpython-37.pyc | Bin 1356 -> 1384 bytes .../homepage/__pycache__/views.cpython-37.pyc | Bin 13740 -> 13873 bytes SocialHelper/homepage/views.py | 2 +- 30 files changed, 452 insertions(+), 1 deletion(-) create mode 100644 SocialHelper/control/__init__.py create mode 100644 SocialHelper/control/__pycache__/__init__.cpython-37.pyc create mode 100644 SocialHelper/control/__pycache__/admin.cpython-37.pyc create mode 100644 SocialHelper/control/__pycache__/apps.cpython-37.pyc create mode 100644 SocialHelper/control/__pycache__/models.cpython-37.pyc create mode 100644 SocialHelper/control/__pycache__/urls.cpython-37.pyc create mode 100644 SocialHelper/control/__pycache__/views.cpython-37.pyc create mode 100644 SocialHelper/control/admin.py create mode 100644 SocialHelper/control/apps.py create mode 100644 SocialHelper/control/migrations/0001_initial.py create mode 100644 SocialHelper/control/migrations/__init__.py create mode 100644 SocialHelper/control/migrations/__pycache__/0001_initial.cpython-37.pyc create mode 100644 SocialHelper/control/migrations/__pycache__/__init__.cpython-37.pyc create mode 100644 SocialHelper/control/models.py create mode 100644 SocialHelper/control/templates/control/OfferNotification.html create mode 100644 SocialHelper/control/templates/control/UserList.html create mode 100644 SocialHelper/control/templates/control/UserMessager.html create mode 100644 SocialHelper/control/templates/control/UserNotification.html create mode 100644 SocialHelper/control/templates/control/VIPUserList.html create mode 100644 SocialHelper/control/templates/control/pulpit.html create mode 100644 SocialHelper/control/tests.py create mode 100644 SocialHelper/control/urls.py create mode 100644 SocialHelper/control/views.py diff --git a/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc b/SocialHelper/SocialHelper/__pycache__/settings.cpython-37.pyc index 3f237a56881b204b843d3593055fe2f46eab4ecb..4d73774280158655f9bfc4768b667b101f3765ab 100644 GIT binary patch delta 393 zcmX|7yG{a86x_R6kVW3Gyx%H_0=|3EAhA#qP>a(jaW)$WFL&wv2183BjfsgJ4Y4uS z{sD!JKjH-=lguP@W|DJq-h5Lfdt$d+1rEHkyQxDEe&*&M^W>P*2tH-cAK}ofWQ7wh zxZ!~pJ}BA>t-?<>1T+B>f(Rju2%?(QWQdI)05Xnv9&tAj?}B zY%Vmn(5)uZBywS!+{lv$5_vg&oYx8p_wD?;FL_KQs9f&rE(clX++i z8r^|GW;D8*s^`)ZkL8Am6c~P(0tMa9e>AgnRKsX!sxdQ_Yqe^PY!~Hvy;LdRUX?2K bS3%G7mYyFz$W_)Ie#(jAw|ptNB%AmP$y8%b delta 278 zcmX|+yGjFL5QYC)|3r6nH@Dr~FB*;Ode>eQ5kwFygcOq^%?W?jGCqLMAln8pjUd=< zTq(8GQKRrRzFM^n#yZ*Hh~25B_D#a3OwF&*9CJvDtx#9P%ij zh!T9W%&Q1^4P~RCQ9%_o)X^|HCN!to5W8rxhc-G`#|FCC#MU$u6X(#wwp{fP&U0s; zQA|d29=lw?9v7jxB=*Gt&i1*C1Fnqd!FsKZvN)VsTwBnQP#wqISZq#amK12hx>wO@ ldPQ%PW|z)0)Jg{{eX`%xB$D4IQSxoy(KxwwI?33%{RMz=KbHUi diff --git a/SocialHelper/SocialHelper/__pycache__/urls.cpython-37.pyc b/SocialHelper/SocialHelper/__pycache__/urls.cpython-37.pyc index dedee573b00e03e095335188f448299aa1cfd008..66a155bd66970208953e779bc1b5b46dd33b1fe6 100644 GIT binary patch delta 150 zcmeBV*~p^q#LLUY00auV850&VGB7*_abSQA$Z!DS;+l!-A-c>dT+NKlOsOm>+^LLN zoLOAWOzAAC9I0$s+(68e!qdwn&Je|$!W+z>$v1IMk`PC7eqKpYevW<>50o|W$1XN= fSF4zSqRHDB9Yq9yX7ex#F!3<*Fat3V@-YGcn?4@V delta 116 zcmdnU(#fLk#LLUY00i2rKgJg_GB7*_abSQI$Z!DS;)03lA&QJyoLOAWOzF(29I0$s z+(68e!qv+p&Je|$!X3<@$un_9(qtvZEi9(4Rxy+BFggnH0rm1Q3NZ07@-PE2BOfCG D(ascQ diff --git a/SocialHelper/SocialHelper/settings.py b/SocialHelper/SocialHelper/settings.py index 5cb9ba6..fca1973 100644 --- a/SocialHelper/SocialHelper/settings.py +++ b/SocialHelper/SocialHelper/settings.py @@ -33,6 +33,7 @@ ALLOWED_HOSTS = [] INSTALLED_APPS = [ 'homepage.apps.HomepageConfig', 'enGB.apps.EngbConfig', + 'control.apps.ControlConfig', 'django.contrib.postgres', 'django.contrib.admin', 'django.contrib.auth', diff --git a/SocialHelper/SocialHelper/urls.py b/SocialHelper/SocialHelper/urls.py index 6daf9c2..0c1721f 100644 --- a/SocialHelper/SocialHelper/urls.py +++ b/SocialHelper/SocialHelper/urls.py @@ -7,5 +7,6 @@ from django.conf.urls.static import static urlpatterns = [ path('homepage/', include('homepage.urls')), path('enGB/', include('enGB.urls')), + path('control/', include('control.urls')), path('admin/', admin.site.urls), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/SocialHelper/control/__init__.py b/SocialHelper/control/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/SocialHelper/control/__pycache__/__init__.cpython-37.pyc b/SocialHelper/control/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6607e8549f7a1c2015134ba9017ba827a6cb8dd7 GIT binary patch literal 141 zcmZ?b<>g`kg1oJa2_X70h=2h`Aj1KOi&=m~3PUi1CZpd4Yab;@TC?RHoWFFrrRX&VLS PVILPhc}|a`ISuCr#Zh6S literal 0 HcmV?d00001 diff --git a/SocialHelper/control/__pycache__/apps.cpython-37.pyc b/SocialHelper/control/__pycache__/apps.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4130692e8b25fd21ca69a48e4abb094e75c8e9c8 GIT binary patch literal 359 zcmY*U!A`?447Hmgy0J=p0@q%4*byN#KnS=@NIel%WKk2Qp|lApJ8*`d;RE=YTsiRz zJK?mO5SILG=lR*rWuA|Lto_2}BgOAn>@B5aPTrjmC{SpiL5>JFpc2JCKrxN)j3+8B zp*Z-VE+{aJE}Xlv?bCWy$Cte!C3Eubm_P$Z1*AmIR6=SNa?-qdYX&JltcP+@q#+Zc zm5ml6jD={d+L)M6gm~FVvt!a2Kfz}-y@&1W`n07o;f~KX~U!daNak5H8RzQI*AK$rSd#=wtXEqxRpTP0?8-4xVB;*GUrU#74I$XsV zfDuLoNohza#x+q(jnL4sAt^T7yR$T-Y}j62DAknxxg z8Gn-TAya1oWP(Yi&dd&JHqKym(xl2xbH+shk@=$F67J5P%-N`0?soB!>0v>z4p*@W zz)46M32WRqG8tvH6B=3&+uQ+knQ>AJJ&1f}V#&-oF~T}GP6OtCp<#o0P=K#icJngn zCEd78@@xca@8jZ(_u`Q#A@uSrg3@@&lTVijX)Dq+l%K}qNbsy*4wQ8$;_QvIp`iCm zEH3%&;pk8##elQj=8|%wD2r1bMaqvN_{)*NIEbRRqgYfkvIg&}U^CAJkF$2d1ygq1 zEt7X#`R!ctq@O+I$I`&ZoUM({*2eaZ^03$_VLVgbJ|CCWdu9otYHULt`$@_tNi6Ft zk=Nh@8h+l}xqq-HJFlJ`bn z0eVm5WrQmTR}s$ntfK3fy8(b7p63X&i#d7@GZzV&8I^QFxF~6RX6)**b3PA3KlQb+ z>l0zu(MTyTinz}~)0&F2JFr@NF-@An-xVDEfh*)inJ8ps@ib1v-;i_@UP4w2Y|>On zASKMt(R98|-G!NpXqxvs&|reU>&yaw+sb*F3@5gp70kc?s1^lUa7Gj;g)rdbVIp}E zq01I(;ubuH3MkM#)$dBoH3Q|bqd4p5Ep}M#0yigPZNB8N6_3h6t8$?Bf4DrzQ$B>A xPP0gna&hev46m$bxRYvAYAtF`^=gYsQ|^OmPkKnPKD0mpz7D8cTeIPGegPU}R)7Ei literal 0 HcmV?d00001 diff --git a/SocialHelper/control/__pycache__/urls.cpython-37.pyc b/SocialHelper/control/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6016956268af60079fc7303f94574517584edc60 GIT binary patch literal 1294 zcmZ{k+fLg+5Qf)I;yAGr9LR}K3N7>^H&p5+La0u|~*Lhc|lo?(>ek-4U6&U+NFu4}dc#C&zDU1OF z#busiE1qhr3Ii2#ZqCcwd9)ei-GZmtT51>EqNm%s!ngt&&tI3I2>M+Psf1L9vLpk^ z08>&0$%Lw;1*8gCl4?j*Sd_Gcv;cKU4I~Sil3GYLXiHi~T7-_I6{ID2CTSI^4$md6 zAvIuK(hH;}yd)Y`xz4rg7T#^xxKmrqUWUyJ)_rwPbLy%|KJ1GxNzw5K?ilzz&Wd%F zq;TW#uQ3{W%!P3L5!qTS`ob9`EYZTT8#)5l@_ygrwsjfv=p+!%&>5gh;3xH28sqL+ zf5dM$_PNUif9(Bw$MMCsABdgZxs(;`~7isz^T!C>rhU-Y6N5GUPEV!(CZ9|c?E$c-Zv zk7bl2(Mj-IXAcg8z#m2$t+Zqat)y{V*@=yc6jUNHNKBFnNtI-Q#3HGY&>u&%L{cYd zkhDnJC`sw~VE=HhcX@u4lr!`E^z=hwV4L_Q2_E_JPZq6{Kgr)W2isR?(Z#33tBYXZ z^xgN|4S6&V*sq8J_lh2MEBv15J6-@|m+#Wo7;mCjim954nX9T*1%Fe0u&mragL#Tm literal 0 HcmV?d00001 diff --git a/SocialHelper/control/__pycache__/views.cpython-37.pyc b/SocialHelper/control/__pycache__/views.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5999900573a1c8333248b85374079912e7117530 GIT binary patch literal 6486 zcmd5=TW=f372f+UFQTZM@0Mj-zA(0BCvlQCO;ab0UE57;CB6V%7@%p+N?K}{tIQ5< zS)foL>0|u^0`!4?DNvwK>8syb1N{vP6bR6l8t5l|I?7UgkOALRTQQ$HBds;RYT3yLfzF>s?!1^G+i^a zTr0F)Th{4;6BgV;SagfBYy_pS?3QKT493EWTakGy7!Rv%RpxEXGvQ9iyc0}@Q|?qa z?M};bA(#pGxO-&280-!Ax%*_k6zmTVxCdmu92^V}xrdM+W0l}=IP1=aN8BUfoI4jD zb&twE>mY%^*F+_OQK3PqTe&KhhdI zzz!mPiydNzk)C0*>pj8dX61q$B{0ud3FNnd3KVWLVAInW;LX5v$xn8r0=k^ z>>Sc}*~BfSw(x>*uj$FevM1`%gO=As!s{0=TudzPwVB5ghkMNDXh64eqa#+lw(y$` z;U#7eE&J`nLK1aEO-ssGg;@K_i`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phfo@EH~xxnQX%M%VvB+QB~Zxj#+BUN zxUwz2K+M5(#056f5EnQo8BgGg$+!T17-9zU$O^q8v*4o{%x{ye5snNeI8tVt znFsjLU+cRtiH^cZ%UQ{=&KUlC%o5X=_gxoqUW$G9-PoP3$oZ~UBcbX_GX8}=V3`nV%f^x83A zIle>3A?S->d*(TQiPnLAA+`_f3poTC^gDfT6&7SG%F_l>o(`sKupkDaJRR|iF|Z&z zqdfARH)i_gV!N%FN88TZYRmb41>=y?HARf3+tn`cU!e7m_zmo@wPg*cZ9q*Mg#kYQ zMj^xJha5G37)?zEWXKW-8@K_R?7aq5Fd+r|i8O!lV82JKZ?@rjNXB5T`-Qhr3+5oIwwutnv8Lhu{d zI}FlIN;GMgWE|O{Bh3d=EvUv^3lAS;puF(tmCTBD=w5~PJbuLg`WG-@oAT&#u5?yX zkBx~N4c6G+XXYigPU@C4c*K;%^44(;#c70V;sqw+X?#n^n=ZGdh%$&H6UncUSb(V6 z=}mKqD&%z|b#Rf2q=>HF_8!&A77m4T)+dZ%>))eKd={c_{)%`vKGT8;K{v=FaETr@k_2Ki07XQrvFgH$E|!2&&gapEZ_Tgr*GNh#~I zf~VT_F{D7%vm=HsFs~W$hKP8~i}|q~9>lyvHRIW^{^L~o&_e2&RJPBU#>L~*QqEdB z!pA)F4w}!Z()X#Ybr+g}-&}1qnyY?$nNQH@J__u?f_xZ``6Q~{@s%j_)^MTsYbg>) ztgH(~5W}x|{fV$g48mhB-%mpvx&i4;mrL%vPb1~)2fa>k3b51Qf#M;4nZy+mh%&D{|^6+wOki2*gt%>syKCTmZACp%XQ>-=(8dP!Q>Hk)4pIX+a&e5E`PRS|a NN0QQ_GbaDb{{?jHn0x>L literal 0 HcmV?d00001 diff --git a/SocialHelper/control/admin.py b/SocialHelper/control/admin.py new file mode 100644 index 0000000..767181c --- /dev/null +++ b/SocialHelper/control/admin.py @@ -0,0 +1,7 @@ +from django.contrib import admin +from .models import Notificationuser, Notificationoffer, Usermessage, Vipuser + +admin.site.register(Notificationuser) +admin.site.register(Notificationoffer) +admin.site.register(Usermessage) +admin.site.register(Vipuser) diff --git a/SocialHelper/control/apps.py b/SocialHelper/control/apps.py new file mode 100644 index 0000000..a5f7085 --- /dev/null +++ b/SocialHelper/control/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ControlConfig(AppConfig): + name = 'control' diff --git a/SocialHelper/control/migrations/0001_initial.py b/SocialHelper/control/migrations/0001_initial.py new file mode 100644 index 0000000..cfc819d --- /dev/null +++ b/SocialHelper/control/migrations/0001_initial.py @@ -0,0 +1,58 @@ +# Generated by Django 3.1.4 on 2021-01-15 15:54 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('homepage', '0004_chat'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Usermessage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('active', models.BooleanField(default=True)), + ('name', models.TextField(default='', max_length=40)), + ('email', models.TextField(default='', max_length=40)), + ('text', models.TextField(default='', max_length=5000)), + ('date', models.DateTimeField(verbose_name='date published')), + ], + ), + migrations.CreateModel( + name='Vipuser', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('active', models.BooleanField(default=True)), + ('expires_date', models.DateTimeField(verbose_name='date published')), + ('user_iden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Notificationuser', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('active', models.BooleanField(default=True)), + ('text', models.TextField(default='', max_length=5000)), + ('date', models.DateTimeField(verbose_name='date published')), + ('user_iden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Notificationoffer', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('active', models.BooleanField(default=True)), + ('text', models.TextField(default='', max_length=5000)), + ('date', models.DateTimeField(verbose_name='date published')), + ('user_iden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.product')), + ], + ), + ] diff --git a/SocialHelper/control/migrations/__init__.py b/SocialHelper/control/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/SocialHelper/control/migrations/__pycache__/0001_initial.cpython-37.pyc b/SocialHelper/control/migrations/__pycache__/0001_initial.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9a5c535ca0d953c5e1e3ab762319db531b26b1a GIT binary patch literal 1454 zcmb_cOK;mo5GI!tMe1caR??;qAjj%Z!F`;9B8X$lP0-pcDmy?316ztSqL<~XODeH_ zO%A>IKeWf*dhT!NFW75O`3pUDmXwsFhaiV8vCH{pciyx6px^HpH2(V2{P8hSe`~NF zHWBw}mUn3Z1I)xoP2V&%%@USczLna(U1KY0`Oen{*wA`mKntz7{oL}~V9kuN^OEF^ zv8mh=t4d^1IcBPpibw{P$g@&8X%3i_$DuyA9s?ro(=7im4Fe6|1jA=w`W7&>e{G=? zw|_Gu=DTRe9#~*wC+>ntUke;)U)u`?F7bNA@vcom9YTHRLJ#`ajPT$;cx#1+tNm@l z1GoV@S~_xIbWN7Y*3EaYb?bFmc#qH)4&&{(6W@q;wD0h~_93!2T5rFD*0*~27Avid zl@I=JEAZhelG;XO`y=>>YW}hEj@AV}p>n(Dd5T34q4IWjcfaJ}c~GhDX^Aq$vebMg z;83wg2V-0Hf@PKSP-0LasBR%e8puoj6J9EhBt(#iD^$IwDCc>JJPT4(P7qe&DN>iU z0T;nCsgzxB7%xAeE*djAq#w0iaKRJIqUv0=Fbzba>;3wjH34Pj8kVL@mZCt;c;Gx zg$V1muVuGi=j4k8%B$fzQZb-+&Ud} z>s5PyZ??a8Fjbwrz|~9eyCFX(gZ1*ybb9yfdpUdZ=xmmU6xTyc=-`_m%(F`7$=R#N zmd*K|JMt)s*<2u4L)Z(jz}z>t9AP BltKUi literal 0 HcmV?d00001 diff --git a/SocialHelper/control/migrations/__pycache__/__init__.cpython-37.pyc b/SocialHelper/control/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..406921a3fb55e5fcfc944c0bc219d8521ceda9c0 GIT binary patch literal 152 zcmZ?b<>g`kg3_&w2_X70h=2h`Aj1KOi&=m~3PUi1CZpd +Powrót + + + + + + + + +{% for offer in all_Notificationoffer %} + + + + + + + +{% endfor %} +
Nr OfertyOpis ZgłoszeniaData ZgłoszeniaUsuń OferteZamknij Zgłoszenie
{{offer.id}}{{offer.text}}{{offer.date}}UsuńZamknij
+{% endblock %} diff --git a/SocialHelper/control/templates/control/UserList.html b/SocialHelper/control/templates/control/UserList.html new file mode 100644 index 0000000..7f81fa2 --- /dev/null +++ b/SocialHelper/control/templates/control/UserList.html @@ -0,0 +1,18 @@ +{% block content %} + +Powrót + + + + + + +{% for user in all_User %} + + + + + +{% endfor %} +
EmailNadaj VIPUsuń Konto
{{user.email}}DodajUsuń
+{% endblock %} diff --git a/SocialHelper/control/templates/control/UserMessager.html b/SocialHelper/control/templates/control/UserMessager.html new file mode 100644 index 0000000..f4bc3d5 --- /dev/null +++ b/SocialHelper/control/templates/control/UserMessager.html @@ -0,0 +1,21 @@ + +{% block content %} + +Powrót + + + + + + + +{% for mess in all_Usermessage %} + + + + + + +{% endfor %} +
AdresatemailTreśćZamknij Zgłoszenie
{{mess.name}}{{mess.email}}{{mess.text}}Zamknij
+{% endblock %} diff --git a/SocialHelper/control/templates/control/UserNotification.html b/SocialHelper/control/templates/control/UserNotification.html new file mode 100644 index 0000000..d4b3f6b --- /dev/null +++ b/SocialHelper/control/templates/control/UserNotification.html @@ -0,0 +1,23 @@ + +{% block content %} + +Powrót + + + + + + + + +{% for user in all_Notificationuser %} + + + + + + + +{% endfor %} +
EmailOpis ZgłoszeniaData ZgłoszeniaUsuń UżytkownikaZamknij Zgłoszenie
{{user.user_iden}}{{user.text}}{{user.date}}UsuńZamknij
+{% endblock %} diff --git a/SocialHelper/control/templates/control/VIPUserList.html b/SocialHelper/control/templates/control/VIPUserList.html new file mode 100644 index 0000000..e251a3b --- /dev/null +++ b/SocialHelper/control/templates/control/VIPUserList.html @@ -0,0 +1,20 @@ +{% block content %} + +Powrót + + + + + + + +{% for user in all_Vipuser %} + + + + + + +{% endfor %} +
EmailUsuń KontoZakończ VIPPrzedłuż VIP
{{user.email}}UsuńZakończPrzedłuż
+{% endblock %} diff --git a/SocialHelper/control/templates/control/pulpit.html b/SocialHelper/control/templates/control/pulpit.html new file mode 100644 index 0000000..1681187 --- /dev/null +++ b/SocialHelper/control/templates/control/pulpit.html @@ -0,0 +1,11 @@ + +{% block content %} + + +
+
+
+
+
+ +{% endblock %} diff --git a/SocialHelper/control/tests.py b/SocialHelper/control/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/SocialHelper/control/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/SocialHelper/control/urls.py b/SocialHelper/control/urls.py new file mode 100644 index 0000000..de9d510 --- /dev/null +++ b/SocialHelper/control/urls.py @@ -0,0 +1,29 @@ +from django.urls import path, include +from . import views + +from django.conf import settings +from django.conf.urls.static import static + +urlpatterns = [ + path('', views.pulpit, name='pulpit'), + + path('UserNotification', views.NotificationuserPage, name='NotificationuserPage'), + path('DeleteUserNotification/', views.Notificationuser_deletenot, name='Notificationuser_deletenot'), + path('DeleteUser/', views.Notificationuser_deleteuser, name='Notificationuser_deleteuser'), + + path('OfferNotification', views.NotificationofferPage, name='NotificationofferPage'), + path('DeleteOfferNotification/', views.Notificationoffer_deletenot, name='Notificationoffer_deletenot'), + path('DeleteOffer/', views.Notificationoffer_deleteoffer, name='Notificationoffer_deleteoffer'), + + path('UserMessager', views.UsermessagerPage, name='UsermessagerPage'), + path('DeleteUserMessager/', views.Usermessager_deletenot, name='Usermessager_deletenot'), + + path('VIPUserList', views.VipuserPage, name='VipuserPage'), + path('DeleteVIP/', views.Vipuser_delete, name='Vipuser_delete'), + path('ExtendVIP/', views.Vipuser_extension, name='Vipuser_extension'), + + path('UserList', views.UserPage, name='UserPage'), + path('AddVIP/', views.AddVIP, name='AddVIP'), + + +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/SocialHelper/control/views.py b/SocialHelper/control/views.py new file mode 100644 index 0000000..2ca4cc8 --- /dev/null +++ b/SocialHelper/control/views.py @@ -0,0 +1,203 @@ +from django.shortcuts import get_object_or_404, render, redirect +from django.contrib.auth import authenticate, login, logout +from django.http import HttpResponse, HttpResponseRedirect +from django.contrib.auth.decorators import login_required +from django.urls import reverse +from django.template import loader +from django.contrib.auth import get_user_model +from django.contrib import messages, auth +from django.utils import timezone +from django.views.decorators.clickjacking import xframe_options_exempt +from django.db.models import Q +from homepage.models import Product +from .models import Notificationuser, Notificationoffer, Usermessage, Vipuser +from django.core.mail import send_mail + +from django.utils import timezone +from datetime import timedelta +import datetime + +def pulpit(request): + if request.user.is_authenticated and request.user.is_superuser == True: + User = get_user_model() + all_Notificationuser = Notificationuser.objects.filter(active = True).count() + all_Notificationoffer = Notificationoffer.objects.filter(active = True).count() + all_Usermessage = Usermessage.objects.filter(active = True).count() + all_User = User.objects.filter(is_active = True).count() + + all_Vipuser_list = Vipuser.objects.values_list('user_iden', flat=True).distinct('user_iden').filter(active = True) + all_Vipuser = User.objects.filter(id__in = all_Vipuser_list).count() + + template = loader.get_template('control/pulpit.html') + context = { + 'all_Notificationuser': all_Notificationuser, + 'all_Notificationoffer': all_Notificationoffer, + 'all_Usermessage': all_Usermessage, + 'all_Vipuser': all_Vipuser, + 'all_User': all_User + } + return HttpResponse(template.render(context, request)) + else: + return redirect(index) + +def NotificationuserPage(request): + if request.user.is_authenticated and request.user.is_superuser == True: + all_Notificationuser = Notificationuser.objects.filter(active = True) + template = loader.get_template('control/UserNotification.html') + context = { + 'all_Notificationuser': all_Notificationuser, + } + return HttpResponse(template.render(context, request)) + else: + return redirect(index) + +def Notificationuser_deletenot(request, not_id): + if request.user.is_authenticated and request.user.is_superuser == True: + instance = Notificationuser.objects.get(id=not_id) + instance.active = False + instance.save() + messages.success(request, 'Zgłoszenie Zamknięte') + return redirect(NotificationuserPage) + else: + return redirect(index) + +def Notificationuser_deleteuser(request, user_id): + if request.user.is_authenticated and request.user.is_superuser == True: + User = get_user_model() + instance = User.objects.get(id=user_id) + instance.is_active = False + instance.save() + messages.success(request, 'Użytkownik Usunięty') + return redirect(UserPage) + else: + return redirect(index) + +def NotificationofferPage(request): + if request.user.is_authenticated and request.user.is_superuser == True: + all_Notificationoffer = Notificationoffer.objects.filter(active = True) + template = loader.get_template('control/OfferNotification.html') + context = { + 'all_Notificationoffer': all_Notificationoffer, + } + return HttpResponse(template.render(context, request)) + else: + return redirect(index) + +def Notificationoffer_deletenot(request, not_id): + if request.user.is_authenticated and request.user.is_superuser == True: + instance = Notificationoffer.objects.get(id=not_id) + instance.active = False + instance.save() + messages.success(request, 'Zgłoszenie Zamknięte') + return redirect(NotificationofferPage) + else: + return redirect(index) + +def Notificationoffer_deleteoffer(request, offer_id): + if request.user.is_authenticated and request.user.is_superuser == True: + instance = Product.objects.get(id=offer_id) + instance.is_active = False + instance.save() + messages.success(request, 'Ogłoszenie Usunięte') + return redirect(NotificationofferPage) + else: + return redirect(index) + +def UsermessagerPage(request): + if request.user.is_authenticated and request.user.is_superuser == True: + all_Usermessage = Usermessage.objects.filter(active = True) + template = loader.get_template('control/UserMessager.html') + context = { + 'all_Usermessage': all_Usermessage, + } + return HttpResponse(template.render(context, request)) + else: + return redirect(index) + +def Usermessager_deletenot(request, not_id): + if request.user.is_authenticated and request.user.is_superuser == True: + instance = Usermessage.objects.get(id=not_id) + instance.active = False + instance.save() + messages.success(request, 'Zgłoszenie Zamknięte') + return redirect(UsermessagerPage) + else: + return redirect(index) + +def VipuserPage(request): + if request.user.is_authenticated and request.user.is_superuser == True: + User = get_user_model() + all_Vipuser_list = Vipuser.objects.values_list('user_iden', flat=True).distinct('user_iden').filter(active = True) + all_Vipuser = User.objects.filter(id__in = all_Vipuser_list) + template = loader.get_template('control/VIPUserList.html') + context = { + 'all_Vipuser': all_Vipuser, + } + return HttpResponse(template.render(context, request)) + else: + return redirect(index) + +def Vipuser_delete(request, vip_id): + if request.user.is_authenticated and request.user.is_superuser == True: + User = get_user_model() + vip = User.objects.get(id = vip_id) + instance = Vipuser.objects.get(user_iden = vip) + instance.active = False + instance.expires_date = timezone.now() + instance.save() + messages.success(request, 'Usunięto status VIP') + return redirect(VipuserPage) + else: + return redirect(index) + +def Vipuser_extension(request, vip_id): + if request.user.is_authenticated and request.user.is_superuser == True: + User = get_user_model() + vip = User.objects.get(id = vip_id) + instance = Vipuser.objects.get(user_iden = vip) + d = timedelta(days=31) + instance.expires_date += d + instance.save() + messages.success(request, 'Przedłużono status VIP') + return redirect(VipuserPage) + else: + return redirect(index) + +def UserPage(request): + if request.user.is_authenticated and request.user.is_superuser == True: + User = get_user_model() + all_User = User.objects.filter(is_active = True) + template = loader.get_template('control/UserList.html') + context = { + 'all_User': all_User, + } + return HttpResponse(template.render(context, request)) + else: + return redirect(index) + +def AddVIP(request, user_id): + if request.user.is_authenticated and request.user.is_superuser == True: + User = get_user_model() + vip = User.objects.get(id = user_id) + d = timedelta(days=31) + if Vipuser.objects.filter(user_iden = vip, active = True).exists(): + messages.error(request, 'Użytkownik już jest VIPem!') + return redirect(UserPage) + elif Vipuser.objects.filter(user_iden = vip, active = False).exists(): + instance = Vipuser.objects.get(user_iden = vip) + instance.active = True + instance.expires_date += d + instance.save() + messages.success(request, 'Przywrócono status VIP') + return redirect(UserPage) + else: + new_vip = Vipuser( + active = True, + user_iden = vip, + expires_date = timezone.now() + d + ) + new_vip.save() + messages.success(request, 'Nadano status VIP') + return redirect(UserPage) + else: + return redirect(index) diff --git a/SocialHelper/homepage/__pycache__/urls.cpython-37.pyc b/SocialHelper/homepage/__pycache__/urls.cpython-37.pyc index 9d4d0b1418659d80b4ffa7e404b6c4d94022d854..ff398b94d92694fb93620f853de264a3a812fb25 100644 GIT binary patch delta 214 zcmX@Z^@2;?iI*Q~6GN%^Il7c;psGAd4f$-I@RNMZ797A-anpxcTx TCZA?;XSA3s%&IZjl2sT0kKr-~ delta 191 zcmaFCb%smbiIlk;;}O3&e6Ms=Z9& z3{mnaYQYSe>XT0}zTUix$(fN+Ve&ubt&?}KsI#d99Z{q{`6-J#quFF#R*lKwtbzc% Cuq|8w diff --git a/SocialHelper/homepage/__pycache__/views.cpython-37.pyc b/SocialHelper/homepage/__pycache__/views.cpython-37.pyc index 14daca583439297939a7305734f19fd628315ff4..4d3c09d60e8815e628ad6156fa39df6220a5c689 100644 GIT binary patch delta 2622 zcmaKuZERCj7{`0M_EOq)>sGe0LFo$YrF(}l*w|}eFcBCcV?YJF(t8Kny54!(@n*+_ z88hW|JR%AhKty6B8qz2v#%N-KCd5dLUo0P#55_NiQiESGdj6-&I%Z@`e)qZ0dCob{ z+c~#425yGztL%2GLHxb@73=w6!k*8@ZEP>u8iBQ4bTiX!A`{m7Ny4v zn%F*Sa2K(|aldh$0iV3Lrz-4r$t{$14I5XIS1Y zsq9K$XLy5kZc}^FF}9uV71dyK+a;W42g&zdg?|VvAW-i+EaJy1dOGwAOjh+0@x{ z#50-^vyHJ4TiBvn4jiat@nt(U(r+a-N;j0vy7|en}z~9ebhsiilCNG3brFPFipXn0WL@+z$o8c}|PlQ0GK!9jkUe(~nA6ZDtY)A7IU zKBLp;is@ViJna-hCwt@+`O6kBI)QiD)F*}HOHX>?59z@`D0%yhkf+vVw*^$y4^Omk z^mn>fR?a5kkIT+8)=1|ns@NI2Q&H$3v4oc;OueB%RFr|}QH7TLKs8dJ(z#IjmyaD$ zn}jK>hqZ)xIE+tc6V%J;t;)_?c{!iQyZp?agRLdFHxTvrMxv8aB&hPYVe$?TrM#+g zW~0?r|8&Yz1W)*zz!`yr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c$1_NfnQWIrI41IqqLXmUKrH{m;vfXFBgm^1|<37V`ad#Xe| z^QyB5AIn2Ouc=PaPc_TRPrybN=1Cz9zCNih$U2(G!2LRQ4z{B6s-@kHMGuASe^=IF?K_2lcsPa z988)g!}y77hPsg!db%5iAf5;0&*29`N@fK{{88Vq9-Wi)fW|+B$wz=r=RCD6i|%{= z?UrqTQ*Z)i1(K#{@BmJO{#DIV$I~WPV0RW%_PP5Cin(UV^}6gbrYK|nGO&}Hy(I~G08!l#ga7~l diff --git a/SocialHelper/homepage/views.py b/SocialHelper/homepage/views.py index 6fac099..d35fd52 100644 --- a/SocialHelper/homepage/views.py +++ b/SocialHelper/homepage/views.py @@ -470,7 +470,7 @@ def user_profile(request, user_name): types = TYPE_T types_o = TYPE_O - + suma = 0 if Ocena.objects.filter(user_iden = user_prof.id).exists(): ocena = 0 suma = 0