From e1baf91900f75f33c89bb3464d9a9bf5dbe22dcd Mon Sep 17 00:00:00 2001 From: Shreyas Sarve Date: Tue, 19 Jul 2022 16:35:08 +0530 Subject: [PATCH] Initial Commit --- .gitignore | 1 + base/__init__.py | 0 base/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 148 bytes base/__pycache__/admin.cpython-310.pyc | Bin 0 -> 321 bytes base/__pycache__/apps.cpython-310.pyc | Bin 0 -> 423 bytes base/__pycache__/forms.cpython-310.pyc | Bin 0 -> 569 bytes base/__pycache__/models.cpython-310.pyc | Bin 0 -> 1883 bytes base/__pycache__/urls.cpython-310.pyc | Bin 0 -> 639 bytes base/__pycache__/views.cpython-310.pyc | Bin 0 -> 4014 bytes base/admin.py | 8 + base/apps.py | 6 + base/forms.py | 16 + base/migrations/0001_initial.py | 24 + ...0002_topic_room_user_message_room_topic.py | 44 + base/migrations/0003_rename_user_room_host.py | 18 + ...04_alter_room_options_room_participants.py | 24 + base/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-310.pyc | Bin 0 -> 802 bytes ...om_user_message_room_topic.cpython-310.pyc | Bin 0 -> 1317 bytes ...0003_rename_user_room_host.cpython-310.pyc | Bin 0 -> 566 bytes ..._options_room_participants.cpython-310.pyc | Bin 0 -> 834 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 159 bytes base/models.py | 43 + base/templates/base/activity_component.html | 56 + base/templates/base/delete.html | 39 + base/templates/base/delete_old.html | 10 + base/templates/base/feed_component.html | 65 + base/templates/base/home.html | 65 + base/templates/base/home_old.html | 25 + base/templates/base/login_register._oldhtml | 50 + base/templates/base/login_register.html | 63 + base/templates/base/profile.html | 48 + base/templates/base/profile_old.html | 30 + base/templates/base/room.html | 184 +++ base/templates/base/room_form.html | 86 ++ base/templates/base/room_form_old.html | 8 + base/templates/base/room_old.html | 45 + base/templates/base/signup.html | 79 ++ base/templates/base/topics.html | 53 + base/templates/base/topics_component.html | 33 + base/templates/base/update-user.html | 44 + base/tests.py | 3 + base/urls.py | 19 + base/views.py | 201 +++ manage.py | 22 + requirements.txt | 6 + static/images/avatar.svg | 49 + static/images/favicon.ico | Bin 0 -> 15406 bytes static/images/icons/add.svg | 4 + static/images/icons/arrow-left.svg | 4 + static/images/icons/chevron-down.svg | 4 + static/images/icons/delete.svg | 4 + static/images/icons/edit.svg | 1 + static/images/icons/ellipsis-horizontal.svg | 6 + static/images/icons/ellipsis-vertical.svg | 6 + static/images/icons/lock.svg | 5 + static/images/icons/remove.svg | 4 + static/images/icons/search.svg | 4 + static/images/icons/sign-out.svg | 5 + static/images/icons/tools.svg | 4 + static/images/icons/user-group.svg | 7 + static/images/icons/user.svg | 5 + static/images/logo.svg | 12 + static/scripts/script.js | 69 + static/styles/main.css | 4 + static/styles/style.css | 1165 +++++++++++++++++ studybud/__init__.py | 0 studybud/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 152 bytes studybud/__pycache__/settings.cpython-310.pyc | Bin 0 -> 2320 bytes studybud/__pycache__/urls.cpython-310.pyc | Bin 0 -> 975 bytes studybud/asgi.py | 16 + studybud/settings.py | 127 ++ studybud/urls.py | 22 + studybud/wsgi.py | 16 + templates/main.html | 29 + templates/navbar.html | 83 ++ 76 files changed, 3073 insertions(+) create mode 100644 .gitignore create mode 100644 base/__init__.py create mode 100644 base/__pycache__/__init__.cpython-310.pyc create mode 100644 base/__pycache__/admin.cpython-310.pyc create mode 100644 base/__pycache__/apps.cpython-310.pyc create mode 100644 base/__pycache__/forms.cpython-310.pyc create mode 100644 base/__pycache__/models.cpython-310.pyc create mode 100644 base/__pycache__/urls.cpython-310.pyc create mode 100644 base/__pycache__/views.cpython-310.pyc create mode 100644 base/admin.py create mode 100644 base/apps.py create mode 100644 base/forms.py create mode 100644 base/migrations/0001_initial.py create mode 100644 base/migrations/0002_topic_room_user_message_room_topic.py create mode 100644 base/migrations/0003_rename_user_room_host.py create mode 100644 base/migrations/0004_alter_room_options_room_participants.py create mode 100644 base/migrations/__init__.py create mode 100644 base/migrations/__pycache__/0001_initial.cpython-310.pyc create mode 100644 base/migrations/__pycache__/0002_topic_room_user_message_room_topic.cpython-310.pyc create mode 100644 base/migrations/__pycache__/0003_rename_user_room_host.cpython-310.pyc create mode 100644 base/migrations/__pycache__/0004_alter_room_options_room_participants.cpython-310.pyc create mode 100644 base/migrations/__pycache__/__init__.cpython-310.pyc create mode 100644 base/models.py create mode 100644 base/templates/base/activity_component.html create mode 100644 base/templates/base/delete.html create mode 100644 base/templates/base/delete_old.html create mode 100644 base/templates/base/feed_component.html create mode 100644 base/templates/base/home.html create mode 100644 base/templates/base/home_old.html create mode 100644 base/templates/base/login_register._oldhtml create mode 100644 base/templates/base/login_register.html create mode 100644 base/templates/base/profile.html create mode 100644 base/templates/base/profile_old.html create mode 100644 base/templates/base/room.html create mode 100644 base/templates/base/room_form.html create mode 100644 base/templates/base/room_form_old.html create mode 100644 base/templates/base/room_old.html create mode 100644 base/templates/base/signup.html create mode 100644 base/templates/base/topics.html create mode 100644 base/templates/base/topics_component.html create mode 100644 base/templates/base/update-user.html create mode 100644 base/tests.py create mode 100644 base/urls.py create mode 100644 base/views.py create mode 100755 manage.py create mode 100644 requirements.txt create mode 100644 static/images/avatar.svg create mode 100644 static/images/favicon.ico create mode 100644 static/images/icons/add.svg create mode 100644 static/images/icons/arrow-left.svg create mode 100644 static/images/icons/chevron-down.svg create mode 100644 static/images/icons/delete.svg create mode 100644 static/images/icons/edit.svg create mode 100644 static/images/icons/ellipsis-horizontal.svg create mode 100644 static/images/icons/ellipsis-vertical.svg create mode 100644 static/images/icons/lock.svg create mode 100644 static/images/icons/remove.svg create mode 100644 static/images/icons/search.svg create mode 100644 static/images/icons/sign-out.svg create mode 100644 static/images/icons/tools.svg create mode 100644 static/images/icons/user-group.svg create mode 100644 static/images/icons/user.svg create mode 100644 static/images/logo.svg create mode 100644 static/scripts/script.js create mode 100644 static/styles/main.css create mode 100644 static/styles/style.css create mode 100644 studybud/__init__.py create mode 100644 studybud/__pycache__/__init__.cpython-310.pyc create mode 100644 studybud/__pycache__/settings.cpython-310.pyc create mode 100644 studybud/__pycache__/urls.cpython-310.pyc create mode 100644 studybud/asgi.py create mode 100644 studybud/settings.py create mode 100644 studybud/urls.py create mode 100644 studybud/wsgi.py create mode 100644 templates/main.html create mode 100644 templates/navbar.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba520cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +db.sqlite3 \ No newline at end of file diff --git a/base/__init__.py b/base/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/base/__pycache__/__init__.cpython-310.pyc b/base/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..876bdd3b3772e6fd02df057c5ef1b0cf02510e20 GIT binary patch literal 148 zcmd1j<>g`k0=wCllR)%i5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!Hyenx(7s(xx& zYF?YH@Z+et~{UR$^XyzJ75@X-Z{MX^MVQVsWZ|e0*kJW=VX!UP0w84x8Nk Rl+v73JCK3JOhAH#0RZ?5A~&84YV#rn=?4uw%LBefGU8Zw4JY?g5hvJg3S30=HUR`>juQ+!bM z+N7ALl|fzFbWyD5U2CojU7`zff-aMRi=?borKNPSl!WX`?~kN>>QuR}oS-G@N+!+e`4a;op=M!3s6z!)JHVF3N;#K5r!H}eR91Kco`UCL^UBm$ zVB*dZq7t0sFL&SNzWcFxK455*-N*b5zn>KBo5Wy@&mAKG18!KuE6y1Rh>U2WD&p*d zfrR*#L9F>pR7ps#Skc>I1uMAkPc3M3Zrf(ZJ4Rkw+gww6-y#gg_}meKW)%lk36$m_ zP+Gi*DuM`wrBA7z1pjDIgP<|o)6g^$uVN5b9X;ni)uX9i*S@DzZH!X0BJrtG%ev7@ z`GHc6g^eLUQ|fV3n=aGRMSP4&ZG5u0(+1o-Ycpg6e4UiHw$Y`2(o4`aloRb9)^=6G zeZ9P~rCV=cJKsP#ubnOzxP%+6wqDXKF^aeZA!U-Mygfj7R>-zT;weF&fau?botG0w w^)#L%NZBC|%&ds3tm{4s{aS%(pM(`$*eCq=pQKMuyEB~8Wy5S4%lJ@y19t3o2LJ#7 literal 0 HcmV?d00001 diff --git a/base/__pycache__/models.cpython-310.pyc b/base/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89721c4ea15225e60641bcf6f11473e676b54cd0 GIT binary patch literal 1883 zcma)7&u<$=6yDk2w%2yzHUY{HRY(-Ap!SIyLaCAzAsQbV=dzd8+B0?5S?`+JHN+9O z_8R^MIQHM*#2>(EuAF-2#s$7NYqy4^5-ZK~H*em|ym{X@dVFnERijF2gN^z`f)zs|hiA_H(WC~4@d6mmjw+n#}Mq~>vo2Q&nu}CMce#4xXOf~1pWt@q8 zTAeFbifSqI3B%ClBTVfO?N1lxM`LE3V&)K&?L3(a`YlEF?4==hG5*&VgY#l82I6~> zbCK}Dkti>!Vlm*eB%c<8vRd-hc*zIjq!fetg#E=zd2w7;GLBockqP6ntF}(HzaANe zzVhRk_KaiIjAKk*W`u({{%)CM^@t=QRpanHk&jc6aoM51g~jC^Af4ov>5-2P=A)H0 z2w2b5z8fWX5OhF+Kf!F5TsSDas|#;M9+4pYEl&fu$t`Y!mKJb;NXDIOGisyP5fBgh z-nA8V(cb~~5xKj@4d5PRa|dL$cmOi*LQHMmftWha&1jEzLG6yRpBBY@6q>40iMbU#MV_$SR$rizKf~Obn#Rl1gx0W%(f@L9d@It0K;e zAAo}mjuXx$-Ke+9MG}=VAk!w(B|{RajV?Sf@*cVF!dwNE|Ay`xwI@*=pp_K6sXZ!X zPR+>T7Ajz0HS`K6qDrp(hsy=0vj9z`AT$hZxrfPepUgWj$}c1rGR>!3nduxUJ!R8M zRIidm~>&kRqMt--?war6~XOcoYxMo;*?Zc>x8Iydnp;A)Ux~ zfop9xM&h#4T8)}KEx|^W7P;!4B>8GokgbLM5iQw1!bwKyTxg&2)`wKy`ixSSQ!AZP zz3o`?9tMbwl5+5k9_z7yb(qau=KdX+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P* ztvfy@%`=_j7KUYoyLo?M^&@(vGrvyaWtn4)myT3He2nIzDXSP(sz}S&G%c*>EyQzW zFuwU`;)8>Or*bEHzgpMsXYA8456J|~7qorB?~6S?;d`{jZ~ss5x63=D;SIM0`!Mf{ c?CR<+Z?tW_$Ml{Jo^Sj1f;$SwH4zWIe?WKQfB*mh literal 0 HcmV?d00001 diff --git a/base/migrations/__pycache__/0002_topic_room_user_message_room_topic.cpython-310.pyc b/base/migrations/__pycache__/0002_topic_room_user_message_room_topic.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..685625db856723ab4f09f2f1b22a46589c334382 GIT binary patch literal 1317 zcmZuxOK%%D5MFZMtCj3Hj^d=hKtLh6MSBSfBdTS$MQsO&<;z}(m4;sLW*^FOl|;U_ zSN(+|Irg9QUi89i4@v$)fCe3M{X$VLNX&yX^YI&Ut8OKP&)IK|Vf?L>yTd}| zDNgYO7chY2MnNJ%luUD4n2}jnk)?Grw#ouUGsi<7z9cX#wqd5Tkn#4xxK5ilak&9@e}Gv^%vlF-P- zS{_g^xt|4C9}$29?%F!1;GwMpJ_KuWP7?~9HAZJ4gwRD#7cAb(HZnik%{sQ zNpmrv^#&THbDr`XgtY3aDx|fmU%Ays$|$%-f&5q3eAD;v`*Yc+d5jh$6Saw z!D_P#R?=NAKtWV@Mnf*E*V4VhjmGvIXk;Z>b7($oCmGm+lu!IYhx9UV!3%HK3?Sa*UvP1Az6s=Gfv-5*a5WKb>m)${t@ zsJ}rFdifNOE~e5uOBGduFLxSQSk9E0i<>|CcmZ>hx#HF?+q+md5j>sSzabQ%=r+g$(&O_H2B!q8* zG7V@@+a24y{_ocftQ;o>?Qy@~KT%7)NGGb)I#-p!Qsrn&GQ~RMK`R|;S;6zTg4hv_H%}Q8 zGe!idZ1zN`?V}1WT4v2rm({8e(oB zbr|vJ$1_t&y5*rAmITOk;iL z+DK`T8mD+4-EV6UjRf=-S~}1D$CcWFs{7fJTIeQUEjO3=h3LD8>CDeXdag>D%D0YRK)Nr@MWgBzR-#&})HE%u=Pjg8^7QH< zq$vI)E?gVE>>CmL;JT2z^;!o=H^6P~p@~TBG3x*ELq=ow^%-S!hx)&xUmfyr9NMj( pe|Mp(vtE+nCIj847el<+*ISv~=?v;N+9c_pvVLSAe_ZMg`k0=wCllR)%i5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!HMenx(7s(xx& zYF?YH@Z+et~{UR$^XyzJ75@X-Z{MX^MVQVsWZ|Zf1H>Vo7FxUa@|Bd}dx| cNqoFsLFFwDo80`A(wtN~klDpdK!Sw<0J*a!LjV8( literal 0 HcmV?d00001 diff --git a/base/models.py b/base/models.py new file mode 100644 index 0000000..29bf52e --- /dev/null +++ b/base/models.py @@ -0,0 +1,43 @@ +from pickle import TRUE +from pyexpat import model +from django.db import models +from django.contrib.auth.models import User +# Create your models here. + + +class Topic(models.Model): + name = models.CharField(max_length=200) + + def __str__(self) -> str: + return self.name + + +class Room(models.Model): + host = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) + topic = models.ForeignKey(Topic, on_delete=models.SET_NULL, null=True) + name = models.CharField(max_length=200) + disciption = models.TextField(null=True, blank=True) + participants = models.ManyToManyField( + User, related_name='participants', blank=True) + updated = models.DateTimeField(auto_now=True) + created = models.DateTimeField(auto_now_add=True) + + def __str__(self) -> str: + return self.name + + class Meta: + ordering = ["-updated", "-created"] + + +class Message(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + room = models.ForeignKey(Room, on_delete=models.CASCADE) + body = models.TextField() + updated = models.DateTimeField(auto_now=True) + created = models.DateTimeField(auto_now_add=True) + + class Meta: + ordering = ["-updated", "-created"] + + def __str__(self) -> str: + return self.body[0:50] diff --git a/base/templates/base/activity_component.html b/base/templates/base/activity_component.html new file mode 100644 index 0000000..ee26138 --- /dev/null +++ b/base/templates/base/activity_component.html @@ -0,0 +1,56 @@ +
+
+

Recent Activities

+
+ {% for message in messages %} +
+
+ +
+ +
+

+ @{{message.user}} + {{message.created|timesince}} +

+
+ {% if request.user == message.user %} + + {% endif %} +
+
+

+ replied to post “{{message.room}}” +

+
+ {{message.body}} +
+
+
+ {% endfor %} +
+ + + + + + + + + diff --git a/base/templates/base/delete.html b/base/templates/base/delete.html new file mode 100644 index 0000000..c3c896f --- /dev/null +++ b/base/templates/base/delete.html @@ -0,0 +1,39 @@ +{% extends 'main.html' %} {% block content %} +
+
+
+
+ +
+
+
+ {% csrf_token %} +
+

Are you sure you want to delete "{{obj}}"?

+
+ +
+ +
+
+
+
+
+
+{% endblock content %} diff --git a/base/templates/base/delete_old.html b/base/templates/base/delete_old.html new file mode 100644 index 0000000..6c44b5a --- /dev/null +++ b/base/templates/base/delete_old.html @@ -0,0 +1,10 @@ +{% extends 'main.html' %} + +{% block content %} +
+{% csrf_token %} +

Are you sure you want to delete "{{obj}}?"

+Go Back + +
+{% endblock content %} diff --git a/base/templates/base/feed_component.html b/base/templates/base/feed_component.html new file mode 100644 index 0000000..2abc55b --- /dev/null +++ b/base/templates/base/feed_component.html @@ -0,0 +1,65 @@ + +{% for room in rooms%} + +
+
+ +
+ +
+ @{{room.host.username}} +
+
+ {{room.created|timesince}} +
+
+
+ {{room.name}} +

+ {{room.discription}} +

+
+ +
+{% endfor%} + + + + + + + + + + +{% comment %} +
{% endcomment %} diff --git a/base/templates/base/home.html b/base/templates/base/home.html new file mode 100644 index 0000000..59d7c35 --- /dev/null +++ b/base/templates/base/home.html @@ -0,0 +1,65 @@ +{% extends 'main.html' %} {% block content %} + +
+
+ + {% include 'base/topics_component.html' %} + + + +
+
+ + +
+
+
+

Study Room

+

{{rooms_count}} Rooms available

+
+ + + add + + + Create Room + +
+ {% include 'base/feed_component.html' %} +
+ + + + {% include 'base/activity_component.html' %} + +
+
+{% endblock content %} diff --git a/base/templates/base/home_old.html b/base/templates/base/home_old.html new file mode 100644 index 0000000..85f726e --- /dev/null +++ b/base/templates/base/home_old.html @@ -0,0 +1,25 @@ +{% extends 'main.html'%} {% block content %} + + +
+
+ {% include 'base/topics_component.html' %} +
+ +
+ {% if request.user.is_authenticated %} + Create Room + {% endif %} +
{{rooms_count}} rooms avail
+ {% include 'base/feed_component.html' %} +
+
+ {% include 'base/activity_component.html' %} +
+
+{% endblock %} diff --git a/base/templates/base/login_register._oldhtml b/base/templates/base/login_register._oldhtml new file mode 100644 index 0000000..eed0540 --- /dev/null +++ b/base/templates/base/login_register._oldhtml @@ -0,0 +1,50 @@ +{% extends 'main.html' %} {% block content %} {% if page == 'login' %} +
+ {% if messages%} {% for message in messages %} + + {% endfor %} {% endif %} + +
+ {% csrf_token %} +
+ + +
+
+ + +
+ +
+ Register +
+{% endif %} {% if page == 'register' %} +
+ {% if messages%} {% for message in messages %} + + {% endfor %} {% endif %} + +
+ {% csrf_token %} + {{form.as_p}} + +
+ Login +
+{% endif %} {% endblock %} diff --git a/base/templates/base/login_register.html b/base/templates/base/login_register.html new file mode 100644 index 0000000..5b8746a --- /dev/null +++ b/base/templates/base/login_register.html @@ -0,0 +1,63 @@ +{% extends 'main.html' %} +{% block content %} +{% if page == 'login' %} +
+
+
+
+
+

Login

+
+
+
+

Find your study partner

+ +
+ {% csrf_token %} +
+ + +
+
+ + +
+ + +
+ +
+

Haven't signed up yet?

+ Sign Up +
+
+
+
+
+ {% endif %} + {% if page == 'register' %} + {% include 'base/signup.html' %} + {% endif %} +{% endblock content %} \ No newline at end of file diff --git a/base/templates/base/profile.html b/base/templates/base/profile.html new file mode 100644 index 0000000..5294adf --- /dev/null +++ b/base/templates/base/profile.html @@ -0,0 +1,48 @@ +{% extends 'main.html' %} {% block content %} +
+
+ + {% include 'base/topics_component.html' %} + + + +
+
+
+
+ +
+
+
+

{{user}}

+

@{{user.username}}

+ {% if request.user == user%} + Edit Profile + {%endif%} +
+
+

About

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur illo tenetur + facilis sunt nemo debitis quisquam hic atque aut? Ducimus alias placeat optio + accusamus repudiandae quis ab ex exercitationem rem? +

+
+
+ +
+
+

Study Rooms Hosted by dennis_ivy +

+
+
+ {% include 'base/feed_component.html' %} +
+ + + + {% include 'base/activity_component.html' %} + +
+
+ {% endblock content %} \ No newline at end of file diff --git a/base/templates/base/profile_old.html b/base/templates/base/profile_old.html new file mode 100644 index 0000000..4ecb868 --- /dev/null +++ b/base/templates/base/profile_old.html @@ -0,0 +1,30 @@ +{% extends 'main.html' %} + +{% block content %} + + +
+ +
+

{{ user.username }}

+ {% include 'base/topics_component.html' %} +
+ +
+ {% include 'base/feed_component.html' %} +
+ +
+ {% include 'base/activity_component.html' %} +
+
+{% endblock content %} + + diff --git a/base/templates/base/room.html b/base/templates/base/room.html new file mode 100644 index 0000000..8655c65 --- /dev/null +++ b/base/templates/base/room.html @@ -0,0 +1,184 @@ +{% extends 'main.html' %} {% block content %} +
+
+ +
+
+
+ + + arrow-left + + + +

Study Room

+
+ {% if request.user == room.host%} + + {% endif %} + +
+
+
+
+

{{room.name}}

+ {{room.created|timesince}} +
+ +
+ {{room.disciption}} +
+ {{room.topic}} +
+
+ +
+ {% for message in messages %} +
+
+
+ +
+ +
+ @{{message.user}} +
+ {{message.created|timesince}} +
+ {% if request.user == message.user %} + +
+ + + remove + + +
+
+ {% endif %} +
+
+ {{message.body}} +
+
+ {% endfor %} +
+
+
+ {% if request.user.is_authenticated %} +
+
+ {% csrf_token %} + +
+
+ {% endif %} +
+ + + +
+

+ Participants ({{participants.count}} Joined) +

+
+ {% for user in participants %} + +
+ +
+

+ {{user}} + @{{user}} +

+
+ {% endfor %} +
+
+ +
+
+{% endblock %} diff --git a/base/templates/base/room_form.html b/base/templates/base/room_form.html new file mode 100644 index 0000000..8a6ef52 --- /dev/null +++ b/base/templates/base/room_form.html @@ -0,0 +1,86 @@ +{% extends 'main.html' %} {% block content %} +
+
+
+
+
+ + + arrow-left + + + +

Create Study Room

+
+
+
+
+ {% csrf_token %} + +
+ + + + + +
+ +
+ + {{form.name}} +
+
+ + {{form.disciption}} +
+ + {% comment %} +
+ + + + + +
+ {% endcomment %} {% comment %} +
+ + +
+ {% endcomment %} +
+ Cancel + +
+
+
+
+
+
+{% endblock content %} diff --git a/base/templates/base/room_form_old.html b/base/templates/base/room_form_old.html new file mode 100644 index 0000000..541f141 --- /dev/null +++ b/base/templates/base/room_form_old.html @@ -0,0 +1,8 @@ +{% extends 'main.html'%} {% block content %} +
+
+ {% csrf_token %} {{form.as_p}} + +
+
+{% endblock %} diff --git a/base/templates/base/room_old.html b/base/templates/base/room_old.html new file mode 100644 index 0000000..480d2df --- /dev/null +++ b/base/templates/base/room_old.html @@ -0,0 +1,45 @@ +{% extends 'main.html' %} {% block content %} +
+ +
+

{{room.name}}

+

{{room.disciption}}

+
+

Conversation

+
+ {% for message in messages %} +
+ {% if request.user == message.user %} + Delete + {% endif %} + @{{message.user}} {{message.created | timesince}} +

{{message.body}}

+
+
+ {% endfor %} {% if request.user.is_authenticated %} +
+
+ {% csrf_token %} + +
+
+ {% endif %} +
+
+
+

Participants

+ {% for user in participants %} +
@{{user}}
+ {% endfor %} +
+
+{% endblock content %} diff --git a/base/templates/base/signup.html b/base/templates/base/signup.html new file mode 100644 index 0000000..f586a6d --- /dev/null +++ b/base/templates/base/signup.html @@ -0,0 +1,79 @@ + +
+
+
+
+
+

Sign up

+
+
+
+

Find your study partner

+ +
+ {% csrf_token %} + + + {% for field in form %} +
+ + {% comment %} {% endcomment %} + {{field}} +
+ {% endfor %} + {% comment %}
+ + +
+
+ + +
+
+ + +
+ +
+ + +
{% endcomment %} + + +
+
+

Already have an account?

+ Log In +
+
+
+
+
diff --git a/base/templates/base/topics.html b/base/templates/base/topics.html new file mode 100644 index 0000000..d901ca3 --- /dev/null +++ b/base/templates/base/topics.html @@ -0,0 +1,53 @@ +{% extends 'main.html' %} +{% block content %} +
+
+
+
+
+ + + arrow-left + + + +

Browse Topics

+
+
+ +
+ + + +
+
+
+
+ + + + +{% endblock content %} \ No newline at end of file diff --git a/base/templates/base/topics_component.html b/base/templates/base/topics_component.html new file mode 100644 index 0000000..7cfaaa8 --- /dev/null +++ b/base/templates/base/topics_component.html @@ -0,0 +1,33 @@ +
+
+

Browse Topics

+
+ + + More + + chevron-down + + + +
+ diff --git a/base/templates/base/update-user.html b/base/templates/base/update-user.html new file mode 100644 index 0000000..f917554 --- /dev/null +++ b/base/templates/base/update-user.html @@ -0,0 +1,44 @@ +{% extends 'main.html' %} +{% block content %} +
+
+
+
+
+ + + arrow-left + + + + +

Edit your profile

+
+
+
+
+ {% csrf_token %} +
+ + +
+ + {% for field in form %} +
+ + {{field}} +
+ {% endfor %} +
+ Cancel + +
+
+
+
+
+ +
+{% endblock content %} \ No newline at end of file diff --git a/base/tests.py b/base/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/base/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/base/urls.py b/base/urls.py new file mode 100644 index 0000000..ea98391 --- /dev/null +++ b/base/urls.py @@ -0,0 +1,19 @@ +from django.urls import path +from . import views + + +urlpatterns = [ + path("login/", views.loginPage, name="login"), + path("register/", views.registerPage, name="register"), + path("logout/", views.logoutUser, name="logout"), + path("", views.home, name="home"), + path("room//", views.room, name="room"), + path("create_room/", views.createRoom, name="createroom"), + path("update_room//", views.updateRoom, name="updateroom"), + path("datele_room//", views.deleteRoom, name="deleteroom"), + path("datele_message//", views.deleteMessage, name="deletemessage"), + path("profile//", views.userProfile, name="userprofile"), + path("updateprofile/", views.updateProfile, name="updateprofile"), + path("topics/", views.topicsPage, name="topics"), + +] diff --git a/base/views.py b/base/views.py new file mode 100644 index 0000000..24d5b0a --- /dev/null +++ b/base/views.py @@ -0,0 +1,201 @@ +from cmath import log +from email import message +from multiprocessing import context +from pydoc_data.topics import topics +import django +from django.http import HttpResponse +from django.shortcuts import render, redirect +from django.contrib.auth.models import User +from django.contrib.auth import authenticate, login, logout +from django.contrib import messages +from django.contrib.auth.decorators import login_required +from .models import Message, Room, Topic +from .forms import RoomForm, UserForm +from django.db.models import Q +from django.contrib.auth.forms import UserCreationForm +# rooms = [ +# {'id': 1, 'name': "Let's Learn python"}, +# {'id': 2, 'name': 'Design with me'}, +# {'id': 3, 'name': "Frontend developers"}, +# ] +# Create your views here. + + +def loginPage(request): + print("inside login.....") + page = 'login' + if request.user.is_authenticated: + return redirect('home') + + if request.method == 'POST': + username = request.POST.get('username').lower() + password = request.POST.get('password') + try: + user = User.objects.get(username=username) + except: + print('Username or password is invalid') + messages.error(request, "Username or password is invalid") + user = authenticate(request, username=username, password=password) + if user is not None: + login(request, user) + return redirect('home') + else: + print('invalid creds') + messages.error(request, "Invalid Credentials") + + context = {"page": page} + return render(request, 'base/login_register.html', context) + + +def logoutUser(request): + logout(request) + return redirect('home') + + +def registerPage(request): + page = 'register' + if request.user.is_authenticated: + return redirect('home') + if request.method == 'POST': + try: + form = UserCreationForm(request.POST) + print("form is created ......") + if form.is_valid(): + print("valid form") + user = form.save(commit=False) + user.username = user.username.lower() + user.save() + login(request, user) + return redirect('home') + else: + messages.error(request, "Error Occured While Registration") + except: + messages.error(request, "Error Occured") + form = UserCreationForm() + context = {'page': page, 'form': form} + return render(request, 'base/login_register.html', context) + + +def home(request): + q = request.GET.get('q') if request.GET.get('q') != None else '' + rooms = Room.objects.filter(Q(topic__name__icontains=q) | + Q(name__icontains=q) | + Q(disciption__icontains=q) | + Q(host__username__icontains=q) + ) + topics = Topic.objects.all()[:5] + room_messages = Message.objects.all().filter(Q(room__topic__name__icontains=q)) + room_count = rooms.count() + context = {'rooms': rooms, 'topics': topics, + 'rooms_count': room_count, 'messages': room_messages} + return render(request, 'base/home.html', context) + + +def room(request, pk): + room = Room.objects.get(id=pk) + room_messages = room.message_set.all().order_by('-created') + participants = room.participants.all() + if request.method == 'POST': + message = Message.objects.create( + user=request.user, + room=room, + body=request.POST.get('body') + ) + room.participants.add(request.user) + return redirect('room', pk=room.id) + context = {'room': room, 'messages': room_messages, + 'participants': participants} + return render(request, 'base/room.html', context) + + +@login_required(login_url='login') +def createRoom(request): + form = RoomForm + topics = Topic.objects.all() + context = {'form': form, 'topics': topics} + if request.method == 'POST': + topic_name = request.POST.get('topic') + topic, created = Topic.objects.get_or_create(name=topic_name) + Room.objects.create( + host=request.user, + topic=topic, + name=request.POST.get('name'), + disciption=request.POST.get('disciption') + ) + return redirect('home') + return render(request, 'base/room_form.html', context) + + +@login_required(login_url='login') +def updateRoom(request, pk): + topics = Topic.objects.all() + room = Room.objects.get(id=pk) + if request.user != room.host: + return HttpResponse("You are not allowed to delete this.....") + form = RoomForm(instance=room) + context = {'form': form, 'topics': topics, 'room': room} + if request.method == 'POST': + topic_name = request.POST.get('topic') + topic, created = Topic.objects.get_or_create(name=topic_name) + room.name = request.POST.get('name') + room.topic = topic + room.disciption = request.POST.get('disciption') + print(request.POST.get('name')) + room.save() + return redirect('home') + return render(request, 'base/room_form.html', context) + + +@login_required(login_url='login') +def deleteRoom(request, pk): + room = Room.objects.get(id=pk) + if request.user != room.host: + return HttpResponse("You are not allowed to delete this.....") + if request.method == 'POST': + room.delete() + return redirect('home') + return render(request, 'base/delete.html', {"obj": room}) + + +@login_required(login_url='login') +def deleteMessage(request, pk): + message = Message.objects.get(id=pk) + if request.user != message.user: + return HttpResponse("You are not allowed to delete this.....") + if request.method == 'POST': + message.delete() + return redirect('home') + return render(request, 'base/delete.html', {"obj": message}) +# @login_required(login_url='login') + + +def userProfile(request, pk): + user = User.objects.get(id=pk) + rooms = user.room_set.all() + room_messages = user.message_set.all() + topics = Topic.objects.all() + context = {'user': user, 'rooms': rooms, + 'messages': room_messages, "topics": topics} + return render(request, 'base/profile.html', context) + + +@login_required(login_url='login') +def updateProfile(request): + user = request.user + form = UserForm(instance=user) + if request.method == "POST": + form = UserForm(request.POST, instance=user) + if form.is_valid(): + form.save() + return redirect('userprofile', pk=user.id) + context = {'form': form} + return render(request, 'base/update-user.html', context) + + +def topicsPage(request): + rooms_count = Room.objects.all().count + q = request.GET.get('q') if request.GET.get('q') != None else '' + + topics = Topic.objects.filter(name__icontains=q) + context = {'topics': topics, 'rooms_count': rooms_count} + return render(request, 'base/topics.html', context) diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..4683c69 --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studybud.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1c74ab3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +asgiref==3.5.2 +autopep8==1.6.0 +Django==4.0.6 +pycodestyle==2.8.0 +sqlparse==0.4.2 +toml==0.10.2 diff --git a/static/images/avatar.svg b/static/images/avatar.svg new file mode 100644 index 0000000..097458a --- /dev/null +++ b/static/images/avatar.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/favicon.ico b/static/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..1707a6d0fb8f1c89e7cadbdc2550e112ec2f3021 GIT binary patch literal 15406 zcmeHO3y>T|8QwFX$Xf+PF&%9~MW+=O zM8C|;Ct2sqI$`oRaNJyG25CqOo^7D>`fQ22h{p$g_^spzeAYcEc-Z2u3O;E2tm*H= z?`=M8!0k+boVZ0R>)`!||2l-R4R`}S?l#hTaO1S1B_8wOVj*D#E4#F48J&DtC#-0S zg%St2Zl`e?VcOGF%%v~D7#yL&LRGdA2f(IKgZ86fiUk;-;<}D$2P-h^1;E&*V6{rv z>QU;rp{r%0!eN~-wkcSxQqe<)*I^U+%6dY2&@A_Cl)dN0o@qz*HicKO%-h*3q)h7FJ@fK<_|f)_oL81``LZ5uAFto^ zGZXPPe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kbJ??!@)#}Nn^u2(=S)AFr(X%sN#+9toYska?m5sruyucyu0)78WjHCC^xkmZ-?w@x3oMbLGS*cZ(bkKkAnVNn!m=XoBZe8%{Q0q65SI*ptQ$3yp8 zJo>wg^TP8=&9BND#aUKNu0_AU;qa@xZyQqfj+Pj!SBSH}^{gddej^cD*J1l(zHBXw zaKBWG@4kYs#dlutqmM@IUioc_bIXAu4ecCPY2@JR)?E7Lq0p8J}n&zyE5 gzI$5?|BC +add + + diff --git a/static/images/icons/arrow-left.svg b/static/images/icons/arrow-left.svg new file mode 100644 index 0000000..10d2a55 --- /dev/null +++ b/static/images/icons/arrow-left.svg @@ -0,0 +1,4 @@ + +arrow-left + + diff --git a/static/images/icons/chevron-down.svg b/static/images/icons/chevron-down.svg new file mode 100644 index 0000000..a12779a --- /dev/null +++ b/static/images/icons/chevron-down.svg @@ -0,0 +1,4 @@ + +chevron-down + + diff --git a/static/images/icons/delete.svg b/static/images/icons/delete.svg new file mode 100644 index 0000000..32eac05 --- /dev/null +++ b/static/images/icons/delete.svg @@ -0,0 +1,4 @@ + +delete + + diff --git a/static/images/icons/edit.svg b/static/images/icons/edit.svg new file mode 100644 index 0000000..a0c2531 --- /dev/null +++ b/static/images/icons/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/images/icons/ellipsis-horizontal.svg b/static/images/icons/ellipsis-horizontal.svg new file mode 100644 index 0000000..a26f016 --- /dev/null +++ b/static/images/icons/ellipsis-horizontal.svg @@ -0,0 +1,6 @@ + +ellipsis-horizontal + + + + diff --git a/static/images/icons/ellipsis-vertical.svg b/static/images/icons/ellipsis-vertical.svg new file mode 100644 index 0000000..b91ce93 --- /dev/null +++ b/static/images/icons/ellipsis-vertical.svg @@ -0,0 +1,6 @@ + +ellipsis-vertical + + + + diff --git a/static/images/icons/lock.svg b/static/images/icons/lock.svg new file mode 100644 index 0000000..3119aa3 --- /dev/null +++ b/static/images/icons/lock.svg @@ -0,0 +1,5 @@ + +lock + + + diff --git a/static/images/icons/remove.svg b/static/images/icons/remove.svg new file mode 100644 index 0000000..7be188e --- /dev/null +++ b/static/images/icons/remove.svg @@ -0,0 +1,4 @@ + +remove + + diff --git a/static/images/icons/search.svg b/static/images/icons/search.svg new file mode 100644 index 0000000..a47f611 --- /dev/null +++ b/static/images/icons/search.svg @@ -0,0 +1,4 @@ + +search + + diff --git a/static/images/icons/sign-out.svg b/static/images/icons/sign-out.svg new file mode 100644 index 0000000..7dadd40 --- /dev/null +++ b/static/images/icons/sign-out.svg @@ -0,0 +1,5 @@ + +sign-out + + + diff --git a/static/images/icons/tools.svg b/static/images/icons/tools.svg new file mode 100644 index 0000000..f81e3e4 --- /dev/null +++ b/static/images/icons/tools.svg @@ -0,0 +1,4 @@ + +tools + + diff --git a/static/images/icons/user-group.svg b/static/images/icons/user-group.svg new file mode 100644 index 0000000..dde9985 --- /dev/null +++ b/static/images/icons/user-group.svg @@ -0,0 +1,7 @@ + +user-group + + + + + diff --git a/static/images/icons/user.svg b/static/images/icons/user.svg new file mode 100644 index 0000000..a6bdfd7 --- /dev/null +++ b/static/images/icons/user.svg @@ -0,0 +1,5 @@ + +user + + + diff --git a/static/images/logo.svg b/static/images/logo.svg new file mode 100644 index 0000000..3762ca0 --- /dev/null +++ b/static/images/logo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/static/scripts/script.js b/static/scripts/script.js new file mode 100644 index 0000000..c523d8c --- /dev/null +++ b/static/scripts/script.js @@ -0,0 +1,69 @@ +// // Actions: + +// const closeButton = ` +// remove +// +// +// `; +// const menuButton = ` +// ellipsis-horizontal +// +// +// +// +// `; + +// const actionButtons = document.querySelectorAll('.action-button'); + +// if (actionButtons) { +// actionButtons.forEach(button => { +// button.addEventListener('click', () => { +// const buttonId = button.dataset.id; +// let popup = document.querySelector(`.popup-${buttonId}`); +// console.log(popup); +// if (popup) { +// button.innerHTML = menuButton; +// return popup.remove(); +// } + +// const deleteUrl = button.dataset.deleteUrl; +// const editUrl = button.dataset.editUrl; +// button.innerHTML = closeButton; + +// popup = document.createElement('div'); +// popup.classList.add('popup'); +// popup.classList.add(`popup-${buttonId}`); +// popup.innerHTML = `Edit +//
+// +//
`; +// button.insertAdjacentElement('afterend', popup); +// }); +// }); +// } + +// Menu + +const dropdownMenu = document.querySelector(".dropdown-menu"); +const dropdownButton = document.querySelector(".dropdown-button"); + +if (dropdownButton) { + dropdownButton.addEventListener("click", () => { + dropdownMenu.classList.toggle("show"); + }); +} + +// Upload Image +const photoInput = document.querySelector("#avatar"); +const photoPreview = document.querySelector("#preview-avatar"); +if (photoInput) + photoInput.onchange = () => { + const [file] = photoInput.files; + if (file) { + photoPreview.src = URL.createObjectURL(file); + } + }; + +// Scroll to Bottom +const conversationThread = document.querySelector(".room__box"); +if (conversationThread) conversationThread.scrollTop = conversationThread.scrollHeight; diff --git a/static/styles/main.css b/static/styles/main.css new file mode 100644 index 0000000..6abcfcd --- /dev/null +++ b/static/styles/main.css @@ -0,0 +1,4 @@ + +body{ + background-color: rgb(241, 237, 214); +} \ No newline at end of file diff --git a/static/styles/style.css b/static/styles/style.css new file mode 100644 index 0000000..dc00d0f --- /dev/null +++ b/static/styles/style.css @@ -0,0 +1,1165 @@ +@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap"); + +:root { + --color-main: #71c6dd; + --color-main-light: #e1f6fb; + --color-dark: #3f4156; + --color-dark-medium: #51546e; + --color-dark-light: #696d97; + --color-light: #e5e5e5; + --color-gray: #8b8b8b; + --color-light-gray: #b2bdbd; + --color-bg: #2d2d39; + --color-success: #5dd693; + --color-error: #fc4b0b; +} + +/*========== base styles ==========*/ + +* { + font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", + "Helvetica Neue", sans-serif; + margin: 0; + padding: 0; + box-sizing: border-box; + text-rendering: optimizeLegibility; + /* color: inherit; */ + font-size: inherit; +} + +html { + font-size: 56.25%; +} + +@media only screen and (min-width: 1200px) { + html { + font-size: 62.5%; + } +} + +@media only screen and (min-width: 2100px) { + html { + font-size: 75%; + } +} + +body { + line-height: 1.6; + font-weight: 400; + font-size: 1.5rem; + color: var(--color-light-gray); + background-color: var(--color-bg); + min-height: 100vh; +} + +img { + width: 100%; +} + +a { + display: inline-block; + color: var(--color-main); + text-decoration: none; +} + +/*========== components ==========*/ +.container { + max-width: 120rem; + width: 90%; + margin: auto; +} + +.btn { + background-color: transparent; + border: none; + display: inline-flex; + align-items: center; + gap: 1rem; + cursor: pointer; + transition: all ease-in-out 0.3s; + padding: 1rem 2rem; + border-radius: 5px; + box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15); + font-weight: 500; +} + +.btn--link { + border-radius: 0; + padding: 0; + color: var(--color-main); + box-shadow: none; +} + +.btn--link:hover { + text-decoration: underline; +} + +.btn--main { + background-color: var(--color-main); + color: var(--color-dark); +} + +.btn:hover { + opacity: 0.9; +} + +.btn--dark { + background-color: var(--color-dark-light); + color: var(--color-light); +} + +.btn > svg { + fill: currentColor; + width: 1.6rem; + height: 1.6rem; +} + +.btn--pill { + border-radius: 10rem; + font-size: 1.4rem; + font-weight: 700; + padding: 6px 2.5rem; + color: var(--color-main); + background: transparent; + border: 2px solid var(--color-main); +} + +.action-button { + background: transparent; + border: none; + outline: none; + cursor: pointer; +} + +.avatar { + position: relative; + display: inline-block; + border-radius: 50%; + border: 2px solid var(--color-main); +} + +.avatar img { + display: block; + border-radius: 50%; + object-fit: cover; + object-position: center; +} + +.avatar::after { + content: ""; + display: block; + position: absolute; + background-color: var(--color-gray); + z-index: 111; + border-radius: 50%; + border: 0.3rem solid var(--color-dark); +} + +.avatar.active::after { + background-color: var(--color-success); +} + +.avatar.avatar--small img { + width: 2.8rem; + height: 2.8rem; +} + +.avatar.avatar--small:after { + width: 0.7rem; + height: 0.7rem; + bottom: 0px; + right: -6px; +} + +.avatar.avatar--medium img { + width: 3.6rem; + height: 3.6rem; + border-radius: 50%; +} + +.avatar.avatar--medium:after { + width: 0.7rem; + height: 0.7rem; + bottom: 0px; + right: -6px; +} + +.avatar.avatar--large img { + display: block; + width: 8rem; + height: 8rem; + border-radius: 50%; +} + +.avatar.avatar--large:after { + width: 1rem; + height: 1rem; + bottom: 2px; + right: 3.5px; +} + +.scroll::-webkit-scrollbar { + width: 0.6rem; + background-color: rgb(41, 41, 46); +} + +.scroll::-webkit-scrollbar-thumb { + border-radius: 1rem; + background-color: var(--color-gray); +} + +.dropdown-menu { + z-index: 111; + position: absolute; + top: 5rem; + right: 0.5rem; + background: var(--color-dark-light); + border-radius: 5px; + box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15); + overflow: hidden; + display: none; +} + +.dropdown-menu.show { + display: block; +} + +.dropdown-menu a { + padding: 1.2rem 4rem; + display: block; + color: var(--color-light) !important; + font-weight: 500; + font-size: 1.4rem; +} + +.dropdown-menu a:hover { + background-color: var(--color-dark-medium); +} + +.dropdown-menu > a:not(:last-child) { + border-bottom: 1px solid var(--color-dark-medium); +} + +.dropdown-menu a svg { + fill: var(--color-light); +} + +.mobile-menu { + margin-bottom: 3rem; +} + +.mobile-menuItems { + display: flex; + align-items: center; + justify-content: center; + gap: 1rem; +} + +@media screen and (min-width: 500px) { + .mobile-menu { + display: none; + } +} + +/*============================== +=> Header Section +================================*/ + +.header { + padding: 1.5rem; + background-color: var(--color-dark); +} + +.header > .container { + display: flex; + gap: 9.5rem; +} + +.header__logo, +.header__user { + display: flex; + gap: 2rem; + align-items: center; +} + +.header__logo > img { + height: 3.2rem; + width: 3.2rem; +} + +.header__logo > h1 { + font-weight: 700; + font-size: 2rem; + color: var(--color-light); +} + +.header__search > label { + background-color: var(--color-dark-medium); + padding: 1.3rem 1rem; + display: flex; + align-items: center; + gap: 1rem; + border-radius: 4px; +} + +.header__search svg { + fill: var(--color-gray); + width: 2rem; + height: 2rem; + margin-left: 1rem; +} + +.header__search input { + width: 30rem; + background: transparent; + border: none; + outline: none; + color: var(--color-light); +} + +@media screen and (max-width: 800px) { + .header__search input { + width: 20rem; + } + + .header > .container { + gap: 3rem; + } +} + +@media screen and (max-width: 700px) { + .header__logo h1 { + display: none; + } +} + +@media screen and (max-width: 500px) { + .header__search { + display: none; + } +} + +.header__menu { + margin-left: auto; + position: relative; +} + +.header__menu a { + display: flex; + gap: 1.5rem; + align-items: center; + font-weight: 500; + text-decoration: none; + color: var(--color-gray); +} + +.header__menu img { + height: 3.6rem; +} + +.header__menu p { + line-height: 1.2; +} + +.header__menu span { + color: var(--color-main); + font-weight: 500; + font-size: 1.4rem; + display: block; +} + +.header__menu svg { + width: 1.6rem; + height: 1.6rem; + fill: var(--color-dark-light); +} + +.dropdown-button { + background: transparent; + border: 0; + outline: 0; + cursor: pointer; +} + +.dropdown-button:hover svg { + fill: var(--color-main); +} + +/*============================== +=> Layout +================================*/ + +.layout { + margin-top: 2.4rem; +} + +.layout > .container { + display: flex; + justify-content: space-between; + align-items: flex-start; +} + +.layout--3 > .container > div:first-child { + flex-basis: 18%; + max-width: 22.5rem; +} + +.layout--3 > .container > div:nth-child(2) { + flex-basis: 50%; +} + +.layout--3 > .container > div:last-child { + flex-basis: 25%; +} + +.layout--2 > .container > div:first-child { + flex-basis: 72%; +} + +.layout--2 > .container > div:last-child { + flex-basis: 25%; +} +/*========== Layout Box ==========*/ + +.layout__box { + width: 90%; + max-width: 48rem; + min-height: 40rem; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -46%); + background-color: var(--color-dark); + border-radius: 1rem; + box-shadow: 1px 1px 6px 3px rgba(0, 0, 0, 0.1); + overflow: hidden; +} + +.layout__boxHeader { + display: flex; + padding: 1.5rem; + background-color: var(--color-dark-light); +} + +.layout__boxTitle { + display: flex; + gap: 1.5rem; + align-items: center; +} + +.layout__boxTitle h3 { + text-transform: uppercase; + font-weight: 500; + color: var(--color-light); +} + +.layout__boxTitle svg { + width: 1.6rem; + height: 1.6rem; + fill: var(--color-main); +} + +.layout__body { + margin: 3rem; +} + +@media screen and (max-width: 900px) { + .activities, + .topics { + display: none; + } + + .layout--3 > .container > div:nth-child(2) { + flex-basis: 100%; + } +} + +/*============================== +=> Topics +================================*/ + +.form__group { + margin-bottom: 2rem; + width: 100%; +} + +.form__split { + display: flex; + gap: 1.5rem; +} + +.form__group label { + display: block; + font-size: 1.5rem; + margin-bottom: 1rem; +} + +.form__group input, +.form__group textarea, +.form__group select { + background: transparent; + border: 1px solid var(--color-dark-light); + padding: 1rem; + border-radius: 3px; + width: 100%; + color: var(--color-light); + font-weight: 500; + outline: none; +} + +.form__group input:focus, +.form__group textarea:focus { + border-color: var(--color-main); +} + +.form__group textarea { + background: transparent; + height: 10rem; + resize: none; +} + +.form__group select { + color: var(--color-gray); + font-weight: 400; +} + +.form__group select option { + background-color: var(--color-dark-light); + color: var(--color-light); + padding: 0 10rem; +} + +.form__action { + display: flex; + justify-content: flex-end; + gap: 3rem; +} + +.form__hide { + position: absolute; + left: -9999px; +} + +.form__avatar label { + text-align: center; + font-size: 1.8rem; + font-weight: 500; + color: var(--color-main); + cursor: pointer; +} + +.form__avatar label:hover { + text-decoration: underline; +} + +/*============================== +=> Topics +================================*/ + +.topics__header { + margin-bottom: 2rem; +} + +.topics__header h2 { + text-transform: uppercase; + font-weight: 500; + color: var(--color-dark-light); +} + +.topics__list { + list-style: none; +} + +.topics__list li a { + display: flex; + justify-content: space-between; + margin-bottom: 3rem; + font-weight: 500; + color: var(--color-light-gray); + transition: all 0.3s ease-in-out; +} + +.topics__list li a.active, +.topics__list li a:hover { + color: var(--color-main); +} + +.topics__list li a span { + padding: 0.5rem 1rem; + background-color: var(--color-dark); + border-radius: 3px; + font-size: 1.3rem; + font-weight: 700; + letter-spacing: 1px; +} + +.topics-page a:hover { + text-decoration: underline; +} + +.topics-page .topics__list li:not(:last-child) a { + margin: 2rem 0; + padding-bottom: 1rem; + text-decoration: none; + border-bottom: 1px solid var(--color-dark-medium); +} + +.topics-page .header__search { + display: block; +} + +@media screen and (max-width: 500px) { + .mobile-menu .header__search { + display: block; + margin-bottom: 2.4rem; + } +} + +/*============================== +=> Room List +================================*/ + +.roomList__header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 2.4rem; +} + +.roomList__header h2 { + text-transform: uppercase; + font-weight: 500; + color: var(--color-light); + letter-spacing: 1px; +} + +.roomList__header p { + font-weight: 500; + color: var(--color-dark-light); +} + +/*========== Room List Room ==========*/ + +.roomListRoom { + margin-bottom: 2.4rem; + background-color: var(--color-dark); + border-radius: 1rem; + padding: 2rem; +} + +.roomListRoom__header { + display: flex; + justify-content: space-between; + align-items: center; +} + +.roomListRoom__author { + font-weight: 500; + display: flex; + align-items: center; + gap: 1rem; +} + +.roomListRoom__actions { + display: flex; + align-items: flex-start; + gap: 1rem; + position: relative; +} + +.roomListRoom__actions span { + font-size: 1.4rem; + font-weight: 500; +} + +.roomListRoom__actions svg { + fill: var(--color-main); + + width: 1.6rem; + height: 1.6rem; +} + +.roomListRoom__content { + margin: 1rem 0; +} + +.roomListRoom__content a { + font-size: 2rem; + font-weight: 500; + margin-bottom: 1.5rem; + color: var(--color-light); + transition: all 0.3s ease-in-out; +} + +.roomListRoom__content a:hover { + color: var(--color-main); +} + +.roomListRoom__meta { + border-top: 1px solid var(--color-dark-medium); + padding-top: 1rem; + display: flex; + align-items: center; + justify-content: space-between; +} + +.roomListRoom__joined { + color: var(--color-light-gray); + display: flex; + align-items: center; + gap: 1rem; + font-size: 1.4rem; + font-weight: 500; +} + +.roomListRoom__joined svg { + fill: var(--color-main); + width: 1.6rem; + height: 1.6rem; +} + +.roomListRoom__topic { + padding: 5px 1.5rem; + background-color: var(--color-dark-medium); + border-radius: 5rem; + font-weight: 500; + font-size: 1.3rem; +} + +/*============================== +=> Activities +================================*/ + +.activities { + background: var(--color-dark); + border-radius: 5px; + overflow: hidden; +} + +.activities__header h2 { + background-color: var(--color-dark-light); + text-transform: uppercase; + font-weight: 500; + padding: 1rem 1.5rem; + color: var(--color-light); + letter-spacing: 1px; + font-size: 1.4rem; +} + +.activities__box { + margin: 1.5rem; + padding: 1.5rem; + border: 2px solid var(--color-dark-medium); + border-radius: 5px; +} + +.activities__boxHeader p { + font-size: 1.4rem; + line-height: 1.3; +} + +.activities__boxHeader p span { + color: var(--color-gray); + font-size: 1.2rem; + display: block; +} + +.activities__boxContent { + margin-left: 4.2rem; +} + +.activities__boxContent { + font-size: 1.4rem; +} + +.activities__boxContent a:hover { + text-decoration: underline; +} + +.activities__boxRoomContent { + background: var(--color-bg); + padding: 1rem; + border-radius: 5px; + margin-top: 1rem; + margin-left: -4.2rem; +} + +.roomListRoom__actions svg { + fill: var(--color-light-gray); +} + +/*============================== +=> Create Room +================================*/ + +.create-room.layout .layout__box { + max-width: 68rem; +} + +/*============================== +=> Update Account +================================*/ + +.update-account.layout .layout__box { + max-width: 68rem; +} + +/*============================== +=> Delete Item +================================*/ + +.delete-item.layout .layout__box { + max-width: 68rem; +} + +/*============================== +=> Auth +================================*/ + +.auth__tagline { + text-align: center; + margin-bottom: 3rem; + color: var(--color-main); + font-weight: 500; + font-size: 1.8rem; +} +.auth .layout__boxHeader { + text-align: center; + justify-content: center; +} + +.auth__action { + margin-top: 3rem; + text-align: center; +} + +/*============================== +=> Settings +================================*/ + +.settings__avatar { + margin-bottom: 3rem; + text-align: center; + margin: 0 auto; + display: flex; + justify-content: center; +} + +.settings__avatar .avatar { + margin: 1rem; +} + +/*============================== +=> Profile +================================*/ +.profile { + margin-bottom: 3rem; +} + +.profile__avatar { + text-align: center; +} + +.profile__info { + text-align: center; +} + +.profile__info h3 { + font-size: 2rem; + color: var(--color-light); + font-weight: 400; +} + +.profile__info p { + color: var(--color-main); + font-weight: 500; + margin-bottom: 1rem; +} + +.profile__about { + margin-top: 2rem; +} + +.profile__about h3 { + text-transform: uppercase; + color: var(--color-dark-light); + margin-bottom: 0.5rem; +} + +.profile-page .roomList__header { + margin-bottom: 1.5rem; +} + +.profile-page .roomList__header h2 { + color: var(--color-dark-light); +} + +/*============================== +=> Room +================================*/ + +.room, +.participants { + background: var(--color-dark); + max-height: 87.5vh; + border-radius: 0.7rem; + overflow: hidden; + position: relative; +} + +@media screen and (max-width: 900px) { + .participants { + display: none; + } + + .layout--2 > .container > div:first-child { + flex-basis: 100%; + } +} + +.room__top, +.participants__top { + background: var(--color-dark-light); + display: flex; + justify-content: space-between; + align-items: center; + padding: 1rem 2rem; + position: relative; +} + +.room__top svg, +.thread__top svg { + width: 1.6rem; + height: 1.6rem; + fill: var(--color-light); + cursor: pointer; +} + +.room__topLeft { + display: flex; + align-items: flex-end; + gap: 1rem; +} + +.room__topLeft h3, +.participants__top { + text-transform: uppercase; + font-weight: 500; + color: var(--color-light); +} + +.room__topLeft svg { + width: 1.6rem; + height: 1.6rem; + fill: var(--color-light); +} + +.room__topRight { + display: flex; + column-gap: 1em; +} + +.room__topRight svg { + fill: var(--color-main-light); +} + +.room__header { + max-height: 30vh; + overflow-y: auto; + position: absolute; + width: 95%; + background: var(--color-dark); + z-index: 999; + top: 4.4rem; + padding-top: 2rem; + padding-bottom: 1rem; +} + +@media screen and (max-width: 500px) { + .room__header { + top: 4.3rem; + padding-right: 2rem; + } +} + +.room__box { + padding-left: 2rem; + padding-right: 2rem; + height: 80.5vh; + /* overflow-y: auto; */ + padding-bottom: 0; +} + +@media screen and (max-width: 500px) { + .room__box { + padding-left: 2.5rem; + padding-right: 2rem; + height: 80.5vh; + overflow-y: auto; + padding-bottom: 0; + } +} + +.room__info { + display: flex; + justify-content: space-between; +} + +.room__info h3 { + font-size: 2.4rem; + font-weight: 500; + color: var(--color-main); +} + +.room__hosted p { + text-transform: uppercase; + color: var(--color-gray); + font-size: 1.2rem; + font-weight: 700; + line-height: 2; +} + +.room__author { + display: flex; + gap: 1rem; + align-items: center; + margin-bottom: 1rem; + transition: all 0.3s ease-in-out; +} + +.room__author:hover { + text-decoration: underline; +} + +.room__topics { + padding: 0.5rem 1.5rem; + background: var(--color-dark-light); + color: var(--color-light); + display: inline-block; + font-size: 1.4rem; + border-radius: 1.5rem; + margin: 1rem 0; +} + +.room__conversation { + margin-top: 1rem; + margin-bottom: 4rem; + height: 64%; +} + +.threads h3 { + text-transform: uppercase; + font-weight: 500; + color: var(--color-gray); +} + +.threads { + background: var(--color-bg); + border-radius: 0.7rem; + overflow-y: auto; + height: 100%; + margin-top: 28vh; + padding: 0 2rem 4rem 2rem; +} + +.thread { + border-left: 2px solid var(--color-dark); + padding-left: 1rem; + margin: 2rem 0; + padding: 2rem; +} + +.thread__top { + display: flex; + align-items: center; + justify-content: space-between; +} + +.thread__top svg { + fill: var(--color-dark-light); +} + +.thread__author { + display: flex; + align-items: center; + gap: 1.5rem; + font-size: 1.4rem; +} + +.thread__authorInfo { + display: flex; + align-items: center; + gap: 1rem; +} + +.thread__details { + font-size: 1.4rem; + margin-top: 0.5rem; +} + +.room__message { + padding: 2rem; + position: absolute; + z-index: 111; + bottom: 0; + left: 0; + right: 0; + background: transparent; +} + +.room__message > form > input { + resize: none; + background-color: var(--color-dark-light); + color: var(--color-light); + border: none; + outline: none; + border-radius: 0.7rem; + height: 4.5rem; + width: 100%; + margin-top: -1rem; + padding: 1.2rem; + font-size: 1.4rem; + font-weight: 500; + position: relative; +} + +.room__message > form > input::placeholder { + color: var(--color-light-gray); +} + +.participants__top span { + color: var(--color-main); + font-size: 1.3rem; + text-transform: none; +} + +.participants__top { + justify-content: flex-start; + gap: 0.5rem; +} + +.participants__list { + padding: 2rem; + height: 82.5vh; + overflow-y: scroll; + padding-bottom: 0; +} + +.participant { + display: flex; + align-items: center; + gap: 1.5rem; + margin-bottom: 2rem; +} + +.participant p { + color: var(--color-light-gray); + line-height: 1.2; +} + +.participant span { + display: block; + font-weight: 500; + color: var(--color-main); + font-weight: 1.4rem; +} diff --git a/studybud/__init__.py b/studybud/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/studybud/__pycache__/__init__.cpython-310.pyc b/studybud/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..231fc4bdd3052643b94c3401db64ef3dea830562 GIT binary patch literal 152 zcmd1j<>g`kf|)ZfCxPh4AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yUTR{fzwFRQ=Sl z)V!3`#1ws()Z*-t`~v-yti-(ZeEs5*(v-@i(i8+EK0Y%qvm`!Vub}c4hfQvNN@-52 N9mvpPCLqDW007awBmw{c literal 0 HcmV?d00001 diff --git a/studybud/__pycache__/settings.cpython-310.pyc b/studybud/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6853532a773c6b6b803f8f37624a384dfa6c28c6 GIT binary patch literal 2320 zcmb7F%Wm676eVfuVZ}-u+j+VL2&6!wq^2C$$fIr2&=T#a(F-OOw?qMg;*6xR`A|4R zyW+OLkwu$bfqq0kpu6t4?W#Y}MNu@pq$FFA1JtF&;qX4ry>sT?pBZW-6mZR0vx*SOM0)&|dUh3cW@ z^?iwA#)#LaQqK=0%0e{ihDaI){vo!RTqx{e4+j>*Na~KHyC`+qu#ihUu(kp=vAipV z6kwzY>bAToKLYPv0CoKUOT+_w*J8x?B>1xdfr!MxpF#q-Fkoy*KP#7!Z&P_3W14~O zyJhT^0kF*cA+c$BnsIpy&jwiPg^nXRgfhwRovq075Cp;`kd7@U#Pt8f3UF^G&>yhJ zT#1jxw#5d~&V&WxQEZ0+-mo8AJ^Rq?Z49=zj_oI#PoD*!+}S!A;Rn`ebNksnws~jk zS#?;wNin5B z^Ld2}3abwux92?=Y>b_32aVRc7R9nP98!4)W)|EPI81dVG0yEMl~-!BYKYa^z82?| zcH2y6xmH`RwVGOV>y*3`+9yf<0_Ev`#yNz0R_L(PvPa!BF6kSGFuWBNKscF~ggC1< z_i9Zw7Mn^#4HlvKqnC4;r$schC_V85WWoVMP#R9|P#h>Mp(12hBQ9~Qq&HrVE&L#Q zeo>?b@rWC`b?o)o;LQKai~5gyraj5=4B*8@0h*zU17e>?$Y5_Hr13&WuS7Zc3_$Oc zqmL)Bz@+OV?7#s+`p{ecF2N3JmTts3(}WY=G~?V5&QXVS0|BUw^QM`cJ&8QP)OU_? zoE^de<1r(@qiAZf)p0>nEBmT$zEZ!5GgWn`vlkbYdcAd^R?U|!P1oYfwWg+n2n0|c zT3l$NQZdpaP3^rMcHp_EfXds;U53YpABtf|AL1AmQ4>C(SsU z%ya`X*8#bbM2}ah>aNnM>n0$#%-xz=ul~dZ60ndCe|=sa_%1HvV`y}2p>h?|Blzr1 z&Vur^$Y&;#&$m1r#rZFQ_t3%5;q%VXuV4_lrKRNsF()pFLOzo(hy_8+^8%k2g!kg# e;(Kvf$O(Lw7yp5I5oF@b{inDp3h6JK&-@Dti5)5c literal 0 HcmV?d00001 diff --git a/studybud/__pycache__/urls.cpython-310.pyc b/studybud/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efbe33958f56c7cbc2838569357782a43f27a799 GIT binary patch literal 975 zcma)5O^?$s5OvaY+fBQ`k)v;Eq!I%HAyt4t3oBMa9Qe58(sg6EO^NMbI}6=we+|Ea zAHgkGPW%N9h;f>V2nlH|#hQ%9Z{B-jtCN!u!Fu@Z`{H&Fp&#z2yZZ3+3_jyFhEl{l z<`RKzor&v;_$Sf#@tzeFxEl+9}8vITstC3W7L7pE5K^lUz3fi zPpFwYkV*UxqjQ-R70cxcOlbN!X&DUj;Lmwu36dZQ%@`mD|u8ZI%aM;-PW-VV}%O9v*mybheEdeoWoSENU-$ZfwK5jR-E zFS%r#GV+3(k8lOa9+Dhh$lt)hCFQmrJ{F2q1%K)Rj2Xigpz+OH-ncjRhQI#+Bfl;# literal 0 HcmV?d00001 diff --git a/studybud/asgi.py b/studybud/asgi.py new file mode 100644 index 0000000..d937b96 --- /dev/null +++ b/studybud/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for studybud project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studybud.settings') + +application = get_asgi_application() diff --git a/studybud/settings.py b/studybud/settings.py new file mode 100644 index 0000000..e2840c9 --- /dev/null +++ b/studybud/settings.py @@ -0,0 +1,127 @@ +""" +Django settings for studybud project. + +Generated by 'django-admin startproject' using Django 4.0.6. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-c7afcj_f-h43vc809=r$#3wye+ay04=(t0#3=z**9k#gkn91(a' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'base.apps.BaseConfig' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'studybud.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [BASE_DIR / 'templates'], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'studybud.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.0/howto/static-files/ + +STATIC_URL = 'static/' + +STATICFILES_DIRS = [ + BASE_DIR / 'static' +] +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/studybud/urls.py b/studybud/urls.py new file mode 100644 index 0000000..9a82c2b --- /dev/null +++ b/studybud/urls.py @@ -0,0 +1,22 @@ +"""studybud URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path,include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('',include('base.urls')) +] diff --git a/studybud/wsgi.py b/studybud/wsgi.py new file mode 100644 index 0000000..91fe926 --- /dev/null +++ b/studybud/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for studybud project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studybud.settings') + +application = get_wsgi_application() diff --git a/templates/main.html b/templates/main.html new file mode 100644 index 0000000..098fc14 --- /dev/null +++ b/templates/main.html @@ -0,0 +1,29 @@ + +{% load static %} + + + + + + + + StudyBuddy - Find study partners around the world! + + + + {% include 'navbar.html' %} {% block content%} {% endblock %} + + + + + + + + + + + + + + + diff --git a/templates/navbar.html b/templates/navbar.html new file mode 100644 index 0000000..d2d969a --- /dev/null +++ b/templates/navbar.html @@ -0,0 +1,83 @@ +{% load static %} +
+
+ + + +
+
+ + + + + + + {% comment %} {% if request.user.is_authenticated %} +
+

Hello {{request.user}}

+
{% endcomment %} + \ No newline at end of file