diff options
| author | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-11-09 09:56:59 +0100 |
|---|---|---|
| committer | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-11-09 09:56:59 +0100 |
| commit | 34d77cd777bd44d7bfe0e3ab3379f9be256ca88b (patch) | |
| tree | 04fba9f8bb99ac8fa15a1048b0ee06cbfed7f25d /app/templates | |
| parent | 90390365bd93a4ee086c2931bb70ffa571a726b9 (diff) | |
Moved to javascript codebase
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/controls.j2 | 48 | ||||
| -rw-r--r-- | app/templates/games.j2 | 21 | ||||
| -rw-r--r-- | app/templates/index.j2 | 16 | ||||
| -rw-r--r-- | app/templates/login.html | 23 | ||||
| -rw-r--r-- | app/templates/macros.j2 | 45 | ||||
| -rw-r--r-- | app/templates/players.j2 | 40 |
6 files changed, 0 insertions, 193 deletions
diff --git a/app/templates/controls.j2 b/app/templates/controls.j2 deleted file mode 100644 index 97351bf..0000000 --- a/app/templates/controls.j2 +++ /dev/null @@ -1,48 +0,0 @@ -{% from "macros.j2" import court_button %} -<h3>Timer</h3> -<div class="timer"> - <div role="group" style="height: 100%"> - <button id="timer-dec"><i class="fas fa-light fa-minus"></i></button> - <input id="timer-display" type="text" style="text-align:center; height: 100%" readonly></input> - <button id="timer-inc"><i class="fas fa-light fa-plus"></i></button> - </div> - <button id="timer-start"><i class="fas fa-light fa-play"></i></button> - <button id="timer-stop"><i class="fas fa-light fa-stop"></i></button> -</div> -<h3>Generation</h3> -<div class="grid"> - <button class="button is-dark is-responsive" - hx-post="/propose" - hx-target="#games" - hx-include="[name='levels'], [name='team']">Generate</button> - <button class="button is-dark is-responsive" - hx-post="/confirm" - hx-target="#games">Confirm</button> - <button class="button is-dark is-responsive" - hx-post="/reset" - hx-target="#games">RESET!</button> -</div> -<div class="grid"> - <div class="select is-responsive"> - <select name="levels"> - <option>10 Levels</option> - <option>8 Levels</option> - <option>6 Levels</option> - <option>4 Levels</option> - <option>2 Levels</option> - <option>0 Levels</option> - </select> - </div> - <div class="select is-responsive"> - <select name="team"> - <option>Random</option> - <option>Teams</option> - </select> - </div> -</div> -<h3>Courts</h3> -<div class="parent"> -{% for court in courts %} - {{ court_button(court) }} -{% endfor %} -</div>
\ No newline at end of file diff --git a/app/templates/games.j2 b/app/templates/games.j2 deleted file mode 100644 index 00ffb71..0000000 --- a/app/templates/games.j2 +++ /dev/null @@ -1,21 +0,0 @@ -<div id="games" class="overflow-auto"> - <h3> {{ title }} </h3> - <table> - <thead> - <th align="center"> Court </th> - <th colspan="2" align="center"> Team 1 </th> - <th colspan="2" align="center"> Team 2 </th> - </thead> - <tbody> - {% for game in games %} - <tr {% if game.team_1[0].first_name == 'RESERVED' %} data-theme="dark" {% endif %}> - <td align="center" style="width: 8%;">{{ game.court.id }}</th> - <td style="width: 23%;"><strong>{{ game.team_1[0].first_name }}</strong>{{ " " + game.team_1[0].last_name }}</th> - <td style="width: 23%;"><strong>{{ game.team_1[1].first_name }}</strong>{{ " " + game.team_1[1].last_name }}</th> - <td style="width: 23%;"><strong>{{ game.team_2[0].first_name }}</strong>{{ " " + game.team_2[0].last_name }}</th> - <td style="width: 23%;"><strong>{{ game.team_2[1].first_name }}</strong>{{ " " + game.team_2[1].last_name }}</th> - </tr> - {% endfor %} - </tbody> - </table> -<div>
\ No newline at end of file diff --git a/app/templates/index.j2 b/app/templates/index.j2 deleted file mode 100644 index af6ca4c..0000000 --- a/app/templates/index.j2 +++ /dev/null @@ -1,16 +0,0 @@ -{% from "macros.j2" import header, footer, navbar %} -<!doctype html> -<html lang="en"> - {{ header(url_for) }} - <body> - <header class="container">{{ navbar(url_for, login_status) }}</header> - <main class="container"> - <h2>Games</h2> - <div hx-post="/clear" hx-swap="outerHTML" hx-trigger="load"></div> - <h2>Controls</h2> - <div hx-get="/control" hx-swap="outerHTML" hx-trigger="load"></div> - </main> - <footer class="container">{{ footer() }}</footer> - <script src="{{ url_for('static', filename='timer.js') }}"></script> - </body> -</html> diff --git a/app/templates/login.html b/app/templates/login.html deleted file mode 100644 index e3109b6..0000000 --- a/app/templates/login.html +++ /dev/null @@ -1,23 +0,0 @@ -{% from "macros.j2" import header, footer, navbar %} -<!doctype html> -<html lang="en"> -{{ header(url_for) }} -<body> - <header class="container">{{ navbar(url_for) }}</header> - <main class="container"> - <form action="{{ url_for('simplelogin.login') }}" method="post"> - <div class="form-group"> - {{ form.csrf_token }} - {{form.username.label(class_="label")}}<div class="control form-control">{{ form.username(class_="input") }} - </div><br> - {{form.password.label(class_="label")}}<div class="control form-control"> {{ form.password(class_="input") }} - </div><br> - {% if next %}<input type="hidden" name="next" value="{{next}}">{% endif %} - </form> - <input class="button is-dark" type="submit" value="Login"> - </form> - </main> - <footer class="container">{{ footer() }}</footer> -</body> - -</html>
\ No newline at end of file diff --git a/app/templates/macros.j2 b/app/templates/macros.j2 deleted file mode 100644 index e82b910..0000000 --- a/app/templates/macros.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{% macro court_button(court) -%} -<button class= "{% if court.status %}{% else %}contrast{% endif %}" - hx-post="{{ "/court-toggle/" ~ court.id}}" - hx-swap="outerHTML"> Court {{ court.id }}</button> -{%- endmacro %} - -{% macro player_button(player) -%} -<button class="{% if player.status %}{% else %}contrast{% endif %}" - hx-post="{{ "/player-toggle/" ~ player.id}}" - hx-swap="outerHTML"> {{ player.first_name + " " + player.last_name}} </button> -{%- endmacro %} - -{% macro header(url_for) -%} -<head> -<meta charset="UTF-8"> -<meta name="viewport" content="width=device-width, initial-scale=1"> -<title>Match Up!</title> -<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}"> -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"> -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css"> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"> -<link rel="stylesheet" href="{{ url_for('static', filename='custom.css') }}"> -<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js"></script> -<script src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script> -<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/js/fontawesome.min.js"></script> -</head> -{%- endmacro %} - -{% macro footer() -%} -<div class="container">Made by <a href="https://karanjayachandra.com/">Karan</a> with <i class="fas fa-heart"></i></div> -{%- endmacro %} - - -{% macro navbar(url_for, login_status) -%} -<nav> - <ul> - <li><strong>Match Up!</strong></li> - </ul> - <ul> - <li><a href="/">Games</a></li> - <li><a href="/players">Players</a></li> - {% if login_status %}<li><a href="/logout/">Logout</a></li>{% else %}<li><a href="/login/">Login</a></li>{% endif %} - </ul> -</nav> -{%- endmacro %}
\ No newline at end of file diff --git a/app/templates/players.j2 b/app/templates/players.j2 deleted file mode 100644 index bacb215..0000000 --- a/app/templates/players.j2 +++ /dev/null @@ -1,40 +0,0 @@ -{% from "macros.j2" import header, navbar, footer, player_button, guest_control %} -<!doctype html> -<html lang="en"> - {{ header(url_for) }} - <body> - <header class="container">{{ navbar(url_for, login_status) }}</header> - <main class="container"> - <h3 >Members</h3> - <div class="parent"> - {% for regular in regulars %} - <div class="cell"> {{ player_button(regular) }} </div> - {% endfor %} - </div> - <h3>Guests</h3> - <div class="parent"> - {% for guest in guests %} - <div class="cell"> {{ player_button(guest) }} </div> - {% endfor %} - </div> - <h3>Controls</h3> - <div class="grid"> - <button class="button is-dark is-responsive" - hx-post="/reset_players">RESET!</button> - </div> - <h3>Player Update</h3> - <div class="grid"> - <form method="POST" enctype="multipart/form-data" hx-post="/update_players"> - <div id="file-js" class="file has-name is-fullwidth"> - <label class="file-label"> - <input class="file-input" type="file" name="players" /> - </label> - <button class="button is-dark is-responsive">UPDATE!</button> - </div> - </form> - </div> - <footer class="container">{{ footer() }}</footer> - <script src="{{ url_for('static', filename='file.js') }}"></script> - </main> - </body> -</html>
\ No newline at end of file |
