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

Add About Us Page #42

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,23 @@ repos:
rev: v3.9.0
hooks:
- id: reorder-python-imports

- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit

- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck

- repo: https://github.com/ecugol/pre-commit-hooks-django
rev: v0.4.0 # Use the ref you want to point at
hooks:
- id: check-untracked-migrations
74 changes: 74 additions & 0 deletions corpus/config/migrations/0002_society_description_society_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Generated by Django 4.2.4 on 2023-11-13 17:31
anirudhprabhakaran3 marked this conversation as resolved.
Show resolved Hide resolved
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

dependencies = [
("config", "0001_initial"),
]

operations = [
migrations.AddField(
model_name="society",
name="description",
field=models.TextField(default="", verbose_name="Description"),
preserve_default=False,
),
migrations.AlterField(
model_name="society",
name="name",
field=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"),
("SIGHT", "Special Interest Group on Humanitarian Technology"),
("WIE", "Women in Engineering"),
],
max_length=5,
unique=True,
verbose_name="Name",
),
),
]
3 changes: 3 additions & 0 deletions corpus/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class Society(models.Model):
("TEMS", "Technology and Engineering Management Society"),
("UFFCS", "Ultrasonics, Ferroelectrics, and Frequency Control Society"),
("VT", "Vehicular Technology Society"),
("SIGHT", "Special Interest Group on Humanitarian Technology"),
("WIE", "Women in Engineering"),
]
name = models.CharField(
verbose_name="Name", max_length=5, unique=True, choices=IEEE_SOCIETIES
Expand All @@ -56,6 +58,7 @@ class Society(models.Model):
dark_image = models.ImageField(
verbose_name="Dark Image", upload_to="img/logo/", blank=True, null=True
)
description = models.TextField(verbose_name="Description")

def __str__(self):
return self.get_name_display()
Expand Down
30 changes: 30 additions & 0 deletions corpus/config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"fields": {
"dark_image": "img/logo/compsoc-dark.png",
"description": "The IEEE NITK Computer Society Chapter intends to explore and contribute to the rapidly evolving world of computer technologies by carrying out research and projects in the broad domains of computer science in the form of three focus groups: Intelligence, Systems and Theoretical Computer Science.",
"image": "img/logo/compsoc-light.png",
"name": "CS",
"url": "https://www.computer.org/"
Expand All @@ -12,6 +13,7 @@
{
"fields": {
"dark_image": "",
"description": "The IEEE NITK Signal Processing Society Chapter focuses projects and research in areas of signal processing and machine learning. Projects undertaken here are oriented towards healthcare and solutions to humanitarian needs.",
"image": "img/logo/sps.png",
"name": "SPS",
"url": "https://signalprocessingsociety.org/"
Expand All @@ -22,6 +24,7 @@
{
"fields": {
"dark_image": "img/logo/cass-dark.png",
"description": "The IEEE NITK Circuits and Systems Society Chapter focuses on areas around electrical and electronic circuits with applications in healthcare, industry appliances, home appliances and electronics systems research.",
"image": "img/logo/cass-light.png",
"name": "CASS",
"url": "https://ieee-cas.org/"
Expand All @@ -32,6 +35,7 @@
{
"fields": {
"dark_image": "img/logo/ias-dark.png",
"description": "The IEEE IAS vision \u201cto be a world leader in the advancement of technology and dissemination of technical information to support professionals engaged in the applications of electrical and electronic engineering to industry\u201d has become possible with the professional connection of Industry Professionals in Electrical and Electronic Engineering.",
"image": "img/logo/ias-light.png",
"name": "IAS",
"url": "https://ias.ieee.org/"
Expand All @@ -42,6 +46,7 @@
{
"fields": {
"dark_image": "",
"description": "The IEEE Photonics Society forms the hub of a vibrant technical community dedicated to transforming breakthroughs in quantum physics into the devices, systems and products to revolutionize our daily lives. From ubiquitous and inexpensive global communications via fiber optics, to lasers for medical and other applications, to flat-screen displays, to photovoltaic devices for solar energy, to LEDs for energy-efficient illumination, there are myriad examples of the society's impact on the world around us.",
"image": "img/logo/photonics.png",
"name": "PHO",
"url": "https://www.photonicssociety.org/"
Expand All @@ -52,6 +57,7 @@
{
"fields": {
"dark_image": "",
"description": "The IEEE RAS Student Chapter focuses on the interdisciplinary nature of technology and engineering and strives to advance robotics and intelligent systems technology in various fields of biomedical engineering, security, industry and home automation through research and ingenuity.",
"image": "img/logo/ras.png",
"name": "RAS",
"url": "https://www.ieee-ras.org/"
Expand All @@ -62,6 +68,7 @@
{
"fields": {
"dark_image": "img/logo/grss-dark.png",
"description": "GRSS - The Geoscience and Remote Sensing Society (GRSS) is a technical Society of the Institute of Electrical and Electronics Engineers (IEEE). GRSS encourages its members to participate in science, engineering, applications, and education linked to the advancement of geoscience and remote sensing for the benefit of society.",
"image": "img/logo/grss-light.png",
"name": "GRSS",
"url": "https://www.grss-ieee.org/"
Expand All @@ -72,11 +79,34 @@
{
"fields": {
"dark_image": "img/logo/cis-dark.png",
"description": "The IEEE Computational Intelligence Society (CIS) is a vibrant community working towards a common goal - to unravel the mysteries of the ever-evolving field of computational intelligence with its focus on neural networks, fuzzy systems, and evolutionary computation. The society hosts conferences, publishes journals, and provides educational resources to foster learning and collaboration leading to the development of cutting-edge applications and forging the future of AI.",
"image": "img/logo/cis-light.png",
"name": "CIS",
"url": "https://cis.ieee.org/"
},
"model": "config.society",
"pk": 8
},
{
"fields": {
"dark_image": "",
"description": "The IEEE NITK WIE is a professional organisation dedicated to promoting technical interests among women engineers and scientists. It was launched on February 18th 2009 by Prof Marimuthu, the R10 WIE Coordinator. Our mission is to inspire, engage, encourage, and empower IEEE women student members and facilitate the recruitment and retention of women in technical disciplines globally.",
"image": "img/logo/wie.png",
"name": "WIE",
"url": "https://wie.ieee.org/"
},
"model": "config.society",
"pk": 9
},
{
"fields": {
"dark_image": "",
"description": "IEEE Special Interest Group on Humanitarian Technology (SIGHT) provides IEEE members with the opportunity to work with a large network of volunteers around the world carrying out and/or supporting impactful humanitarian activities on the local level. IEEE SIGHT focuses on sustainable solutions that make a long-term difference in the lives of people. SIGHT operates through local volunteers and partners working with local communities.",
"image": "img/logo/sight.png",
"name": "SIGHT",
"url": "https://sight.ieee.org/"
},
"model": "config.society",
"pk": 10
}
]
2 changes: 2 additions & 0 deletions corpus/pages/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from django.urls import path

from .views import about_us
from .views import index

urlpatterns = [
path("", index, name="index"),
path("about_us/", about_us, name="about_us"),
]
12 changes: 12 additions & 0 deletions corpus/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ def index(request):
"societies": societies,
},
)


def about_us(request):
societies = Society.objects.all()

return render(
request,
"pages/about_us.html",
{
"socieites": societies,
},
)
2 changes: 1 addition & 1 deletion corpus/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
<script src="https://code.jquery.com/jquery-3.7.0.min.js"
integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/daisyui@3.6.2/dist/full.css" rel="stylesheet" type="text/css" />
<link href="https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.css" rel="stylesheet" type="text/css" />
{% block style %}
{% endblock %}
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
Expand Down
14 changes: 10 additions & 4 deletions corpus/templates/components/dark_mode_toggle.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
const icon = theme == "winter" ? "dark_mode" : "light_mode";
document.documentElement.setAttribute("data-theme", theme);
$("#dark-mode-toggle").html(icon);
updateParticles(theme);
updateIndex(theme);
})

Expand All @@ -18,27 +19,32 @@
const icon = theme == "winter" ? "dark_mode" : "light_mode";
document.documentElement.setAttribute("data-theme", theme);
$("#dark-mode-toggle").html(icon);
updateParticles(theme);
updateIndex(theme);
localStorage.setItem("corpusTheme", theme);
}

{% if request.get_full_path == "/" %}
const updateIndex = (theme) => {
const updateParticles = (theme) => {
if (theme == "winter") {
particlesJS.load('particles-js', '/static/js/particles.json');
} else {
particlesJS.load('particles-js', '/static/js/particles-dark.json');
}
}

const updateIndex = (theme) => {
if (theme == "winter") {
$("#ieee-white").hide();
$("#ieee-blue").show();

$(".dark-logo").hide();
$(".light-logo").show();
} else {
particlesJS.load('particles-js', '/static/js/particles-dark.json');
$("#ieee-blue").hide();
$("#ieee-white").show();

$(".light-logo").hide();
$(".dark-logo").show();
}
}
{% endif %}
</script>
1 change: 1 addition & 0 deletions corpus/templates/components/general_dropdown.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<ul class="mx-2">
<li class="text-xl font-bold text-white my-2">General</li>
<li><a href="{% url 'index' %}">Home</a></li>
<li><a href="{% url 'about_us' %}">About Us</a></li>
</ul>
Loading