From b5e69a9da6bf2d9c5de4d216e2e623215e733df2 Mon Sep 17 00:00:00 2001 From: David Slusser Date: Tue, 29 Jul 2025 12:43:30 -0700 Subject: [PATCH 1/3] using partials for forms --- src/django_project/web/forms.py | 12 +- .../web/templates/web/full/index.html | 121 +----------------- .../web/partials/presentation_request.htm | 54 ++++++++ .../web/partials/topic_suggestion.htm | 48 +++++++ src/django_project/web/urls/gui.py | 18 ++- src/django_project/web/views/gui.py | 22 ++-- 6 files changed, 145 insertions(+), 130 deletions(-) create mode 100644 src/django_project/web/templates/web/partials/presentation_request.htm create mode 100644 src/django_project/web/templates/web/partials/topic_suggestion.htm diff --git a/src/django_project/web/forms.py b/src/django_project/web/forms.py index 3850e67..d8aca6c 100644 --- a/src/django_project/web/forms.py +++ b/src/django_project/web/forms.py @@ -7,7 +7,11 @@ class PresentationRequestForm(HtmxModelForm): hx_post: str = "/presentation_request" hx_target: str = "presentation-request-form" submit_button_text: str = "submit" - success_message: str = "presentation request submitted; thanks!" + success_message: str = """Presentation request received; thanks!
reset form
""" class Meta: model = PresentationRequest @@ -26,7 +30,11 @@ class TopicSuggestionForm(HtmxModelForm): hx_post: str = "/topic_suggestion" hx_target: str = "topic-suggestion-form" submit_button_text: str = "submit" - success_message: str = "topic suggestion submitted; thanks!" + success_message: str = """Topic suggestion received; thanks!
reset form
""" class Meta: model = TopicSuggestion diff --git a/src/django_project/web/templates/web/full/index.html b/src/django_project/web/templates/web/full/index.html index 5da45be..ee5312f 100644 --- a/src/django_project/web/templates/web/full/index.html +++ b/src/django_project/web/templates/web/full/index.html @@ -348,122 +348,14 @@
Get Involved

Help shape our community by suggesting topics or volunteering to present

-
-
-
-
-
- Suggest a Topic -
-
- {% csrf_token %} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
- -
-
-
-
-
- -
-
-
-
- Volunteer to Present -
-
- {% csrf_token %} -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
- -
-
-
-
-
+
+
- @@ -589,7 +481,6 @@
Community Guidelines
-