-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from IEEE-NITK/landing_page
Add landing page
- Loading branch information
Showing
39 changed files
with
927 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ repos: | |
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
exclude: migrations/ | ||
args: | ||
- --max-line-length=88 | ||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.contrib import admin | ||
|
||
from .models import Society | ||
|
||
|
||
# Define the fields to be displayed in the admin panel | ||
class SocietyAdmin(admin.ModelAdmin): | ||
list_display = ("id", "name", "url") | ||
list_display_links = ("name",) | ||
|
||
|
||
admin.site.register(Society, SocietyAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ConfigConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Generated by Django 4.2.4 on 2023-09-10 16:43 | ||
from django.db import migrations | ||
from django.db import models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Society", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"name", | ||
models.CharField( | ||
choices=[ | ||
("AESS", "Aerospace and Electronic Systems Society"), | ||
("APS", "Antennas and Propagation Society"), | ||
("BTS", "Broadcast Technology Society"), | ||
("CASS", "Circuits and Systems Society"), | ||
("COM", "Communications Society"), | ||
("CIS", "Computational Intelligence Society"), | ||
("CS", "Computer Society"), | ||
("CTS", "Consumer Technology Society"), | ||
("CSS", "Control Systems Society"), | ||
("DEIS", "Dielectrics and Electrical Insulation Society"), | ||
("ES", "Education Society"), | ||
("ECS", "Electromagnetic Compatibility Society"), | ||
("EDS", "Electron Devices Society"), | ||
("EPS", "Electronics Packing Society"), | ||
("EMBS", "Engineering in Medicine and Biology Society"), | ||
("GRSS", "Geoscience and Remote Sensing Society"), | ||
("IES", "Industrial Electronics Society"), | ||
("IAS", "Industry Applications Society"), | ||
("ITS", "Information Theory Society"), | ||
("IMS", "Instrumentation and Measurement Society"), | ||
("ITSS", "Intelligent Transportation Systems Society"), | ||
("MS", "Magnetics Society"), | ||
("MTTS", "Microwave Theory and Technology Society"), | ||
("NPSS", "Nuclear and Plasma Sciences Society"), | ||
("OES", "Oceanic Engineering Society"), | ||
("PHO", "Photonics Society"), | ||
("PELS", "Power Electronics Society"), | ||
("PES", "Power and Energy Society"), | ||
("PSES", "Product Safety Engineering Society"), | ||
("PCS", "Professional Communication Society"), | ||
("RS", "Reliability Society"), | ||
("RAS", "Robotics and Automation Society"), | ||
("SPS", "Signal Processing Society"), | ||
("SSIT", "Society on Social Implications of Technology"), | ||
("SSCS", "Solid-State Circuits Society"), | ||
("SMCS", "Systems, Man, and Cybernetics Society"), | ||
("TEMS", "Technology and Engineering Management Society"), | ||
( | ||
"UFFCS", | ||
"Ultrasonics, Ferroelectrics, and Frequency Control Society", | ||
), | ||
("VT", "Vehicular Technology Society"), | ||
], | ||
max_length=5, | ||
unique=True, | ||
verbose_name="Name", | ||
), | ||
), | ||
("url", models.URLField(unique=True, verbose_name="URL")), | ||
( | ||
"image", | ||
models.ImageField(upload_to="img/logo/", verbose_name="Image"), | ||
), | ||
( | ||
"dark_image", | ||
models.ImageField( | ||
blank=True, | ||
null=True, | ||
upload_to="img/logo/", | ||
verbose_name="Dark Image", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Society", | ||
"verbose_name_plural": "Societies", | ||
}, | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
from django.db import models | ||
|
||
|
||
class Society(models.Model): | ||
""" | ||
Society Model. | ||
Defines all societies that are part of IEEE NITK SB. | ||
""" | ||
|
||
IEEE_SOCIETIES = [ | ||
("AESS", "Aerospace and Electronic Systems Society"), | ||
("APS", "Antennas and Propagation Society"), | ||
("BTS", "Broadcast Technology Society"), | ||
("CASS", "Circuits and Systems Society"), | ||
("COM", "Communications Society"), | ||
("CIS", "Computational Intelligence Society"), | ||
("CS", "Computer Society"), | ||
("CTS", "Consumer Technology Society"), | ||
("CSS", "Control Systems Society"), | ||
("DEIS", "Dielectrics and Electrical Insulation Society"), | ||
("ES", "Education Society"), | ||
("ECS", "Electromagnetic Compatibility Society"), | ||
("EDS", "Electron Devices Society"), | ||
("EPS", "Electronics Packing Society"), | ||
("EMBS", "Engineering in Medicine and Biology Society"), | ||
("GRSS", "Geoscience and Remote Sensing Society"), | ||
("IES", "Industrial Electronics Society"), | ||
("IAS", "Industry Applications Society"), | ||
("ITS", "Information Theory Society"), | ||
("IMS", "Instrumentation and Measurement Society"), | ||
("ITSS", "Intelligent Transportation Systems Society"), | ||
("MS", "Magnetics Society"), | ||
("MTTS", "Microwave Theory and Technology Society"), | ||
("NPSS", "Nuclear and Plasma Sciences Society"), | ||
("OES", "Oceanic Engineering Society"), | ||
("PHO", "Photonics Society"), | ||
("PELS", "Power Electronics Society"), | ||
("PES", "Power and Energy Society"), | ||
("PSES", "Product Safety Engineering Society"), | ||
("PCS", "Professional Communication Society"), | ||
("RS", "Reliability Society"), | ||
("RAS", "Robotics and Automation Society"), | ||
("SPS", "Signal Processing Society"), | ||
("SSIT", "Society on Social Implications of Technology"), | ||
("SSCS", "Solid-State Circuits Society"), | ||
("SMCS", "Systems, Man, and Cybernetics Society"), | ||
("TEMS", "Technology and Engineering Management Society"), | ||
("UFFCS", "Ultrasonics, Ferroelectrics, and Frequency Control Society"), | ||
("VT", "Vehicular Technology Society"), | ||
] | ||
name = models.CharField( | ||
verbose_name="Name", max_length=5, unique=True, choices=IEEE_SOCIETIES | ||
) | ||
url = models.URLField(verbose_name="URL", max_length=200, unique=True) | ||
image = models.ImageField(verbose_name="Image", upload_to="img/logo/") | ||
dark_image = models.ImageField( | ||
verbose_name="Dark Image", upload_to="img/logo/", blank=True, null=True | ||
) | ||
|
||
def __str__(self): | ||
return self.get_name_display() | ||
|
||
class Meta: | ||
verbose_name = "Society" | ||
verbose_name_plural = "Societies" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# from django.test import TestCase | ||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# from django.shortcuts import render | ||
# Create your views here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[ | ||
{ | ||
"fields": { | ||
"dark_image": "img/logo/compsoc-dark.png", | ||
"image": "img/logo/compsoc-light.png", | ||
"name": "CS", | ||
"url": "https://www.computer.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 1 | ||
}, | ||
{ | ||
"fields": { | ||
"dark_image": "", | ||
"image": "img/logo/sps.png", | ||
"name": "SPS", | ||
"url": "https://signalprocessingsociety.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 2 | ||
}, | ||
{ | ||
"fields": { | ||
"dark_image": "img/logo/cass-dark.png", | ||
"image": "img/logo/cass-light.png", | ||
"name": "CASS", | ||
"url": "https://ieee-cas.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 3 | ||
}, | ||
{ | ||
"fields": { | ||
"dark_image": "img/logo/ias-dark.png", | ||
"image": "img/logo/ias-light.png", | ||
"name": "IAS", | ||
"url": "https://ias.ieee.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 4 | ||
}, | ||
{ | ||
"fields": { | ||
"dark_image": "", | ||
"image": "img/logo/photonics.png", | ||
"name": "PHO", | ||
"url": "https://www.photonicssociety.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 5 | ||
}, | ||
{ | ||
"fields": { | ||
"dark_image": "", | ||
"image": "img/logo/ras.png", | ||
"name": "RAS", | ||
"url": "https://www.ieee-ras.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 6 | ||
}, | ||
{ | ||
"fields": { | ||
"dark_image": "img/logo/grss-dark.png", | ||
"image": "img/logo/grss-light.png", | ||
"name": "GRSS", | ||
"url": "https://www.grss-ieee.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 7 | ||
}, | ||
{ | ||
"fields": { | ||
"dark_image": "img/logo/cis-dark.png", | ||
"image": "img/logo/cis-light.png", | ||
"name": "CIS", | ||
"url": "https://cis.ieee.org/" | ||
}, | ||
"model": "config.society", | ||
"pk": 8 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
from config.models import Society | ||
from django.shortcuts import render | ||
|
||
# Create your views here. | ||
|
||
|
||
def index(request): | ||
args = {} | ||
return render(request, "pages/index.html", args) | ||
# Get all societies to render on landing page Societies section | ||
societies = Society.objects.all() | ||
|
||
return render( | ||
request, | ||
"pages/index.html", | ||
{ | ||
"societies": societies, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ asgiref==3.7.2 | |
Django==4.2.4 | ||
gunicorn==21.2.0 | ||
packaging==23.1 | ||
Pillow==10.0.0 | ||
psycopg2==2.9.7 | ||
sqlparse==0.4.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.