From 4eb440c7f501581c3ed2ecfa229fbb0c93d8c058 Mon Sep 17 00:00:00 2001 From: Zorex Salvo Date: Mon, 15 Sep 2025 09:58:49 +0800 Subject: [PATCH 1/2] Restructure landing page and remove sortable2 - Refactored landing page templates for better structure and maintainability. - Moved gallery and navbar into header includes. - Removed dependency on django-admin-sortable2: - Uninstalled package and removed from requirements.txt. - Removed from INSTALLED_APPS and admin usage. - Updated Dockerfile to use latest Python 3.8 and Node.js 22.x. - Improved Docker build reliability by updating apt install steps. --- Dockerfile | 15 ++- landing/admin.py | 3 +- landing/templates/landing/header.html | 28 +++++ .../landing/{ => header}/gallery1.html | 0 landing/templates/landing/header/navbar.html | 20 +++ landing/templates/landing/index.html | 117 +++--------------- pythonph/settings.py | 1 - requirements.txt | 1 - 8 files changed, 73 insertions(+), 112 deletions(-) create mode 100644 landing/templates/landing/header.html rename landing/templates/landing/{ => header}/gallery1.html (100%) create mode 100644 landing/templates/landing/header/navbar.html diff --git a/Dockerfile b/Dockerfile index 413a5f9..94f3258 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,17 @@ -FROM python:3.8.1 +FROM python:3.8.18 -RUN apt-get -y update -RUN apt-get -y upgrade -RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - -RUN apt-get -y install nodejs -RUN apt-get -y install libcairo-dev +# Install dependencies for node +RUN apt-get update && \ + apt-get install -y curl ca-certificates && \ + curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ + apt-get install -y nodejs && \ + node --version && npm --version +RUN apt-get -y install libcairo-dev RUN mkdir -p /usr/src/app COPY package.json /usr/src/app/ +RUN npm --version RUN npm install --prefix /usr/src/app/ COPY requirements.txt /usr/src/app diff --git a/landing/admin.py b/landing/admin.py index 7db14e9..006b70e 100644 --- a/landing/admin.py +++ b/landing/admin.py @@ -1,4 +1,3 @@ -from adminsortable2.admin import SortableAdminMixin from django.contrib import admin from django.utils.encoding import force_text @@ -42,7 +41,7 @@ def get_queryset(self, request): @admin.register(Section) -class SectionAdmin(SortableAdminMixin, admin.ModelAdmin): +class SectionAdmin(admin.ModelAdmin): search_fields = ('name',) list_filter = (IsArchivedListFilter,) diff --git a/landing/templates/landing/header.html b/landing/templates/landing/header.html new file mode 100644 index 0000000..58bb8ce --- /dev/null +++ b/landing/templates/landing/header.html @@ -0,0 +1,28 @@ +{% load static %} + +
+ + {% include "landing/header/navbar.html" %} +
+
+
+
+ +
+

+ Python + Philippines +

+
+

+ PythonPH is a non-stock, non-profit, volunteer-run + organization dedicated to support and facilitate the + growth of the community of Python programmers in the + Philippines. +

+
+ + {% include "landing/header/gallery1.html" %} +
+
+ diff --git a/landing/templates/landing/gallery1.html b/landing/templates/landing/header/gallery1.html similarity index 100% rename from landing/templates/landing/gallery1.html rename to landing/templates/landing/header/gallery1.html diff --git a/landing/templates/landing/header/navbar.html b/landing/templates/landing/header/navbar.html new file mode 100644 index 0000000..d82791f --- /dev/null +++ b/landing/templates/landing/header/navbar.html @@ -0,0 +1,20 @@ +{% load static %} + + diff --git a/landing/templates/landing/index.html b/landing/templates/landing/index.html index 2db8dcb..7f4c566 100644 --- a/landing/templates/landing/index.html +++ b/landing/templates/landing/index.html @@ -3,110 +3,23 @@ - - - - - Python Philippines - - - + + + + + Python Philippines + + + - - + + - - -
- -
-
-
-
- -
-

- Python - Philippines -

-
-

- PythonPH is a non-stock, non-profit, volunteer-run - organization dedicated to support and facilitate the - growth of the community of Python programmers in the - Philippines. -

- - -
- - {% include "landing/gallery1.html" %} -
-
+ + {% include "landing/header.html" %}
Date: Mon, 15 Sep 2025 10:39:33 +0800 Subject: [PATCH 2/2] Refactor: Improve why_python section readability Enhanced the "Why Python?" section for better clarity and readability. Updated the messaging to more effectively communicate the impact of Python and the community's mission. No structural changes made to the template. --- .pre-commit-config.yaml | 11 + landing/templates/landing/footer.html | 36 ++ .../templates/landing/header/gallery1.html | 2 +- .../{header.html => header/index.html} | 1 - landing/templates/landing/index.html | 600 +----------------- landing/templates/landing/old_index.html | 81 --- landing/templates/landing/our_aim.html | 56 ++ .../templates/landing/what_we_do/index.html | 155 +++++ landing/templates/landing/why_python.html | 27 + 9 files changed, 308 insertions(+), 661 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 landing/templates/landing/footer.html rename landing/templates/landing/{header.html => header/index.html} (99%) delete mode 100644 landing/templates/landing/old_index.html create mode 100644 landing/templates/landing/our_aim.html create mode 100644 landing/templates/landing/what_we_do/index.html create mode 100644 landing/templates/landing/why_python.html diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..78ec9b2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: + - repo: git@github.com:astral-sh/ruff-pre-commit + rev: v0.4.4 + hooks: + - id: ruff + + - repo: git@github.com:pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/landing/templates/landing/footer.html b/landing/templates/landing/footer.html new file mode 100644 index 0000000..bec635e --- /dev/null +++ b/landing/templates/landing/footer.html @@ -0,0 +1,36 @@ +{% load static %} + + diff --git a/landing/templates/landing/header/gallery1.html b/landing/templates/landing/header/gallery1.html index 561acbe..f35fdd2 100644 --- a/landing/templates/landing/header/gallery1.html +++ b/landing/templates/landing/header/gallery1.html @@ -1,4 +1,4 @@ -{% load static from staticfiles %} +{% load static %}
    - diff --git a/landing/templates/landing/index.html b/landing/templates/landing/index.html index 7f4c566..9d2baf2 100644 --- a/landing/templates/landing/index.html +++ b/landing/templates/landing/index.html @@ -6,10 +6,7 @@ - + Python Philippines @@ -18,587 +15,34 @@ - - {% include "landing/header.html" %} + + + {% include "landing/header/index.html" %} - -
    -
    - -
    -
    -
    -

    - Our Aim -

    -
      -
    • - To show that Python has something for - everyone: from hobbyists, to educators, - to students, to professionals. -
    • -
    • - To inspire Filipinos to excel in their craft - through Python and Open Source. -
    • -
    • - To provide a safe space where the Python - programming language and surrounding - technologies can be explored, discussed and - exercised. -
    • -
    -
    + + {% include "landing/why_python.html" %} -

    - We believe that we create small dents of improvement - in the PH Tech industry when we foster environments - that inspire and motivate individuals to be technically competent - and passionate about their craft. -

    - - Get to know us - -
    -
    -
    -
    + + {% include "landing/what_we_do/index.html" %} -
    -
    -
    -

    - Why Python? -

    -
    -

    - We truly believe and support the impact and innovation that Python has - brought in the whole technology industry as it continues to power systems, products, and services of companies such - as Google, YouTube, NASA, Disney, Instagram, Disqus, Pinterest and Bitbucket. -

    -

    - Python is also used as a business solution for Web Development, Automation, Monitoring, - Artificial Intelligence, Data Science, Cloud Computing, and more. -

    -
    -
    -
    -
    + + {% include "landing/our_team.html" %} - -
    -
    -
    -

    - What We Do -

    -
    -

    - In June 31-July 1 2012, we held the first - ever PyCon Philippines. -

    -

    - Today, we organize the yearly PyCon and also - hold regular meet-ups, public python trainings and - kaizend throughout the year. -

    -

    - Whether you're new to programming, an experienced - practitioner, or just plain curious what this Python - programming language is about, you're much welcome - to join this community! -

    -
    -
    -
    -
    -

    - Our Events -

    -
    + + {% include "landing/code_of_conduct.html" %} -
    -
    -
    -

    - -

    -
    - -
    -
    -

    - The goal of the conference is to provide - a venue where the Python programming - language and surrounding technologies - can be explored, discussed and - exercised. -

    -

    - We gather software engineers, - programming enthusiasts, startup - founders, corporate IT decision makers, - students and IT educators in a 2-day - event where we can collaborate and learn - from each other. -

    -
    -
    -
    -
    -
    -

    - -

    -
    - -
    -
    -

    - Regular meetups where professionals and - enthusiasts share and talk about Python. -

    -
    -
    -
    -
    -
    -

    - -

    -
    - -
    -
    -

    - Low-cost Python Trainings covering - various topics. -

    -
    -
    -
    -
    -
    -

    - -

    -
    -
    -
    -

    - A mastermind group and exclusive - training program for core volunteers. - This program is aimed to develop - technically competent leaders and - systematize succession plans for - PythonPH. -

    -
    -
    -
    -
    - -
    - -
    - -
    - - - -
    - -
    -
    - - - {% include "landing/our_team.html" %} - - - {% include "landing/code_of_conduct.html" %} - - + {% include "landing/mailing_list.html" %} - - - - - -
+ + {% include "landing/footer.html" %} - + + + + + diff --git a/landing/templates/landing/old_index.html b/landing/templates/landing/old_index.html deleted file mode 100644 index ce6ffb3..0000000 --- a/landing/templates/landing/old_index.html +++ /dev/null @@ -1,81 +0,0 @@ -{% load static from staticfiles %} -{% load compress %} - - - - - - - - - Python Philippines - - - - - - {% compress css %} - - {% endcompress %} - - - -
-
-
-
- -
-

- Python - Philippines -

-
- -
- - {% if sections %} - {% for section in sections %} -
-

{{ section.name }}

- {{ section.content|safe }} -
- {% endfor %} - {% endif %} - - {% if events %} -
-

Public Trainings

- -
- {% endif %} - - {% include "landing/team.html" %} - -
-
- - - diff --git a/landing/templates/landing/our_aim.html b/landing/templates/landing/our_aim.html new file mode 100644 index 0000000..b457250 --- /dev/null +++ b/landing/templates/landing/our_aim.html @@ -0,0 +1,56 @@ +{% load static %} + +
+
+ +
+
+
+

+ Our Aim +

+
    +
  • + To show that Python has something for everyone: from hobbyists, to educators, to students, to professionals. +
  • +
  • + To inspire Filipinos to excel in their craft through Python and Open Source. +
  • +
  • + To provide a safe space where the Python programming language and surrounding technologies can be explored, discussed and exercised. +
  • +
+
+

+ We believe that we create small dents of improvement in the PH Tech industry when we foster environments that inspire and motivate individuals to be technically competent and passionate about their craft. +

+ + Get to know us + +
+
+
+
diff --git a/landing/templates/landing/what_we_do/index.html b/landing/templates/landing/what_we_do/index.html new file mode 100644 index 0000000..6fd8241 --- /dev/null +++ b/landing/templates/landing/what_we_do/index.html @@ -0,0 +1,155 @@ +{% load static %} +
+
+
+

+ What We Do +

+
+

+ In June 31-July 1 2012, we held the first ever PyCon Philippines. +

+

+ Today, we organize the yearly PyCon and also hold regular meet-ups, public python trainings and kaizend throughout the year. +

+

+ Whether you're new to programming, an experienced practitioner, or just plain curious what this Python programming language is about, you're much welcome to join this community! +

+
+
+ + +
+
+

+ Our Events +

+
+ + +
+
+
+

+ +

+
+
+
+

+ The goal of the conference is to provide a venue where the Python programming language and surrounding technologies can be explored, discussed and exercised. +

+

+ We gather software engineers, programming enthusiasts, startup founders, corporate IT decision makers, students and IT educators in a 2-day event where we can collaborate and learn from each other. +

+
+
+
+
+
+

+ +

+
+
+
+

+ Regular meetups where professionals and enthusiasts share and talk about Python. +

+
+
+
+
+
+

+ +

+
+
+
+

+ Low-cost Python Trainings covering various topics. +

+
+
+
+
+
+

+ +

+
+
+
+

+ A mastermind group and exclusive training program for core volunteers. This program is aimed to develop technically competent leaders and systematize succession plans for PythonPH. +

+
+
+
+
+ + + +
+ + +
+ +
+ +
+
+
diff --git a/landing/templates/landing/why_python.html b/landing/templates/landing/why_python.html new file mode 100644 index 0000000..36d455c --- /dev/null +++ b/landing/templates/landing/why_python.html @@ -0,0 +1,27 @@ +
+
+
+

+ Why Python? +

+
+

+ We believe Python changes lives. +

+ +

+ It gives everyday people the tools to create, solve problems, and share ideas with the world—while also powering industries from AI and data science to cloud computing and automation. +

+ +

+ From students building their first websites, to small teams streamlining workflows, to researchers and companies tackling big challenges—Python is there. +

+ +

+ Simple enough to start with, powerful enough to shape the future. + And at PythonPH, we see it every day in our community: people learning, teaching, and creating together. That’s the heart of why we do what we do. +

+
+
+
+