From cd5e58fa59eeb220beaa374301f79e4779795547 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 11 Jan 2024 14:25:14 -0500 Subject: [PATCH] Start admin site rewrite aaaaaa --- goathacks/admin/__init__.py | 10 + goathacks/templates/admin.html | 281 +--------------------------- goathacks/templates/admin_base.html | 24 +++ goathacks/templates/admin_old.html | 280 +++++++++++++++++++++++++++ goathacks/templates/base.html | 3 +- goathacks/templates/dashboard.html | 25 ++- goathacks/templates/footer.html | 3 +- goathacks/templates/header.html | 19 +- goathacks/templates/login.html | 4 +- goathacks/templates/register.html | 6 +- 10 files changed, 345 insertions(+), 310 deletions(-) create mode 100644 goathacks/templates/admin_base.html create mode 100644 goathacks/templates/admin_old.html diff --git a/goathacks/admin/__init__.py b/goathacks/admin/__init__.py index 4536cf2..3d2eeba 100644 --- a/goathacks/admin/__init__.py +++ b/goathacks/admin/__init__.py @@ -65,6 +65,16 @@ def mail(): return render_template("mail.html", NUM_HACKERS=total_count) +@bp.route("/users") +@login_required +def users(): + if not current_user.is_admin: + return redirect(url_for("dashboard.home")) + + users = User.query.all() + + return render_template("users.html", users=users) + @bp.route("/send", methods=["POST"]) @login_required def send(): diff --git a/goathacks/templates/admin.html b/goathacks/templates/admin.html index bb83a9c..8891a57 100644 --- a/goathacks/templates/admin.html +++ b/goathacks/templates/admin.html @@ -1,280 +1 @@ - - - - - Hack @ WPI - - - - - - - - - - - - - - - - - -
-
-
-
JSON object of users from MLH (Including dropped applications):
-

Do NOT share this URL.

-
Get registered hackers only:
-

JSON CSV

-
-
-
-

Gender:

- - -
-
-

Schools:

- - -
-
-

Majors:

- - -
-
-
-

Counts:

- - - - - - - - - - - - - - - - - -
TotalAttendeesWaitlistChecked In
{{ total_count }}{{ (total_count - waitlist_count) }}{{ waitlist_count }}{{ check_in_count }}
- -

Shirts:

- - - - - - - - - - - - - - - - - - - - - - - -
XXSXSSMLXLXXL
{{ shirt_count['XXS'] }}{{ shirt_count['XS'] }}{{ shirt_count['S'] }}{{ shirt_count['M'] }}{{ shirt_count['L'] }}{{ shirt_count['XL'] }}{{ shirt_count['XXL'] }}
- -

Hackers:

- - - - - - - - - - - - - - - - - - - {% for hacker in hackers %} - - - - - - - - - - - - - - - {% endfor %} - -
OptionsChecked In?Waitlisted?AdminMLH IDTime RegisteredEmailNamePhoneShirtSpecialSchool
-
- - -
-
{{ hacker['checked_in'] }}{{ hacker['waitlisted'] }}{{ hacker.is_admin }}{{ hacker['id'] }}{{ hacker['last_login'] }}{{ hacker['email'] }}{{ hacker['first_name'] + ' ' + hacker['last_name'] }}{{ hacker['phone'] }}{{ hacker['shirt_size'] }}{{ hacker['accomodations'] }}{{ hacker['school'] }}
-
-
-
- - - - - - +{% extends 'admin_base.html' %} diff --git a/goathacks/templates/admin_base.html b/goathacks/templates/admin_base.html new file mode 100644 index 0000000..4aadb02 --- /dev/null +++ b/goathacks/templates/admin_base.html @@ -0,0 +1,24 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +{% block admin_content %} +
+ I'm still being worked on! +
+{% endblock admin_content %} +
+{% endblock %} diff --git a/goathacks/templates/admin_old.html b/goathacks/templates/admin_old.html new file mode 100644 index 0000000..bb83a9c --- /dev/null +++ b/goathacks/templates/admin_old.html @@ -0,0 +1,280 @@ + + + + + Hack @ WPI + + + + + + + + + + + + + + + + + +
+
+
+
JSON object of users from MLH (Including dropped applications):
+

Do NOT share this URL.

+
Get registered hackers only:
+

JSON CSV

+
+
+
+

Gender:

+ + +
+
+

Schools:

+ + +
+
+

Majors:

+ + +
+
+
+

Counts:

+ + + + + + + + + + + + + + + + + +
TotalAttendeesWaitlistChecked In
{{ total_count }}{{ (total_count - waitlist_count) }}{{ waitlist_count }}{{ check_in_count }}
+ +

Shirts:

+ + + + + + + + + + + + + + + + + + + + + + + +
XXSXSSMLXLXXL
{{ shirt_count['XXS'] }}{{ shirt_count['XS'] }}{{ shirt_count['S'] }}{{ shirt_count['M'] }}{{ shirt_count['L'] }}{{ shirt_count['XL'] }}{{ shirt_count['XXL'] }}
+ +

Hackers:

+ + + + + + + + + + + + + + + + + + + {% for hacker in hackers %} + + + + + + + + + + + + + + + {% endfor %} + +
OptionsChecked In?Waitlisted?AdminMLH IDTime RegisteredEmailNamePhoneShirtSpecialSchool
+
+ + +
+
{{ hacker['checked_in'] }}{{ hacker['waitlisted'] }}{{ hacker.is_admin }}{{ hacker['id'] }}{{ hacker['last_login'] }}{{ hacker['email'] }}{{ hacker['first_name'] + ' ' + hacker['last_name'] }}{{ hacker['phone'] }}{{ hacker['shirt_size'] }}{{ hacker['accomodations'] }}{{ hacker['school'] }}
+
+
+
+ + + + + + diff --git a/goathacks/templates/base.html b/goathacks/templates/base.html index c556c8b..e86ee39 100644 --- a/goathacks/templates/base.html +++ b/goathacks/templates/base.html @@ -1,7 +1,8 @@ {% include 'header.html' %} {% from 'bootstrap5/utils.html' import render_messages %} -
+
{{ render_messages() }} {% block content %} diff --git a/goathacks/templates/dashboard.html b/goathacks/templates/dashboard.html index ccea485..6f199cc 100644 --- a/goathacks/templates/dashboard.html +++ b/goathacks/templates/dashboard.html @@ -22,21 +22,27 @@

Hi {{ current_user.first_name }}!


-
+
+
{% if current_user.waitlisted %}

You're currently waitlisted, keep checking your email to see if space opens up!

{% else %} +
+

Your registration is confirmed! We're looking forward to seeing you at GoatHacks!

- Let us know if you have any questions by sending them to hack@wpi.edu +
+
+

Let us know if you have any questions + by sending them to hack@wpi.edu


Make sure you join the Discord and add your shirt size as well as any needed accomodations below

+ - {% endif %}