From 4b292536ff2e63c7fed5e809044a1c98518e164e Mon Sep 17 00:00:00 2001 From: Kenan Wright Date: Thu, 20 Feb 2025 11:00:43 +0000 Subject: [PATCH 1/5] Add modal that askes user to confirm commitment on registration --- .../templates/hackathon/hackathon_view.html | 542 +++++++++--------- 1 file changed, 279 insertions(+), 263 deletions(-) diff --git a/hackathon/templates/hackathon/hackathon_view.html b/hackathon/templates/hackathon/hackathon_view.html index 7fa1418..c66da11 100644 --- a/hackathon/templates/hackathon/hackathon_view.html +++ b/hackathon/templates/hackathon/hackathon_view.html @@ -9,292 +9,308 @@ {% block content %} - -
-
- -
-
-
- {% with authorised_types='FACILITATOR_ADMIN,PARTNER_ADMIN' %} - {% if hackathon.hackathon_image %} - - {% else %} - - {% endif %} - {% if request.user.user_type|is_type:"SUPERUSER" %} - - {% elif hackathon.created_by == request.user and request.user.user_type|is_types:authorised_types %} - - {% endif %} - {% endwith %} -
+
+
+
+
+
+ {% with authorised_types='FACILITATOR_ADMIN,PARTNER_ADMIN' %} + {% if hackathon.hackathon_image %} + + {% else %} + + {% endif %} + {% if request.user.user_type|is_type:"SUPERUSER" %} + + {% elif hackathon.created_by == request.user and request.user.user_type|is_types:authorised_types %} + + {% endif %} + {% endwith %}
+
- {% with authorised_types='SUPERUSER,STAFF,FACILITATOR_ADMIN,FACILITATOR_JUDGE,PARTNER_ADMIN,PARTNER_JUDGE' %} - -
-
- {% if request.user.user_type|is_types:authorised_types %} - -
-
- -
-
-

Theme: {{ hackathon.theme }}

- {% if request.user.user_type|is_types:authorised_types %} -

Status: {{ hackathon.status }}

-

Organiser: {{ hackathon.organiser }}

-

- Participants: {{ hackathon.participants.all|length }} / Teams: {{ hackathon.teams.all|length }}

-

-

- Max Participants: {% if hackathon.max_participants %}{{ hackathon.max_participants }}{% else %}Unlimited{% endif %} - {% if hackathon.max_participants_reached %}(Max Reached){% endif %} -

- {% else %} -

Status: - {{hackathon.status|prettify_status:hackathon.max_participants_reached}}

- {% endif %} -

Start: {{ hackathon.start_date }}

-

End: {{ hackathon.end_date }}

- -

Organisation: {{ hackathon.organisation }}

- {% if hackathon.badge_url %} -

hackathon badge

- {% else %} -

hackathon badge

- {% endif %} -
+
+
+
+
+

Theme: {{ hackathon.theme }}

+ {% if request.user.user_type|is_types:authorised_types %} +

Status: {{ hackathon.status }}

+

Organiser: {{ hackathon.organiser }}

+

+ Participants: {{ hackathon.participants.all|length }} / Teams: {{ hackathon.teams.all|length }} +

+

+ Max Participants: {% if hackathon.max_participants %}{{ hackathon.max_participants }}{% else %}Unlimited{% endif %} + {% if hackathon.max_participants_reached %}(Max Reached){% endif %} +

+ {% else %} +

Status: {{hackathon.status|prettify_status:hackathon.max_participants_reached}}

+ {% endif %} +

Start: {{ hackathon.start_date }}

+

End: {{ hackathon.end_date }}

+

Organisation: {{ hackathon.organisation }}

+ {% if hackathon.badge_url %} +

hackathon badge

+ {% else %} +

hackathon badge

+ {% endif %}
-
- + {% endwith %}
-
-

{{ hackathon.display_name }} #{{ hackathon.id }}

-
-
- {{ hackathon.description|safe|linebreaks }} -
+
+
+

{{ hackathon.display_name }} #{{ hackathon.id }}

+
+
+ {{ hackathon.description|safe|linebreaks }}
- - {% if hackathon.events.first %} -
-
-
- - -
+
+ + {% if hackathon.events.first %} +
+
+
+ +
- {% endif %} -

Teams:

- - {% if request.user.user_type|is_types:authorised_types or hackathon.status in 'hack_in_progress, judging, finished' %} -
- {% if teams %} - {% for team in teams %} -
-
-
- -
-

Team members:

- {% for participant in team.participants.get_queryset %} -

- - {{ participant.slack_display_name }} -

- {% endfor %} -
- - {% if user in hackathon.participants.all %} - {% if user in team.participants.get_queryset %} -
- {% if hackathon.status == 'hack_in_progress' %} - Edit Project - {% endif %} -
- {% endif %} - {% elif user in hackathon.judges.all %} - {% if hackathon.status == 'hack_in_progress' or hackathon.status == 'judging' %} -
- Edit Scores -

{% if not team.project %}No project submitted yet.{% endif %}

-
- {% endif %} +
+ {% endif %} +

Teams:

+ {% if request.user.user_type|is_types:authorised_types or hackathon.status in 'hack_in_progress, judging, finished' %} +
+ {% if teams %} + {% for team in teams %} +
+
+
+ +
+

Team members:

+ {% for participant in team.participants.get_queryset %} +

+ + {{ participant.slack_display_name }} +

+ {% endfor %} +
+ + {% if user in hackathon.participants.all %} + {% if user in team.participants.get_queryset %} +
+ {% if hackathon.status == 'hack_in_progress' %} + Edit Project {% endif %}
+ {% endif %} + {% elif user in hackathon.judges.all %} + {% if hackathon.status == 'hack_in_progress' or hackathon.status == 'judging' %} +
+ Edit Scores +

{% if not team.project %}No project submitted yet.{% endif %}

+
+ {% endif %} + {% endif %}
- {% endfor %} - {% else %} -
-

Teams have not been distributed yet.

-
- {% endif %} -
- -
-
- {% include 'hackathon/includes/paginator.html' with page_obj=teams %} -
+ {% endfor %} {% else %} -
-
-

Teams have not been distributed yet.

-
+
+

Teams have not been distributed yet.

{% endif %} -
-
- - - + - - {% endwith %} - {% include 'upload_image.html' %} - {% include 'hackathon/includes/change_status.html' %} -{% endblock %} + }); + + +{% include 'upload_image.html' %} +{% include 'hackathon/includes/change_status.html' %} +{% endblock %} \ No newline at end of file From 204cb43a069823d18833fa02b14c2388f80b62f8 Mon Sep 17 00:00:00 2001 From: Kenan Wright Date: Thu, 20 Feb 2025 11:14:02 +0000 Subject: [PATCH 2/5] Add confirmation modal on enroll --- hackathon/templates/hackathon/hackathon_view.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hackathon/templates/hackathon/hackathon_view.html b/hackathon/templates/hackathon/hackathon_view.html index c66da11..ad39068 100644 --- a/hackathon/templates/hackathon/hackathon_view.html +++ b/hackathon/templates/hackathon/hackathon_view.html @@ -103,7 +103,7 @@