From d5350aa4cb850d1e938d092dd86d9b564bfd30dd Mon Sep 17 00:00:00 2001 From: Jonny Ervine Date: Mon, 6 Oct 2025 23:32:53 +0800 Subject: [PATCH] Refactored pages --- motm_app/=21.0.0 | 3 + motm_app/PRODUCTION_DEPLOYMENT.md | 160 +++++++ motm_app/gunicorn.conf.py | 52 ++ motm_app/motm-app.service | 18 + motm_app/requirements.txt | 3 + motm_app/run_production.py | 12 + motm_app/start_production.sh | 26 + motm_app/templates/admin_dashboard.html | 497 +++++++++++--------- motm_app/templates/admin_dashboard_new.html | 280 +++++++++++ motm_app/templates/admin_dashboard_old.html | 219 +++++++++ motm_app/templates/base.html | 349 ++++++++++++++ motm_app/templates/error.html | 48 +- motm_app/templates/error_new.html | 35 ++ motm_app/templates/error_old.html | 19 + motm_app/templates/index.html | 334 ++++++++----- motm_app/templates/index_new.html | 237 ++++++++++ motm_app/templates/index_old.html | 117 +++++ motm_app/templates/match_comments.html | 99 ++-- motm_app/templates/match_comments_new.html | 76 +++ motm_app/templates/match_comments_old.html | 31 ++ motm_app/templates/motm_vote.html | 294 ++++++++---- motm_app/templates/motm_vote_new.html | 219 +++++++++ motm_app/templates/motm_vote_old.html | 83 ++++ motm_app/templates/s3_config.html | 53 +-- motm_app/templates/s3_status.html | 46 +- motm_app/templates/vote_thanks.html | 63 ++- motm_app/templates/vote_thanks_new.html | 44 ++ motm_app/templates/vote_thanks_old.html | 19 + 28 files changed, 2917 insertions(+), 519 deletions(-) create mode 100644 motm_app/=21.0.0 create mode 100644 motm_app/PRODUCTION_DEPLOYMENT.md create mode 100644 motm_app/gunicorn.conf.py create mode 100644 motm_app/motm-app.service create mode 100644 motm_app/run_production.py create mode 100755 motm_app/start_production.sh create mode 100644 motm_app/templates/admin_dashboard_new.html create mode 100644 motm_app/templates/admin_dashboard_old.html create mode 100644 motm_app/templates/base.html create mode 100644 motm_app/templates/error_new.html create mode 100644 motm_app/templates/error_old.html create mode 100644 motm_app/templates/index_new.html create mode 100644 motm_app/templates/index_old.html create mode 100644 motm_app/templates/match_comments_new.html create mode 100644 motm_app/templates/match_comments_old.html create mode 100644 motm_app/templates/motm_vote_new.html create mode 100644 motm_app/templates/motm_vote_old.html create mode 100644 motm_app/templates/vote_thanks_new.html create mode 100644 motm_app/templates/vote_thanks_old.html diff --git a/motm_app/=21.0.0 b/motm_app/=21.0.0 new file mode 100644 index 0000000..84a4bf6 --- /dev/null +++ b/motm_app/=21.0.0 @@ -0,0 +1,3 @@ +Defaulting to user installation because normal site-packages is not writeable +Requirement already satisfied: gunicorn in /home/jonny/.local/lib/python3.13/site-packages (21.2.0) +Requirement already satisfied: packaging in /usr/lib/python3.13/site-packages (from gunicorn) (24.2) diff --git a/motm_app/PRODUCTION_DEPLOYMENT.md b/motm_app/PRODUCTION_DEPLOYMENT.md new file mode 100644 index 0000000..b6675fe --- /dev/null +++ b/motm_app/PRODUCTION_DEPLOYMENT.md @@ -0,0 +1,160 @@ +# Production Deployment Guide + +## WSGI Server Setup + +Your Flask application now uses **Gunicorn** as the production WSGI server instead of the Flask development server. + +### Files Added: +- `gunicorn.conf.py` - Gunicorn configuration file +- `run_production.py` - WSGI entry point +- `start_production.sh` - Production startup script +- `motm-app.service` - Systemd service file (optional) + +## Quick Start (Recommended) + +### 1. Install Dependencies +```bash +pip install -r requirements.txt +``` + +### 2. Start Production Server +```bash +# Option A: Use the startup script (easiest) +./start_production.sh + +# Option B: Start manually +gunicorn -c gunicorn.conf.py run_production:app + +# Option C: Quick start with default settings +gunicorn --bind 0.0.0.0:5000 --workers 4 run_production:app +``` + +## Configuration Details + +### Gunicorn Configuration (`gunicorn.conf.py`) +- **Workers**: `CPU_COUNT * 2 + 1` (automatically calculated) +- **Worker Class**: `sync` (good for Flask applications) +- **Timeout**: 30 seconds +- **Max Requests**: 1000 per worker (prevents memory leaks) +- **Logging**: Standard output (can be redirected) +- **Preload**: Enabled for better performance + +### Environment Variables +- `FLASK_ENV=production` (automatically set) + +## Alternative WSGI Servers + +If you prefer different WSGI servers: + +### 1. uWSGI +```bash +pip install uwsgi +uwsgi --http 0.0.0.0:5000 --module run_production:app --processes 4 --threads 2 +``` + +### 2. Waitress (Windows-friendly) +```bash +pip install waitress +waitress-serve --host=0.0.0.0 --port=5000 run_production:app +``` + +### 3. Gevent (for async workloads) +```bash +pip install gunicorn[gevent] +gunicorn -c gunicorn.conf.py --worker-class gevent run_production:app +``` + +## Production Recommendations + +### 1. Use a Reverse Proxy +Place Nginx or Apache in front of Gunicorn: + +**Nginx Example:** +```nginx +server { + listen 80; + server_name your-domain.com; + + location / { + proxy_pass http://127.0.0.1:5000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} +``` + +### 2. SSL/HTTPS +For production, always use HTTPS: +- Use Let's Encrypt for free SSL certificates +- Configure SSL in your reverse proxy +- Update Gunicorn config with SSL settings if needed + +### 3. Process Management +Use systemd or supervisor to manage the Gunicorn process: + +**Systemd (Linux):** +```bash +sudo cp motm-app.service /etc/systemd/system/ +sudo systemctl enable motm-app +sudo systemctl start motm-app +sudo systemctl status motm-app +``` + +### 4. Monitoring +- Monitor worker processes and memory usage +- Set up log rotation +- Use tools like Prometheus + Grafana for metrics + +## Performance Tuning + +### Worker Count +- **CPU-bound**: `workers = CPU_COUNT * 2` +- **I/O-bound**: `workers = CPU_COUNT * 2 + 1` (current setting) +- **High concurrency**: Consider async workers (gevent/eventlet) + +### Memory Management +- Current: `max_requests = 1000` (restarts workers periodically) +- Adjust based on your memory constraints + +### Timeout Settings +- Current: `timeout = 30` seconds +- Increase if you have long-running requests + +## Troubleshooting + +### Common Issues: +1. **Permission denied**: Check file permissions and user/group settings +2. **Port already in use**: Change port in `gunicorn.conf.py` or kill existing process +3. **Memory issues**: Reduce worker count or increase `max_requests` +4. **Slow responses**: Increase timeout or worker count + +### Logs: +- Gunicorn logs to stdout/stderr by default +- Check systemd logs: `journalctl -u motm-app` +- Redirect logs to files if needed + +## Security Notes + +1. **Never run as root** in production +2. **Use HTTPS** for all production traffic +3. **Set proper file permissions** on your application files +4. **Keep dependencies updated** regularly +5. **Use environment variables** for sensitive configuration + +## Migration from Development + +Your application is now ready for production! The key changes: +- ✅ Gunicorn WSGI server instead of Flask dev server +- ✅ Production-optimized configuration +- ✅ Proper worker management +- ✅ Security improvements +- ✅ Performance optimizations + +**Next Steps:** +1. Test the production setup locally +2. Deploy to your production server +3. Set up reverse proxy (Nginx/Apache) +4. Configure SSL certificates +5. Set up monitoring and logging diff --git a/motm_app/gunicorn.conf.py b/motm_app/gunicorn.conf.py new file mode 100644 index 0000000..a286777 --- /dev/null +++ b/motm_app/gunicorn.conf.py @@ -0,0 +1,52 @@ +# Gunicorn configuration file for production deployment + +import multiprocessing +import os + +# Server socket +bind = "0.0.0.0:5000" +backlog = 2048 + +# Worker processes +workers = multiprocessing.cpu_count() * 2 + 1 +worker_class = "sync" +worker_connections = 1000 +timeout = 30 +keepalive = 2 + +# Restart workers after this many requests, to prevent memory leaks +max_requests = 1000 +max_requests_jitter = 50 + +# Logging +accesslog = "-" +errorlog = "-" +loglevel = "info" +access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(D)s' + +# Process naming +proc_name = "motm_app" + +# Server mechanics +daemon = False +pidfile = "/tmp/motm_app.pid" +user = None +group = None +tmp_upload_dir = None + +# SSL (uncomment and configure if using HTTPS) +# keyfile = "/path/to/keyfile" +# certfile = "/path/to/certfile" + +# Preload app for better performance +preload_app = True + +# Environment variables +raw_env = [ + 'FLASK_ENV=production', +] + +# Security +limit_request_line = 4094 +limit_request_fields = 100 +limit_request_field_size = 8190 diff --git a/motm_app/motm-app.service b/motm_app/motm-app.service new file mode 100644 index 0000000..a1aed22 --- /dev/null +++ b/motm_app/motm-app.service @@ -0,0 +1,18 @@ +[Unit] +Description=MOTM App - Man of the Match Voting System +After=network.target + +[Service] +Type=exec +User=www-data +Group=www-data +WorkingDirectory=/home/jonny/Projects/gcp-hockey-results/motm_app +Environment=PATH=/home/jonny/Projects/gcp-hockey-results/motm_app/venv/bin +Environment=FLASK_ENV=production +ExecStart=/home/jonny/Projects/gcp-hockey-results/motm_app/venv/bin/gunicorn -c gunicorn.conf.py run_production:app +ExecReload=/bin/kill -s HUP $MAINPID +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/motm_app/requirements.txt b/motm_app/requirements.txt index 2a7018c..83a137d 100644 --- a/motm_app/requirements.txt +++ b/motm_app/requirements.txt @@ -29,3 +29,6 @@ boto3>=1.34.0 # Legacy support (can be removed after migration) flask-mysql + +# Production WSGI server +gunicorn>=21.0.0 diff --git a/motm_app/run_production.py b/motm_app/run_production.py new file mode 100644 index 0000000..af02863 --- /dev/null +++ b/motm_app/run_production.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +""" +Production WSGI entry point for MOTM App +This file is used by Gunicorn to run the application in production +""" + +from main import app + +if __name__ == "__main__": + # This should not be called directly in production + # Use: gunicorn -c gunicorn.conf.py run_production:app + app.run(host='0.0.0.0', port=5000, debug=False) diff --git a/motm_app/start_production.sh b/motm_app/start_production.sh new file mode 100755 index 0000000..5ffd07b --- /dev/null +++ b/motm_app/start_production.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Production startup script for MOTM App + +echo "Starting MOTM App in production mode..." + +# Check if virtual environment exists +if [ ! -d "venv" ]; then + echo "Creating virtual environment..." + python3 -m venv venv +fi + +# Activate virtual environment +echo "Activating virtual environment..." +source venv/bin/activate + +# Install/upgrade dependencies +echo "Installing dependencies..." +pip install --upgrade pip +pip install -r requirements.txt + +# Set production environment +export FLASK_ENV=production + +# Start Gunicorn +echo "Starting Gunicorn WSGI server..." +gunicorn -c gunicorn.conf.py run_production:app diff --git a/motm_app/templates/admin_dashboard.html b/motm_app/templates/admin_dashboard.html index beb1a80..fad0f81 100644 --- a/motm_app/templates/admin_dashboard.html +++ b/motm_app/templates/admin_dashboard.html @@ -1,219 +1,280 @@ - - - - - - Admin Dashboard - HKFC Men's C Team MOTM System - - - - - - - -
- +{% extends "base.html" %} + +{% block title %}Admin Dashboard - HKFC Men's C Team MOTM System{% endblock %} + +{% block content %} + +
+
+
+
+

+ + Admin Dashboard +

+

Central hub for all administrative functions

+
- - +
+
+ + + + + +
+
+
+
+
+ Data Management +
+
+
+
+
+
+
+
+ Club Management +
+
+
+

Manage hockey clubs, logos, and club information.

+ +
+
+
+ +
+
+
+
+ Player Management +
+
+
+

Add, edit, and manage player information and squads.

+ +
+
+
+ +
+
+
+
+ Team Management +
+
+
+

Manage hockey teams and their associations with clubs.

+ +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+ System Management +
+
+
+
+
+
+
+
+ S3 Storage +
+
+
+

Configure and manage S3 storage for assets and logos.

+ +
+
+
+ +
+
+
+
+ Database +
+
+
+

Manage database configuration and status.

+ +
+
+
+ +
+
+
+
+ Squad Management +
+
+
+

Manage match squads and player selections.

+ +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+ System Status +
+
+
+
+
+
+ +
+
Database
+ + Online + +
+
+
+ +
+
S3 Storage
+ + Configured + +
+
+
+ +
+
Active Users
+ 1 +
+
+
+ +
+
Next Match
+ Pending +
+
+
+
+
+
+{% endblock %} diff --git a/motm_app/templates/admin_dashboard_new.html b/motm_app/templates/admin_dashboard_new.html new file mode 100644 index 0000000..fad0f81 --- /dev/null +++ b/motm_app/templates/admin_dashboard_new.html @@ -0,0 +1,280 @@ +{% extends "base.html" %} + +{% block title %}Admin Dashboard - HKFC Men's C Team MOTM System{% endblock %} + +{% block content %} + +
+
+
+
+

+ + Admin Dashboard +

+

Central hub for all administrative functions

+
+
+
+
+ + + + + +
+
+
+
+
+ Data Management +
+
+
+
+
+
+
+
+ Club Management +
+
+
+

Manage hockey clubs, logos, and club information.

+ +
+
+
+ +
+
+
+
+ Player Management +
+
+
+

Add, edit, and manage player information and squads.

+ +
+
+
+ +
+
+
+
+ Team Management +
+
+
+

Manage hockey teams and their associations with clubs.

+ +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+ System Management +
+
+
+
+
+
+
+
+ S3 Storage +
+
+
+

Configure and manage S3 storage for assets and logos.

+ +
+
+
+ +
+
+
+
+ Database +
+
+
+

Manage database configuration and status.

+ +
+
+
+ +
+
+
+
+ Squad Management +
+
+
+

Manage match squads and player selections.

+ +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+ System Status +
+
+
+
+
+
+ +
+
Database
+ + Online + +
+
+
+ +
+
S3 Storage
+ + Configured + +
+
+
+ +
+
Active Users
+ 1 +
+
+
+ +
+
Next Match
+ Pending +
+
+
+
+
+
+{% endblock %} diff --git a/motm_app/templates/admin_dashboard_old.html b/motm_app/templates/admin_dashboard_old.html new file mode 100644 index 0000000..beb1a80 --- /dev/null +++ b/motm_app/templates/admin_dashboard_old.html @@ -0,0 +1,219 @@ + + + + + + Admin Dashboard - HKFC Men's C Team MOTM System + + + + + + + + + + diff --git a/motm_app/templates/base.html b/motm_app/templates/base.html new file mode 100644 index 0000000..7207d95 --- /dev/null +++ b/motm_app/templates/base.html @@ -0,0 +1,349 @@ + + + + + + {% block title %}HKFC Men's C Team - MOTM System{% endblock %} + + + + + + + + + {% block extra_head %}{% endblock %} + + + + + + + {% if page_title or page_subtitle %} + + {% endif %} + + +
+ + {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
+
+ {% for category, message in messages %} + + {% endfor %} +
+
+ {% endif %} + {% endwith %} + + + {% block content %}{% endblock %} +
+ + +
+
+
+
+
HKFC Men's C Team MOTM System
+

Man of the Match and Dick of the Day voting system

+
+
+

+ + {% if current_year %}{{ current_year }}{% else %}2024{% endif %} +

+
+
+
+
+ + + + + + + + + + {% block extra_scripts %}{% endblock %} + + diff --git a/motm_app/templates/error.html b/motm_app/templates/error.html index 14eb924..a5e112e 100644 --- a/motm_app/templates/error.html +++ b/motm_app/templates/error.html @@ -1,19 +1,35 @@ - - - Error - Invalid URL - - - - - -
-
-
-

Error

-

{{ message or "Invalid voting URL. Please check the link and try again." }}

- Home +{% extends "base.html" %} + +{% block title %}Error - HKFC MOTM System{% endblock %} + +{% block content %} +
+
+
+
+
+ +
+ +

Error

+ +
+
+ Something went wrong +
+

{{ message or "Invalid voting URL. Please check the link and try again." }}

+
+ +
+ + Back to Home + +
- - +
+
+{% endblock %} diff --git a/motm_app/templates/error_new.html b/motm_app/templates/error_new.html new file mode 100644 index 0000000..a5e112e --- /dev/null +++ b/motm_app/templates/error_new.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block title %}Error - HKFC MOTM System{% endblock %} + +{% block content %} +
+
+
+
+
+ +
+ +

Error

+ +
+
+ Something went wrong +
+

{{ message or "Invalid voting URL. Please check the link and try again." }}

+
+ +
+ + Back to Home + + +
+
+
+
+
+{% endblock %} diff --git a/motm_app/templates/error_old.html b/motm_app/templates/error_old.html new file mode 100644 index 0000000..14eb924 --- /dev/null +++ b/motm_app/templates/error_old.html @@ -0,0 +1,19 @@ + + + Error - Invalid URL + + + + + +
+
+
+

Error

+

{{ message or "Invalid voting URL. Please check the link and try again." }}

+ Home +
+
+
+ + diff --git a/motm_app/templates/index.html b/motm_app/templates/index.html index 3c51b7b..416ef13 100644 --- a/motm_app/templates/index.html +++ b/motm_app/templates/index.html @@ -1,115 +1,237 @@ - - - HKFC Men's C Team - MOTM System - - - - - - - -
-
-
-

HKFC Men's C Team - Man of the Match System

-
-

Welcome to the MOTM Voting System

-

This system allows players to vote for Man of the Match and Dick of the Day, while providing admin tools for managing matches and squads.

+{% extends "base.html" %} + +{% block title %}HKFC Men's C Team - MOTM System{% endblock %} + +{% block content %} +
+
+ +
+
+

+ + Welcome to the MOTM Voting System +

+

+ This system allows players to vote for Man of the Match and Dick of the Day, + while providing admin tools for managing matches and squads. +

+
+
+
+
+ +
+ + + + + {% if is_admin %} + + {% else %} +
+
+
+

+ Admin Access +

+
+
+
+
+ Authentication Required +
+

Admin functions require authentication. Please contact the system administrator for access.

+
+
+
+
+ {% endif %} +
+ + +{% if is_admin %} +
+
+
+
+

+ System Management +

+
+
+
+ -
-
-

Player Section

-
- -

Match Comments

-

View comments from recent matches

-
+ - - {% if is_admin %} -
- - +
+
+{% endif %} + + +
+
+
+
+

+ System Information +

+
+
+
+
+
System Status
+

+ + System Online +

+
+
+
Current Season
+

2024-2025 Hockey Season

+
+
+
+
+
+
+{% endblock %} diff --git a/motm_app/templates/index_new.html b/motm_app/templates/index_new.html new file mode 100644 index 0000000..416ef13 --- /dev/null +++ b/motm_app/templates/index_new.html @@ -0,0 +1,237 @@ +{% extends "base.html" %} + +{% block title %}HKFC Men's C Team - MOTM System{% endblock %} + +{% block content %} +
+
+ +
+
+

+ + Welcome to the MOTM Voting System +

+

+ This system allows players to vote for Man of the Match and Dick of the Day, + while providing admin tools for managing matches and squads. +

+
+
+
+
+ +
+ + + + + {% if is_admin %} + + {% else %} +
+
+
+

+ Admin Access +

+
+
+
+
+ Authentication Required +
+

Admin functions require authentication. Please contact the system administrator for access.

+
+
+
+
+ {% endif %} +
+ + +{% if is_admin %} + +{% endif %} + + +
+
+
+
+

+ System Information +

+
+
+
+
+
System Status
+

+ + System Online +

+
+
+
Current Season
+

2024-2025 Hockey Season

+
+
+
+
+
+
+{% endblock %} diff --git a/motm_app/templates/index_old.html b/motm_app/templates/index_old.html new file mode 100644 index 0000000..71e8a9e --- /dev/null +++ b/motm_app/templates/index_old.html @@ -0,0 +1,117 @@ +{% extends "base.html" %} + +{% block title %}HKFC Men's C Team - MOTM System{% endblock %} + +{% block content %} +
+
+ +
+
+

+ + Welcome to the MOTM Voting System +

+

+ This system allows players to vote for Man of the Match and Dick of the Day, + while providing admin tools for managing matches and squads. +

+
+
+ + +
+
+
+ + diff --git a/motm_app/templates/match_comments.html b/motm_app/templates/match_comments.html index 59d1197..afd7211 100644 --- a/motm_app/templates/match_comments.html +++ b/motm_app/templates/match_comments.html @@ -1,31 +1,76 @@ - - - HKFC Men's C Team - Match Comments - - - - - - - -

Match Comments

-
-
- - -
-
-
-
- {% for comment in comments %} -
-
- {{ comment.comment }} +{% extends "base.html" %} + +{% block title %}HKFC Men's C Team - Match Comments{% endblock %} + +{% block content %} + +
+
+
+
+

+ Match Comments +

+ + +
+
+ HKFC Logo +
+ HKFC
- {% endfor %} +
+

VS

+
+
+ Opponent Logo +
+ Opponent +
+
+
- Home - - +
+
+ + +
+
+ {% if comments %} + {% for comment in comments %} +
+
+
+
+ +
+
+

{{ comment.comment }}

+
+
+
+
+ {% endfor %} + {% else %} +
+
+ +
No comments yet
+

Comments for this match will appear here once they are added.

+
+
+ {% endif %} +
+
+ + + +{% endblock %} diff --git a/motm_app/templates/match_comments_new.html b/motm_app/templates/match_comments_new.html new file mode 100644 index 0000000..afd7211 --- /dev/null +++ b/motm_app/templates/match_comments_new.html @@ -0,0 +1,76 @@ +{% extends "base.html" %} + +{% block title %}HKFC Men's C Team - Match Comments{% endblock %} + +{% block content %} + +
+
+
+
+

+ Match Comments +

+ + +
+
+ HKFC Logo +
+ HKFC +
+
+
+

VS

+
+
+ Opponent Logo +
+ Opponent +
+
+
+
+
+
+
+ + +
+
+ {% if comments %} + {% for comment in comments %} +
+
+
+
+ +
+
+

{{ comment.comment }}

+
+
+
+
+ {% endfor %} + {% else %} +
+
+ +
No comments yet
+

Comments for this match will appear here once they are added.

+
+
+ {% endif %} +
+
+ + + +{% endblock %} diff --git a/motm_app/templates/match_comments_old.html b/motm_app/templates/match_comments_old.html new file mode 100644 index 0000000..59d1197 --- /dev/null +++ b/motm_app/templates/match_comments_old.html @@ -0,0 +1,31 @@ + + + HKFC Men's C Team - Match Comments + + + + + + + +

Match Comments

+
+
+ + +
+
+
+
+ {% for comment in comments %} +
+
+ {{ comment.comment }} +
+
+ {% endfor %} +
+
+ Home + + diff --git a/motm_app/templates/motm_vote.html b/motm_app/templates/motm_vote.html index f452f10..98f9329 100644 --- a/motm_app/templates/motm_vote.html +++ b/motm_app/templates/motm_vote.html @@ -1,83 +1,219 @@ - - - HKFC Men's C Team - MotM and DotD online vote - - - - - - -

HKFC Men's C Team MotM and DotD online vote

-
{{ formatDate }}
-

- -

Randomly selected comment from the match: -
- {% for item in comment %} - {{ item.comment }} - {% endfor %} -

-
- {{ form.csrf_token }} -
-
-
- - -
-
-
- Man of the Match - -
-
-
-
- Dick of the Day - -
-
+{% extends "base.html" %} + +{% block title %}HKFC Men's C Team - MotM and DotD Vote{% endblock %} + +{% block content %} + +
+
+
+
+

+ + HKFC Men's C Team MotM and DotD Vote +

+
{{ formatDate }}
+ + +
+
+ HKFC Logo +
+ HKFC
-
-
-
- Match comments - -
-
+
+
+

VS

+
+
+ Opponent Logo +
+ {{ oppo }}
-
-

Rogues Gallery

-
-

Current Man of the Match

- -
-
-

Current Dick of the Day

- -
-
- - Cancel - +
-
- - +
+
+
+ + +
+
+
+
+
+ Random Match Comment +
+
+
+ {% for item in comment %} +
+

+ + {{ item.comment }} + +

+
+ {% endfor %} +
+
+
+
+ + +
+
+ +
+
+
+ Man of the Match +
+
+
+
+ {{ form.csrf_token }} + + + +
+ + +
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ Dick of the Day +
+
+
+
+ {{ form.csrf_token }} + + + +
+ + +
+ +
+ +
+
+
+
+
+
+ + +{% if currMotM or currDotD %} +
+
+
+
+
+ Current Results +
+
+
+
+ {% if currMotM %} +
+
+
+ Current Man of the Match +
+

{{ currMotM }}

+
+
+ {% endif %} + + {% if currDotD %} +
+
+
+ Current Dick of the Day +
+

{{ currDotD }}

+
+
+ {% endif %} +
+
+
+
+
+{% endif %} + + +
+
+
+
+
Voting Instructions
+
    +
  • Select one player for Man of the Match
  • +
  • Select one player for Dick of the Day
  • +
  • You can vote for the same player for both categories
  • +
  • Votes are submitted independently
  • +
+
+
+
+
+{% endblock %} + +{% block extra_scripts %} + +{% endblock %} diff --git a/motm_app/templates/motm_vote_new.html b/motm_app/templates/motm_vote_new.html new file mode 100644 index 0000000..98f9329 --- /dev/null +++ b/motm_app/templates/motm_vote_new.html @@ -0,0 +1,219 @@ +{% extends "base.html" %} + +{% block title %}HKFC Men's C Team - MotM and DotD Vote{% endblock %} + +{% block content %} + +
+
+
+
+

+ + HKFC Men's C Team MotM and DotD Vote +

+
{{ formatDate }}
+ + +
+
+ HKFC Logo +
+ HKFC +
+
+
+

VS

+
+
+ Opponent Logo +
+ {{ oppo }} +
+
+
+
+
+
+
+ + +
+
+
+
+
+ Random Match Comment +
+
+
+ {% for item in comment %} +
+

+ + {{ item.comment }} + +

+
+ {% endfor %} +
+
+
+
+ + +
+
+ +
+
+
+ Man of the Match +
+
+
+
+ {{ form.csrf_token }} + + + +
+ + +
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ Dick of the Day +
+
+
+
+ {{ form.csrf_token }} + + + +
+ + +
+ +
+ +
+
+
+
+
+
+ + +{% if currMotM or currDotD %} +
+
+
+
+
+ Current Results +
+
+
+
+ {% if currMotM %} +
+
+
+ Current Man of the Match +
+

{{ currMotM }}

+
+
+ {% endif %} + + {% if currDotD %} +
+
+
+ Current Dick of the Day +
+

{{ currDotD }}

+
+
+ {% endif %} +
+
+
+
+
+{% endif %} + + +
+
+
+
+
Voting Instructions
+
    +
  • Select one player for Man of the Match
  • +
  • Select one player for Dick of the Day
  • +
  • You can vote for the same player for both categories
  • +
  • Votes are submitted independently
  • +
+
+
+
+
+{% endblock %} + +{% block extra_scripts %} + +{% endblock %} diff --git a/motm_app/templates/motm_vote_old.html b/motm_app/templates/motm_vote_old.html new file mode 100644 index 0000000..f452f10 --- /dev/null +++ b/motm_app/templates/motm_vote_old.html @@ -0,0 +1,83 @@ + + + HKFC Men's C Team - MotM and DotD online vote + + + + + + +

HKFC Men's C Team MotM and DotD online vote

+
{{ formatDate }}
+

+ +

Randomly selected comment from the match: +
+ {% for item in comment %} + {{ item.comment }} + {% endfor %} +

+
+ {{ form.csrf_token }} +
+
+
+ + +
+
+
+ Man of the Match + +
+
+
+
+ Dick of the Day + +
+
+
+
+
+
+ Match comments + +
+
+
+
+

Rogues Gallery

+
+

Current Man of the Match

+ +
+
+

Current Dick of the Day

+ +
+
+ + Cancel +
+
+
+
+ + diff --git a/motm_app/templates/s3_config.html b/motm_app/templates/s3_config.html index e111b20..af74f79 100644 --- a/motm_app/templates/s3_config.html +++ b/motm_app/templates/s3_config.html @@ -1,33 +1,23 @@ - - - - - - S3 Configuration - HKFC Men's C Team - - - - -
-
-
-

S3 Configuration

-

Configure AWS S3 storage for logos and assets

- - +{% extends "base.html" %} + +{% block title %}S3 Configuration - HKFC Men's C Team{% endblock %} + +{% block extra_head %} + +{% endblock %} + +{% block content %} {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} @@ -251,5 +241,4 @@ } }); - - +{% endblock %} diff --git a/motm_app/templates/s3_status.html b/motm_app/templates/s3_status.html index 6c360b5..c460791 100644 --- a/motm_app/templates/s3_status.html +++ b/motm_app/templates/s3_status.html @@ -1,22 +1,26 @@ - - - - - - S3 Status - HKFC Men's C Team - - - -
-
-
-

S3 Storage Status

-

Current S3 configuration and connection status

- - +{% extends "base.html" %} + +{% block title %}S3 Status - HKFC Men's C Team{% endblock %} + +{% block content %} +
+
+
+
+

S3 Storage Status

+

Current S3 configuration and connection status

+
+ +
+
+
@@ -149,6 +153,4 @@
- - - +{% endblock %} diff --git a/motm_app/templates/vote_thanks.html b/motm_app/templates/vote_thanks.html index 31b801a..cf36afa 100644 --- a/motm_app/templates/vote_thanks.html +++ b/motm_app/templates/vote_thanks.html @@ -1,19 +1,44 @@ - - - HKFC Men's C Team - MotM and DotD vote - - - - - - -

Thanks for submitting the MotM and DotD votes

- - Smithers' army of Internet monkeys will now go about adding up the votes ... -

- -

- Home - Comments - - +{% extends "base.html" %} + +{% block title %}Vote Submitted - HKFC MOTM System{% endblock %} + +{% block content %} +
+
+
+
+
+ +
+ +

Vote Submitted Successfully!

+ +
+
+ Thank you for voting +
+

+ Smithers' army of Internet monkeys will now go about adding up the votes... +

+
+ +
+ Counting votes +
+ + +
+
+
+
+{% endblock %} diff --git a/motm_app/templates/vote_thanks_new.html b/motm_app/templates/vote_thanks_new.html new file mode 100644 index 0000000..cf36afa --- /dev/null +++ b/motm_app/templates/vote_thanks_new.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} + +{% block title %}Vote Submitted - HKFC MOTM System{% endblock %} + +{% block content %} +
+
+
+
+
+ +
+ +

Vote Submitted Successfully!

+ +
+
+ Thank you for voting +
+

+ Smithers' army of Internet monkeys will now go about adding up the votes... +

+
+ +
+ Counting votes +
+ + +
+
+
+
+{% endblock %} diff --git a/motm_app/templates/vote_thanks_old.html b/motm_app/templates/vote_thanks_old.html new file mode 100644 index 0000000..31b801a --- /dev/null +++ b/motm_app/templates/vote_thanks_old.html @@ -0,0 +1,19 @@ + + + HKFC Men's C Team - MotM and DotD vote + + + + + + +

Thanks for submitting the MotM and DotD votes

+ + Smithers' army of Internet monkeys will now go about adding up the votes ... +

+ +

+ Home + Comments + +