From 5249744b01849b7158ff9cf796c550924f452320 Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Fri, 3 Apr 2026 16:02:56 -0700 Subject: start er up --- templates/admin.html | 138 ++++++++++++++++++ templates/admin_edit_game.html | 66 +++++++++ templates/admin_manage_teams.html | 76 ++++++++++ templates/base.html | 54 ++++++++ templates/game.html | 185 +++++++++++++++++++++++++ templates/login.html | 16 +++ templates/season.html | 285 ++++++++++++++++++++++++++++++++++++++ templates/team.html | 65 +++++++++ 8 files changed, 885 insertions(+) create mode 100644 templates/admin.html create mode 100644 templates/admin_edit_game.html create mode 100644 templates/admin_manage_teams.html create mode 100644 templates/base.html create mode 100644 templates/game.html create mode 100644 templates/login.html create mode 100644 templates/season.html create mode 100644 templates/team.html (limited to 'templates') diff --git a/templates/admin.html b/templates/admin.html new file mode 100644 index 0000000..19c7bd9 --- /dev/null +++ b/templates/admin.html @@ -0,0 +1,138 @@ +{% extends "base.html" %} + +{% block content %} +

League Administration

+ +
+
+

Create New Season

+
+ +
+ + +
+ +
+
+ +
+

Create Team/User

+
+ +
+ + +
+
+ + +
+
+ + +
+ +
+
+
+ +
+

Manage Seasons

+ {% if seasons %} + + + + + + + + {% for season in seasons %} + + + + + + + {% endfor %} +
IDNameStatusActions
{{ season.id }}{{ season.name }}{{ season.status }} +
+ +
+ + + +
+ +
+
+ + + {% else %} +

No seasons created yet.

+ {% endif %} +
+ +
+

Registered Teams

+ {% if teams %} + + {% else %} +

No teams registered yet.

+ {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/admin_edit_game.html b/templates/admin_edit_game.html new file mode 100644 index 0000000..2651185 --- /dev/null +++ b/templates/admin_edit_game.html @@ -0,0 +1,66 @@ +{% extends "base.html" %} + +{% block content %} +

Admin: Edit Game {{ game.id }}

+

Matchup: {{ game.away_team if game.away_team else 'TBD' }} @ {{ game.home_team if game.home_team else 'TBD' }}

+ +
+
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+ + + + + + + + + {% set bs_a = game.box_score.away if game.box_score else [0,0,0,0,0,0,0,0,0,0,0,0,0] %} + {% for col in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "extra", "runs", "hits", "errors"] %} + + {% endfor %} + + + + {% set bs_h = game.box_score.home if game.box_score else [0,0,0,0,0,0,0,0,0,0,0,0,0] %} + {% for col in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "extra", "runs", "hits", "errors"] %} + + {% endfor %} + +
Team123456789ExRHE
{{ game.away_team if game.away_team else 'Away' }}
{{ game.home_team if game.home_team else 'Home' }}
+
+ +
+ + Cancel +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/admin_manage_teams.html b/templates/admin_manage_teams.html new file mode 100644 index 0000000..669d622 --- /dev/null +++ b/templates/admin_manage_teams.html @@ -0,0 +1,76 @@ +{% extends "base.html" %} + +{% block content %} +

Manage Teams for Season: {{ season.name }}

+ +
+ +
+

Pending Requests

+ {% if pending_teams %} +
    + {% for team in pending_teams %} +
  • + {{ team.team_name }} ({{ team.username }}) +
    +
    + + + +
    +
    + + + +
    +
    +
  • + {% endfor %} +
+ {% else %} +

No pending requests.

+ {% endif %} + +

Approved Teams

+ {% if approved_teams %} +
    + {% for team in approved_teams %} +
  • + {{ team.team_name }} ({{ team.username }}) +
    + + + +
    +
  • + {% endfor %} +
+ {% else %} +

No approved teams.

+ {% endif %} +
+ + +
+

Directly Add Teams

+

Select teams to bypass the request process and approve immediately.

+
+ +
+ {% for team in all_teams %} + {% if team.id not in enrolled_ids %} + + {% endif %} + {% endfor %} +
+ +
+
+ ← Back to Admin Dashboard +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..9172079 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,54 @@ + + + + + + The Orchard League + + + + + +
+
+ +
+

THE ORCHARD LEAGUE

+

Established 2026

+
+
+ +
+ +
+
+ {% with messages = get_flashed_messages() %} + {% if messages %} +
    + {% for message in messages %} +
  • {{ message }}
  • + {% endfor %} +
+ {% endif %} + {% endwith %} +
+ + {% block content %}{% endblock %} +
+ + + + \ No newline at end of file diff --git a/templates/game.html b/templates/game.html new file mode 100644 index 0000000..690e16d --- /dev/null +++ b/templates/game.html @@ -0,0 +1,185 @@ +{% extends "base.html" %} + +{% block content %} +
+ + ← Back to Schedule + +

Game Details

+
+ + {% if game %} +
+
+

Away

+ {% set is_away_team = current_user.is_authenticated and current_user.id|string == game.away_team_id|string %} + {% if game.away_icon %} + + {% else %} +
+ {% endif %} +

{{ game.away_team if game.away_team else 'TBD' }}

+
{{ game.away_score if game.status == 'Final' else '-' }}
+
+ +
+
VS
+
Date: {{ game.scheduled_date }}
+
+ {{ game.status }} + {% if game.is_conditional %}*{% endif %} +
+ + {% if current_user.is_admin %} +
+ ✎ Edit Game +
+ {% endif %} +
+ +
+

Home

+ {% set is_home_team = current_user.is_authenticated and current_user.id|string == game.home_team_id|string %} + {% if game.home_icon %} + + {% else %} +
+ {% endif %} +

{{ game.home_team if game.home_team else 'TBD' }}

+
{{ game.home_score if game.status == 'Final' else '-' }}
+
+
+ + {% if game.status == 'Final' and game.box_score and (game.box_score.away|sum + game.box_score.home|sum) > 0 %} +
+

Box Score

+ + + + + + + + + {% for val in game.box_score.away %} + + {% endfor %} + + + + {% for val in game.box_score.home %} + + {% endfor %} + +
Team123456789ExtraRHE
{{ game.away_team }}{{ val }}
{{ game.home_team }}{{ val }}
+
+ {% endif %} + + {% if game.status != 'Final' and submissions %} +
+

Active Proposals

+ {% for s in submissions %} + {% set show_score = s.away_score is not none and (s.away_score != game.away_score or s.home_score != game.home_score) %} + {% set show_date = s.proposed_date and s.proposed_date != game.scheduled_date %} + + {% if show_score or show_date %} +
+
+

From: {{ s.team_name }} ({{ s.username }})

+ {% if show_score %} +

Score: {{ game.away_team }} {{ s.away_score }} - {{ game.home_team }} {{ s.home_score }}

+ {% if s.box_score %} +
+ View Proposed Box Score + + + + + {% for v in s.box_score.away %}{% endfor %} + {% for v in s.box_score.home %}{% endfor %} +
Team123456789ExRHE
Away{{ v }}
Home{{ v }}
+
+ {% endif %} + {% endif %} + {% if show_date %} +

Date Proposal: {{ s.proposed_date }}

+ {% endif %} +
+
+ {% if current_user.id|string == s.submitted_by_id|string %} +
+ +
+ {% elif current_user.is_authenticated and (current_user.id|string == game.away_team_id|string or current_user.id|string == game.home_team_id|string) %} +
+ +
+ {% endif %} +
+
+ {% endif %} + {% endfor %} +
+ {% endif %} + + {% if game.status != 'Final' and current_user.is_authenticated and (current_user.id|string == game.away_team_id|string or current_user.id|string == game.home_team_id|string) %} +
+ +
+

Submit Game Results

+
+
+
+ + +
+
+ + +
+
+ +
+ + + + + + + + + {% for col in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "extra", "runs", "hits", "errors"] %} + + {% endfor %} + + + + {% for col in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "extra", "runs", "hits", "errors"] %} + + {% endfor %} + +
Team123456789ExtraRHE
{{ game.away_team if game.away_team else 'Away' }}
{{ game.home_team if game.home_team else 'Home' }}
+
+ + +
+
+ + +
+

Propose Date Change

+
+
+ + +
+ +
+
+
+ {% endif %} + {% else %} +

Game not found.

+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..f8f19b6 --- /dev/null +++ b/templates/login.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block content %} +

Team Owner Login

+
+
+ + +
+
+ + +
+ +
+{% endblock %} \ No newline at end of file diff --git a/templates/season.html b/templates/season.html new file mode 100644 index 0000000..43ca0de --- /dev/null +++ b/templates/season.html @@ -0,0 +1,285 @@ +{% extends "base.html" %} + +{% block content %} +
+
+ + + +
+
+ + +
+ + Season Overview + + + Standings + + + Schedule + + + Playoffs + +
+ + {% if active_tab == 'overview' %} +
+

{{ season_info.name }} - Overview

+
+
+

Total Games (Per Team): {{ season_info.total_games }}

+

Games Per Week: {{ season_info.games_per_week }}

+

Season Start: {{ season_info.start_date }}

+

Season End: {{ season_info.end_date }}

+ {% if season_info.total_games %} +

Playoff Teams: {{ season_info.playoff_teams }}

+ {% endif %} +

Status: {{ season_info.status }} {% if season_info.is_finished %}(Finished){% else %}(In Progress){% endif %}

+
+ +
+ {% if season_info.is_finished %} +

Final Standings

+ {% if standings %} + + {% for row in standings %} + + + + + {% endfor %} +
{{ loop.index }}. {{ row.team_name }}{{ row.wins }} - {{ row.losses }}
+ {% else %} +

No teams enrolled.

+ {% endif %} + {% else %} +

League Action

+

The season is currently active or upcoming.

+ + {% if current_user.is_authenticated and not current_user.is_admin %} + {% if user_season_status == 'Approved' %} +
+

You are currently enrolled in this season.

+
+ {% elif user_season_status == 'Pending' %} +
+

Your request to join is pending approval.

+
+ {% else %} +
+ +
+ {% endif %} + {% elif not current_user.is_authenticated %} +

+ Login to apply for this season. +

+ {% endif %} + {% endif %} +
+
+
+ + {% elif active_tab == 'standings' %} +
+

{{ season_info.name }} - Standings

+ {% if standings %} + + + + + + + + + + {% for row in standings %} + {% set is_my_team = current_user.is_authenticated and current_user.id|string == row.user_id|string %} + {% set is_cutoff = loop.index == season_info.playoff_teams %} + + + + + + + + + {% endfor %} +
TeamWins (W)Losses (L)Runs For (RF)Runs Against (RA)Games Back (GB)
+ {% if row.team_icon %} + {{ row.team_name }} + {% else %} +
+ {% endif %} + {{ row.team_name }} + {% if row.clinch %}{{ row.clinch }}{% endif %} +
{{ row.wins }}{{ row.losses }}{{ row.runs_for }}{{ row.runs_against }}{{ row.games_back }}
+ {% else %} +

No standings available for the selected season.

+ {% endif %} +
+ + {% elif active_tab == 'schedule' %} +
+

{{ season_info.name }} - Schedule

+ +
+ + + + +
+ + {% for month in months %} +
+

{{ month.name }}

+
+ {% for day in ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] %} +
{{ day }}
+ {% endfor %} + + {% for week in month.weeks %} + {% for day in week %} + {% set date_str = "%04d-%02d-%02d" % (month.year, month.month, day) if day != 0 else "" %} +
+ {% if day != 0 %} + {{ day }} + {% if date_str in games_by_date %} + {% for game in games_by_date[date_str] %} + {% set is_away_mine = current_user.is_authenticated and current_user.id|string == game.away_team_id|string %} + {% set is_home_mine = current_user.is_authenticated and current_user.id|string == game.home_team_id|string %} +
+ + {% if game.away_icon %} + + {% else %} +
+ {% endif %} + {{ game.away_score if game.status == 'Final' else '' }} @ + {{ game.home_score if game.status == 'Final' else '' }} + {% if game.home_icon %} + + {% else %} +
+ {% endif %} + {% if game.is_conditional %}*{% endif %} + {% if game.pending_proposals > 0 %} + + {% endif %} +
+
+ {% endfor %} + {% endif %} + {% endif %} +
+ {% endfor %} + {% endfor %} +
+
+ {% endfor %} + + {% if games_by_date['TBD'] %} +

TBD Games

+
+ {% for game in games_by_date['TBD'] %} +
+ TBD @ TBD (Playoff) +
+ {% endfor %} +
+ {% endif %} +
+ {% elif active_tab == 'playoffs' %} +
+

{{ season_info.name }} - Playoffs

+ + {% if bracket %} +
+ {% for round_games in bracket %} +
+

Round {{ loop.index }}

+ {% for g in round_games %} +
+
+ {{ g.away_team if g.away_team else 'TBD' }} {{ g.away_record if g.away_team else '' }} + {{ g.away_series_wins }} +
+
+ {{ g.home_team if g.home_team else 'TBD' }} {{ g.home_record if g.home_team else '' }} + {{ g.home_series_wins }} +
+
+ Best of {{ season_info.playoff_series_length }} +
+
+ {% endfor %} +
+ {% endfor %} +
+ {% else %} +

Playoff bracket not yet generated.

+ {% endif %} + +

Playoff Schedule

+ {% if playoff_games %} +
+ {% for game in playoff_games %} + {% set is_away_mine = current_user.is_authenticated and current_user.id|string == game.away_team_id|string %} + {% set is_home_mine = current_user.is_authenticated and current_user.id|string == game.home_team_id|string %} +
+
+ {{ game.scheduled_date }} - {{ game.status }} + {% if game.is_conditional %}*{% endif %} + {% if game.pending_proposals > 0 %}{% endif %} +
+
+
+ {% if game.away_icon %} + + {% else %} +
+ {% endif %} +
{{ game.away_team if game.away_team else 'TBD' }} +
{{ game.away_score if game.status == 'Final' else '-' }} +
+
@
+
+ {% if game.home_icon %} + + {% else %} +
+ {% endif %} +
{{ game.home_team if game.home_team else 'TBD' }} +
{{ game.home_score if game.status == 'Final' else '-' }} +
+
+
+ {% endfor %} +
+ {% else %} +

No playoff games scheduled.

+ {% endif %} +
+ {% endif %} + +{% endblock %} \ No newline at end of file diff --git a/templates/team.html b/templates/team.html new file mode 100644 index 0000000..e7098be --- /dev/null +++ b/templates/team.html @@ -0,0 +1,65 @@ +{% extends "base.html" %} + +{% block content %} +

Team Management: {{ current_user.team_name }}

+ + {% if current_user.team_icon %} +
+ Team Icon +
+ {% endif %} + +
+
+

Update Profile

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ +
+

Seasons

+ {% if seasons %} +
    + {% for season in seasons %} +
  • + {{ season.name }} ({{ season.status }}) + + {% if not current_user.is_admin %} + {% if season.id in my_seasons %} + {% if my_seasons[season.id] == 'Approved' %} + Joined + {% else %} + Pending Approval + {% endif %} + {% else %} +
    + +
    + {% endif %} + {% endif %} +
  • + {% endfor %} +
+ {% else %} +

No seasons available right now.

+ {% endif %} + +

Your Schedule

+

Below is your team's schedule for the active season.

+ View Full Team Schedule +
+
+{% endblock %} \ No newline at end of file -- cgit v1.2.3