From 9c4098e4aceb22c20174129814a017a389c922c9 Mon Sep 17 00:00:00 2001 From: ady Date: Wed, 24 Jan 2024 18:45:19 +0530 Subject: [PATCH 01/16] Added tab component and styled it appropriately --- corpus/pages/urls.py | 1 + corpus/pages/views.py | 7 +++++ corpus/templates/pages/team.html | 45 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 corpus/templates/pages/team.html diff --git a/corpus/pages/urls.py b/corpus/pages/urls.py index 1d3a5671..1ec7a1b7 100644 --- a/corpus/pages/urls.py +++ b/corpus/pages/urls.py @@ -6,4 +6,5 @@ path("", views.index, name="index"), path("about_us/", views.about_us, name="about_us"), path("sig//", views.sig, name="sig"), + path("team", views.team, name="team"), ] diff --git a/corpus/pages/views.py b/corpus/pages/views.py index ff3e9e9b..6732a150 100644 --- a/corpus/pages/views.py +++ b/corpus/pages/views.py @@ -41,3 +41,10 @@ def sig(request, sig_name): } return render(request, "pages/sig.html", args) + + +def team(request): + context = { + 'USE_TAILWIND_CDN_LINK':True, + } + return render(request, "pages/team.html", context) \ No newline at end of file diff --git a/corpus/templates/pages/team.html b/corpus/templates/pages/team.html new file mode 100644 index 00000000..c18f160a --- /dev/null +++ b/corpus/templates/pages/team.html @@ -0,0 +1,45 @@ +{% extends 'base.html' %} +{% load static %} + +{% block content %} + + + + + +
+
+ CompSoc +
+ Hello1
+ Diode +
+ Hello2
+ Piston +
+ Hello3
+
+
+ + +{% endblock %} From ccd45304e24e4f2d070f47f9237e732582f8cc11 Mon Sep 17 00:00:00 2001 From: ady Date: Sat, 27 Jan 2024 01:47:48 +0530 Subject: [PATCH 02/16] Basic HTML for Team Page done --- corpus/pages/views.py | 4 +- corpus/templates/pages/team.html | 86 +++++++++++++++++++++++++++----- 2 files changed, 76 insertions(+), 14 deletions(-) diff --git a/corpus/pages/views.py b/corpus/pages/views.py index 6732a150..d9aee03f 100644 --- a/corpus/pages/views.py +++ b/corpus/pages/views.py @@ -1,5 +1,6 @@ from config.models import SIG from config.models import Society +from accounts.models import ExecutiveMember from django.shortcuts import get_object_or_404 from django.shortcuts import render @@ -44,7 +45,8 @@ def sig(request, sig_name): def team(request): + members = ExecutiveMember.objects.all() context = { - 'USE_TAILWIND_CDN_LINK':True, + "members":members, } return render(request, "pages/team.html", context) \ No newline at end of file diff --git a/corpus/templates/pages/team.html b/corpus/templates/pages/team.html index c18f160a..8d0855c3 100644 --- a/corpus/templates/pages/team.html +++ b/corpus/templates/pages/team.html @@ -5,33 +5,93 @@ -
- CompSoc + CompSoc
- Hello1
- Diode +
+ {% for member in members %} + {% if member.sig.name == "CompSoc" %} +
+
+ photo +
+
+

{{member.user}}

+

Wow

+
+ +
+
+
+ {% endif %} + {% endfor %} +
+
+ Diode
- Hello2
- Piston +
+ {% for member in members %} + {% if member.sig.name == "Diode" %} +
+
+ photo +
+
+

{{member.user}}

+

Wow

+
+ +
+
+
+ {% endif %} + {% endfor %} +
+
+ Piston
- Hello3
+
+ {% for member in members %} + {% if member.sig.name == "Piston" %} +
+
+ photo +
+
+

{{member.user}}

+

Wow

+
+ +
+
+
+ {% endif %} + {% endfor %} +
+ +{% endblock %} + +{% block script %} {% endblock %} From 4cd43ddbedf0a3a63da7116ad3eaa7360b50b389 Mon Sep 17 00:00:00 2001 From: ady Date: Thu, 29 Feb 2024 00:11:18 +0530 Subject: [PATCH 12/16] Added links to all Github and Linkedin buttons --- corpus/templates/pages/team.html | 47 ++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/corpus/templates/pages/team.html b/corpus/templates/pages/team.html index 9d9918d4..9bacf95e 100644 --- a/corpus/templates/pages/team.html +++ b/corpus/templates/pages/team.html @@ -100,8 +100,9 @@

IEEE Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -124,9 +125,10 @@

IEEE Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -151,8 +153,9 @@

CompSoc Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -175,9 +178,10 @@

CompSoc Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -198,9 +202,10 @@

Members

{{member.user}}

+
- - + +
@@ -226,8 +231,9 @@

Diode Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -250,9 +256,10 @@

Diode Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -273,9 +280,10 @@

Members

{{member.user}}

+
- - + +
@@ -301,8 +309,9 @@

Piston Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -325,9 +334,10 @@

Piston Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -348,9 +358,10 @@

Members

{{member.user}}

+
- - + +
From 4de896a7a07deffeac94c90f7788c767a38a6adf Mon Sep 17 00:00:00 2001 From: ady Date: Thu, 29 Feb 2024 00:16:27 +0530 Subject: [PATCH 13/16] Added proper verbose_name_plural for Faculty --- corpus/accounts/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/corpus/accounts/models.py b/corpus/accounts/models.py index f0475a36..b93dfef3 100644 --- a/corpus/accounts/models.py +++ b/corpus/accounts/models.py @@ -158,6 +158,9 @@ class Core(models.Model): term_end = models.DateField(null=True) class Faculty(models.Model): + + class Meta: + verbose_name_plural = 'faculties' user = models.OneToOneField(User, null=False, on_delete=models.CASCADE) sig = models.ForeignKey(SIG, null=False, on_delete=models.CASCADE) post = models.CharField(max_length=100, null=False) From c364ec38331ae5a34453a9fedf96234d273b5d01 Mon Sep 17 00:00:00 2001 From: ady Date: Thu, 29 Feb 2024 00:23:51 +0530 Subject: [PATCH 14/16] After pre commit hooks --- corpus/accounts/models.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/corpus/accounts/models.py b/corpus/accounts/models.py index b93dfef3..38918700 100644 --- a/corpus/accounts/models.py +++ b/corpus/accounts/models.py @@ -135,11 +135,15 @@ class ExecutiveMember(models.Model): blank=True, null=True, verbose_name="Linkedin Profile URL" ) - profile_picture = models.ImageField(blank=True, null=True, upload_to="execmember/profile_picture") + profile_picture = models.ImageField( + blank=True, null=True, upload_to="execmember/profile_picture" + ) # TODO: Phase out with GitHub OAuth details github = models.CharField(blank=True, null=True, verbose_name="GitHub Username") is_nep = models.BooleanField(default=False, verbose_name="Is NEP Member?") - date_joined = models.DateTimeField(verbose_name="Date Joined", default=datetime.now()) + date_joined = models.DateTimeField( + verbose_name="Date Joined", default=datetime.now() + ) def save(self, *args, **kwargs): self.roll_number = self.roll_number.upper() @@ -148,7 +152,7 @@ def save(self, *args, **kwargs): def __str__(self): return f"{self.user.first_name} {self.user.last_name} [{self.sig.name}]" - + class Core(models.Model): user = models.OneToOneField(User, null=False, on_delete=models.CASCADE) @@ -157,12 +161,13 @@ class Core(models.Model): term_start = models.DateField(default=datetime.now(), null=False) term_end = models.DateField(null=True) -class Faculty(models.Model): +class Faculty(models.Model): class Meta: - verbose_name_plural = 'faculties' + verbose_name_plural = "faculties" + user = models.OneToOneField(User, null=False, on_delete=models.CASCADE) sig = models.ForeignKey(SIG, null=False, on_delete=models.CASCADE) post = models.CharField(max_length=100, null=False) term_start = models.DateField(default=datetime.now(), null=False) - term_end = models.DateField(null=True) \ No newline at end of file + term_end = models.DateField(null=True) From 75c2922e91ef763ba09836630b720abc67523d23 Mon Sep 17 00:00:00 2001 From: ady Date: Thu, 29 Feb 2024 00:28:17 +0530 Subject: [PATCH 15/16] Revert "Added links to all Github and Linkedin buttons" This reverts commit 4cd43ddbedf0a3a63da7116ad3eaa7360b50b389. --- corpus/templates/pages/team.html | 57 +++++++++++++------------------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/corpus/templates/pages/team.html b/corpus/templates/pages/team.html index 9bacf95e..dbfbaf1e 100644 --- a/corpus/templates/pages/team.html +++ b/corpus/templates/pages/team.html @@ -74,13 +74,13 @@

Teams

- + IEEE CompSoc - + Diode - + Piston
@@ -100,9 +100,8 @@

IEEE Faculty

{{fac.user}}

{{fac.post}}

-
-
@@ -125,10 +124,9 @@

IEEE Core

{{core.user}}

{{core.post}}

-
- - + +
@@ -153,9 +151,8 @@

CompSoc Faculty

{{fac.user}}

{{fac.post}}

-
- +
@@ -178,10 +175,9 @@

CompSoc Core

{{core.user}}

{{core.post}}

-
- - + +
@@ -202,10 +198,9 @@

Members

{{member.user}}

-
- - + +
@@ -231,9 +226,8 @@

Diode Faculty

{{fac.user}}

{{fac.post}}

-
- +
@@ -256,10 +250,9 @@

Diode Core

{{core.user}}

{{core.post}}

-
- - + +
@@ -280,10 +273,9 @@

Members

{{member.user}}

-
- - + +
@@ -309,9 +301,8 @@

Piston Faculty

{{fac.user}}

{{fac.post}}

-
- +
@@ -334,10 +325,9 @@

Piston Core

{{core.user}}

{{core.post}}

-
- - + +
@@ -358,10 +348,9 @@

Members

{{member.user}}

-
- - + +
@@ -387,12 +376,12 @@

{{member.user}}

for (i = 0; i < tablinks.length; i++) { tablinks[i].classList.remove("tab-active"); } - + // Show the specific tab content document.getElementById(pageName).style.display = "block"; document.getElementById(tabName).classList.add("tab-active"); } - + // Get the element with id="defaultOpen" and click on it document.getElementById("IEEE-tab").click(); From 34c08e37457382ca44fd858c6d8a6924160cc735 Mon Sep 17 00:00:00 2001 From: ady Date: Thu, 29 Feb 2024 00:51:14 +0530 Subject: [PATCH 16/16] Resolving conflicts #1 --- corpus/templates/pages/team.html | 47 ++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/corpus/templates/pages/team.html b/corpus/templates/pages/team.html index dbfbaf1e..aa2c0162 100644 --- a/corpus/templates/pages/team.html +++ b/corpus/templates/pages/team.html @@ -100,8 +100,9 @@

IEEE Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -124,9 +125,10 @@

IEEE Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -151,8 +153,9 @@

CompSoc Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -175,9 +178,10 @@

CompSoc Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -198,9 +202,10 @@

Members

{{member.user}}

+
- - + +
@@ -226,8 +231,9 @@

Diode Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -250,9 +256,10 @@

Diode Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -273,9 +280,10 @@

Members

{{member.user}}

+
- - + +
@@ -301,8 +309,9 @@

Piston Faculty

{{fac.user}}

{{fac.post}}

+
- +
@@ -325,9 +334,10 @@

Piston Core

{{core.user}}

{{core.post}}

+
- - + +
@@ -348,9 +358,10 @@

Members

{{member.user}}

+
- - + +