Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team page #149

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1b74e6e
Added tab component and styled it appropriately
yukitya-1811 Jan 24, 2024
8444015
Basic HTML for Team Page done
yukitya-1811 Jan 26, 2024
86d134d
Added profile_picture to ExecutiveMember model
yukitya-1811 Jan 26, 2024
b63753e
Finalized HTML for Faculty and Member separation on each sig tab
yukitya-1811 Feb 6, 2024
21f06b0
Finished section separation within each sig tab for Faculty, Core and…
yukitya-1811 Feb 8, 2024
1cbbfcb
Added logic to fetch coremember pfp from execmember
yukitya-1811 Feb 8, 2024
393a8b2
Fixed light mode colours
yukitya-1811 Feb 19, 2024
2b2c602
Finished layout for member cards and buttons
yukitya-1811 Feb 24, 2024
2448232
Fixed minor issue (Piston members being loaded in Diode members section)
yukitya-1811 Feb 24, 2024
1f25a8d
Formatted code for better readability
yukitya-1811 Feb 24, 2024
0957689
Fixed centering of tablist issue (Finally)
yukitya-1811 Feb 28, 2024
0f96a94
Added links to all Github and Linkedin buttons
yukitya-1811 Feb 28, 2024
f3d8796
Added proper verbose_name_plural for Faculty
yukitya-1811 Feb 28, 2024
e540e5e
After pre commit hooks
yukitya-1811 Feb 28, 2024
ec7265c
Revert "Added links to all Github and Linkedin buttons"
yukitya-1811 Feb 28, 2024
d831b7f
Resolving conflicts #1
yukitya-1811 Feb 28, 2024
301a96d
Add Team link to small navbar
yukitya-1811 Mar 12, 2024
7764e60
DB fix commit
yukitya-1811 Mar 12, 2024
2394e7e
Made pre-commit changes
yukitya-1811 Mar 13, 2024
b44baa4
Added default pfp png
yukitya-1811 Mar 13, 2024
f1debe5
Made requested changes
yukitya-1811 Mar 13, 2024
5b05494
Finished faculty website buttons
yukitya-1811 Mar 13, 2024
c7bb70a
Added checks for links belonging to Faculty model
yukitya-1811 Mar 13, 2024
110917f
Cleaned up migrations
yukitya-1811 Feb 29, 2024
6d446bd
Changed upload folder for profile pictures to accounts/executivemember
yukitya-1811 Mar 6, 2024
1639e76
Update corpus/pages/urls.py
yukitya-1811 Mar 6, 2024
bbd88ca
Revert "Added checks for links belonging to Faculty model"
yukitya-1811 Mar 13, 2024
a00ee2c
Revert "Fixed conflicts"
yukitya-1811 Mar 13, 2024
98c6858
Fixed html issues and query logic
yukitya-1811 Mar 14, 2024
8ef8c1b
Fixed html indentation and member fetching query to exclude faculty u…
yukitya-1811 Mar 14, 2024
e049df2
Change upload directory of profile pictures
yukitya-1811 Mar 22, 2024
90f109f
Add core post to string representation
yukitya-1811 Mar 22, 2024
d3443fa
Minor change in path string for teampage
yukitya-1811 Mar 22, 2024
11eea97
Squash migrations
yukitya-1811 Mar 23, 2024
8136437
Add dummydata
yukitya-1811 Apr 20, 2024
90227bd
Revert "Add dummydata"
yukitya-1811 Apr 21, 2024
dc2db60
Change migration dependencies
yukitya-1811 Apr 24, 2024
fb6707e
Fix migration files
yukitya-1811 May 13, 2024
e56b127
Add new migration file for Faculty, Core models
yukitya-1811 May 13, 2024
49ea960
Minor changes
yukitya-1811 May 13, 2024
228392c
Change views.py logic and change models to facilitate better fetching…
yukitya-1811 May 16, 2024
d51e36b
Squash migrations
yukitya-1811 May 16, 2024
2f794e7
Add logic to only fetch active batch members and reduce db queries
yukitya-1811 Jan 15, 2025
76bda8c
Merge branch 'main' into TeamPage
yukitya-1811 Jan 15, 2025
7c756a7
Clean up migrations
yukitya-1811 Jan 15, 2025
f7ccdad
Merge branch 'TeamPage' of https://github.com/IEEE-NITK/corpus into T…
yukitya-1811 Jan 15, 2025
9d5c4b2
Change button display conditionals
yukitya-1811 Jan 21, 2025
b15744b
Add team to navbar
yukitya-1811 Jan 21, 2025
5a4a955
Use partials to clean up the code
yukitya-1811 Feb 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion corpus/accounts/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin

from .models import Core
from .models import ExecutiveMember
from .models import Faculty
from .models import Post
from .models import User

# Register your models here.
Expand Down Expand Up @@ -67,7 +70,7 @@ class ExecutiveMemberAdmin(admin.ModelAdmin):
),
(
"IEEE Related Details",
{"fields": ("ieee_number", "ieee_email")},
{"fields": ("ieee_number", "ieee_email", "profile_picture")},
),
("Socials", {"fields": ("linkedin", "github")}),
)
Expand All @@ -82,5 +85,20 @@ class ExecutiveMemberAdmin(admin.ModelAdmin):
ordering = ("user",)


class CoreAdmin(admin.ModelAdmin):
list_display = ("executivemember", "society", "post", "term_start")


class FacultyAdmin(admin.ModelAdmin):
list_display = ("user", "sig", "post", "term_start")


class PostAdmin(admin.ModelAdmin):
list_display = ("name", "priority")


admin.site.register(User, CorpusUserAdmin)
admin.site.register(ExecutiveMember, ExecutiveMemberAdmin)
admin.site.register(Core, CoreAdmin)
admin.site.register(Faculty, FacultyAdmin)
admin.site.register(Post, PostAdmin)
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class Migration(migrations.Migration):
verbose_name="Date Joined",
),
),
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class Migration(migrations.Migration):
name='date_joined',
field=models.DateTimeField(default=django.utils.timezone.localtime, verbose_name='Date Joined'),
),
]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Generated by Django 5.1.3 on 2025-01-15 10:23

import datetime
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0007_alter_executivemember_date_joined'),
('config', '0004_sig_society_sigs'),
]

operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('priority', models.IntegerField()),
('name', models.CharField(max_length=100)),
('is_execom', models.BooleanField(default=False)),
('is_sac', models.BooleanField(default=False)),
],
),
migrations.AddField(
model_name='executivemember',
name='profile_picture',
field=models.ImageField(blank=True, null=True, upload_to='accounts/executivemember/profile_picture'),
),
migrations.AlterField(
model_name='executivemember',
name='date_joined',
field=models.DateTimeField(default=datetime.datetime(2025, 1, 15, 10, 23, 48, 499267, tzinfo=datetime.timezone.utc), verbose_name='Date Joined'),
),
migrations.CreateModel(
name='Faculty',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('profile_picture', models.ImageField(blank=True, null=True, upload_to='accounts/faculty/profile_picture')),
('website', models.URLField(blank=True, null=True)),
('linkedin', models.URLField(blank=True, null=True, verbose_name='Linkedin Profile URL')),
('term_start', models.DateField()),
('term_end', models.DateField()),
('sig', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='config.sig')),
('society', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='config.society')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.post')),
],
options={
'verbose_name_plural': 'faculties',
},
),
migrations.CreateModel(
name='Core',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('term_start', models.DateField()),
('term_end', models.DateField()),
('executivemember', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounts.executivemember')),
('society', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='config.society')),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.post')),
],
),
]
51 changes: 51 additions & 0 deletions corpus/accounts/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from config.models import SIG
from config.models import Society
from django.contrib.auth.base_user import BaseUserManager
from django.contrib.auth.models import AbstractUser
from django.db import models
Expand Down Expand Up @@ -134,6 +135,9 @@ class ExecutiveMember(models.Model):
blank=True, null=True, verbose_name="Linkedin Profile URL"
)

profile_picture = models.ImageField(
blank=True, null=True, upload_to="accounts/executivemember/profile_picture"
)
# TODO: Phase out with GitHub OAuth details
github = models.CharField(
max_length=39, blank=True, null=True, verbose_name="GitHub Username"
Expand All @@ -150,3 +154,50 @@ def save(self, *args, **kwargs):

def __str__(self):
return f"{self.user.first_name} {self.user.last_name} [{self.sig.name}]"


class Post(models.Model):
priority = models.IntegerField(null=False)
name = models.CharField(max_length=100, null=False)
is_execom = models.BooleanField(null=False, default=False)
is_sac = models.BooleanField(null=False, default=False)

def __str__(self):
return self.name


class Core(models.Model):
executivemember = models.OneToOneField(
ExecutiveMember, null=False, on_delete=models.CASCADE
)
post = models.ForeignKey(Post, null=False, on_delete=models.CASCADE)
society = models.ForeignKey(
Society, blank=True, null=True, on_delete=models.CASCADE
)
term_start = models.DateField()
term_end = models.DateField()

def __str__(self):
self_user = self.executivemember.user
return f"{self_user.first_name} {self_user.last_name} | {self.post.name}"


class Faculty(models.Model):
class Meta:
verbose_name_plural = "faculties"

profile_picture = models.ImageField(
blank=True, null=True, upload_to="accounts/faculty/profile_picture"
)
user = models.OneToOneField(User, null=False, on_delete=models.CASCADE)
sig = models.ForeignKey(SIG, null=False, on_delete=models.CASCADE)
society = models.ForeignKey(
Society, blank=True, null=True, on_delete=models.CASCADE
)
post = models.ForeignKey(Post, null=False, on_delete=models.CASCADE)
website = models.URLField(max_length=200, null=True, blank=True)
linkedin = models.URLField(
blank=True, null=True, verbose_name="Linkedin Profile URL"
)
term_start = models.DateField()
term_end = models.DateField()
Loading