From c39de1bc9e3a9e03ffe8d64dfdeba2d3a141928e Mon Sep 17 00:00:00 2001 From: Zorex Salvo Date: Mon, 15 Sep 2025 12:45:01 +0800 Subject: [PATCH] Refactor: Update board and committee context Refactored the landing page view to provide board members as a static list instead of querying the Volunteer model. Also renamed 'commitees' to 'committees' for consistency and updated the template context accordingly. This improves maintainability and fixes template variable mismatches. --- landing/templates/landing/our_team.html | 183 +++------------------- landing/templates/landing/why_python.html | 2 +- landing/views.py | 68 ++++++-- 3 files changed, 84 insertions(+), 169 deletions(-) diff --git a/landing/templates/landing/our_team.html b/landing/templates/landing/our_team.html index 565116d..8e625ef 100644 --- a/landing/templates/landing/our_team.html +++ b/landing/templates/landing/our_team.html @@ -1,4 +1,4 @@ -{% load static from staticfiles %} + {% load static %}
+ + {% for member in board_members %}
@@ -77,148 +79,15 @@ class="w-full h-full object-cover rounded-13 md:rounded-24 cursor-pointer max-w-144 max-h-144" data-bs-toggle="tooltip" data-bs-html="true" - title="
Micaela Reyes
Director of Operations
" - src="{% static "landing/assets/img/people/micaela.jpg" %}" - data-aos="py-slide" - /> -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
+ {% endfor %} +

- {% for commitee in commitees %} -
-

- {{ commitee.name }} -

-
    - {% for volunteer in commitee.volunteers.all %} -
  • {{ volunteer.display_name }}
  • - {% endfor %} -
-
+ {% for committee in committees %} +
+

+ {{ committee.name }} +

+
    + {% for volunteer in commitee.volunteers.all %} +
  • {{ volunteer.display_name }}
  • + {% endfor %} +
+
{% endfor %}
diff --git a/landing/templates/landing/why_python.html b/landing/templates/landing/why_python.html index 36d455c..57fb1f4 100644 --- a/landing/templates/landing/why_python.html +++ b/landing/templates/landing/why_python.html @@ -4,7 +4,7 @@

Why Python?

-
+

We believe Python changes lives.

diff --git a/landing/views.py b/landing/views.py index ae41cde..a60965c 100644 --- a/landing/views.py +++ b/landing/views.py @@ -1,14 +1,9 @@ from django.shortcuts import render - -from .models import Event, Section -from organisation.models import Volunteer, Commitee +from organisation.models import Commitee def index(request): - events = Event.available_objects.all() - sections = Section.available_objects.all() - board_members = Volunteer.available_objects.filter(is_staff=True) - commitees = Commitee.available_objects.prefetch_related('volunteers') + committees = Commitee.available_objects.prefetch_related('volunteers') python_hour = [ { "link": "#", @@ -39,10 +34,61 @@ def index(request): } ] + board_members = [ + { + "name": "Matt Lebrun", + "position": "President", + "image": "landing/assets/img/people/matt.jpg", + }, + { + "name": "Micaela Reyes", + "position": "Director of Operations", + "image": "landing/assets/img/people/micaela.jpg", + }, + { + "name": "Sony Valdez", + "position": "Director of Community Relations", + "image": "landing/assets/img/people/shuny.jpg", + }, + { + "name": "Angelica Lapastora", + "position": "Director of Sponsorship", + "image": "landing/assets/img/people/anj.jpg", + }, + { + "name": "Zorex Salvo", + "position": "Director of Engineering", + "image": "landing/assets/img/people/zorex.jpg", + }, + { + "name": "Ciara Bautista", + "position": "Treasurer", + "image": "landing/assets/img/people/ciara.jpg", + }, + { + "name": "Freilla Mae Espinola", + "position": "Director of Diversity and Outreach", + "image": "landing/assets/img/people/freilla.png", + }, + { + "name": "Rodney Lei Estrada", + "position": "Board of Trustee and Corporate Secretary", + "image": "landing/assets/img/people/rodney.jpg", + }, + { + "name": "Lalaine Diok", + "position": "Director of Marketing", + "image": "landing/assets/img/people/lalaine.jpg", + }, + { + "name": "Alex Reyes", + "position": "Director of Design", + "image": "landing/assets/img/people/alex.jpg", + }, + ] + return render(request, 'landing/index.html', { - 'events': events, - 'sections': sections, - 'board_members': board_members, - 'commitees': commitees, + 'committees': committees, 'python_hour': python_hour, + 'board_members': board_members })