aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/controls.j283
-rw-r--r--app/templates/games.j26
-rw-r--r--app/templates/index.j211
-rw-r--r--app/templates/login.html8
-rw-r--r--app/templates/macros.j254
-rw-r--r--app/templates/players.j259
6 files changed, 100 insertions, 121 deletions
diff --git a/app/templates/controls.j2 b/app/templates/controls.j2
index f67f745..a8cba89 100644
--- a/app/templates/controls.j2
+++ b/app/templates/controls.j2
@@ -1,47 +1,46 @@
{% from "macros.j2" import court_button %}
-<div class="fixed-grid has-6-cols">
- <div class="parent">
- {% for court in courts %}
- {{ court_button(court) }}
- {% endfor %}
- </div>
+<h3>Courts</h3>
+<div class="parent">
+{% for court in courts %}
+ {{ court_button(court) }}
+{% endfor %}
</div>
-<div class="columns">
- <div class="column">
- <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>
- <div class="column">
- <div class="select is-responsive">
- <select name="team">
- <option>Random</option>
- <option>Teams</option>
- </select>
- </div>
- </div>
- <div class="column">
- <button class="button is-dark is-responsive"
- hx-post="/propose"
- hx-target="#games"
- hx-include="[name='levels'], [name='team']">Generate</button>
+<h3>Generation</h3>
+<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="column"></div>
- <div class="column">
- <button class="button is-dark is-responsive"
- hx-post="/confirm"
- hx-target="#games">Confirm</button>
- </div>
- <div class="column">
- <button class="button is-dark is-responsive"
- hx-post="/reset"
- hx-target="#games">RESET!</button>
+ <div class="select is-responsive">
+ <select name="team">
+ <option>Random</option>
+ <option>Teams</option>
+ </select>
</div>
+</div>
+<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>
+<h3>Timer</h3>
+<div role="group">
+ <button id="timer-dec"><i class="fas fa-light fa-minus"></i></button>
+ <input id="timer-display" type="text" style="text-align:center; " readonly></input>
+ <button id="timer-inc"><i class="fas fa-light fa-plus"></i></button>
+ <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> \ No newline at end of file
diff --git a/app/templates/games.j2 b/app/templates/games.j2
index dff1e0f..ce2a412 100644
--- a/app/templates/games.j2
+++ b/app/templates/games.j2
@@ -1,4 +1,5 @@
-<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth" id="games">
+<div class="overflow-auto">
+<table id="games">
<thead>
<th colspan="5" align="center"> {{ title }} </th>
</thead>
@@ -18,4 +19,5 @@
</tr>
{% endfor %}
</tbody>
-</table> \ No newline at end of file
+</table>
+<div> \ No newline at end of file
diff --git a/app/templates/index.j2 b/app/templates/index.j2
index ce0d531..8a13fa0 100644
--- a/app/templates/index.j2
+++ b/app/templates/index.j2
@@ -3,11 +3,14 @@
<html lang="en">
{{ header(url_for) }}
<body>
- <section class="section">
- {{ navbar(url_for) }}
+ <header class="container">{{ navbar(url_for) }}</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>
- {{ footer() }}
- </section>
+ </main>
+ <footer class="container">{{ footer() }}</footer>
+ <script defer src="{{ url_for('static', filename='custom.js') }}"></script>
</body>
</html>
diff --git a/app/templates/login.html b/app/templates/login.html
index a42f2c5..e3109b6 100644
--- a/app/templates/login.html
+++ b/app/templates/login.html
@@ -3,8 +3,8 @@
<html lang="en">
{{ header(url_for) }}
<body>
- <section class="section">
- {{ navbar(url_for) }}
+ <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 }}
@@ -16,8 +16,8 @@
</form>
<input class="button is-dark" type="submit" value="Login">
</form>
- {{ footer() }}
- </section>
+ </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
index 4fe35f0..17a2940 100644
--- a/app/templates/macros.j2
+++ b/app/templates/macros.j2
@@ -1,11 +1,11 @@
{% macro court_button(court) -%}
-<button class= "button is-responsive {% if court.status %}is-success{% else %}is-danger{% endif %}"
+<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="button is-responsive {% if player.status %}is-success{% else %}is-danger {% endif %}"
+<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 %}
@@ -16,56 +16,30 @@
<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/bulma@1.0.4/css/bulma.min.css">
+<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>
-<script defer src="{{ url_for('static', filename='custom.js') }}"></script>
</head>
{%- endmacro %}
{% macro footer() -%}
-<div class="content has-text-centered">Made by <a href="https://karanjayachandra.com/">Karan</a> using <a href="https://flask.palletsprojects.com">Flask</a>, <a href="https://htmx.org/">HTMX</a>, <a href="https://carlosroso.com/notyf/">Notyf</a> and <a href="https://bulma.io">Bulma</a></div>
+<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) -%}
-<nav class="level">
- <p class="level-item has-text-centered">
- <button class="button is-link" onclick="location.href = '/';">Games</button>
- </p>
- <p class="level-item has-text-centered">
- <button class="button is-link" onclick="location.href = '/players';">Players</button>
- </p>
- <div class="level-item has-text-centered"></div>
- <div class="level-left"></div>
- <div class="level-item has-text-centered">
- <p class="title">Match Up!</p>
- </div>
- <div class="level-item has-text-centered"></div>
- <div class="level-right">
- <div class="field has-addons has-addons-centered">
- <div class="control"><button class="button is-dark" id="timer-dec">
- <span class="icon"><i class="fas fa-light fa-minus"></i></span>
- </button></div>
- <p class="control has-icons-left has-icons-right">
- <input class="input is-responsive" id="timer-display" type="text" style="text-align:center; " readonly>
- <span class="icon is-small is-left">
- <i class="fas fa-light fa-clock"></i>
- </span>
- </p>
- <div class="control"><button class="button is-dark" id="timer-inc">
- <span class="icon"><i class="fas fa-light fa-plus"></i></span>
- </button></div>
- <div class="control"><button class="button is-dark" id="timer-start">
- <span class="icon"><i class="fas fa-light fa-play"></i></span>
- </button></div>
- <div class="control"><button class="button is-dark" id="timer-stop">
- <span class="icon"><i class="fas fa-light fa-stop"></i></span>
- </button></div>
- </div>
- </div>
+<nav>
+ <ul>
+ <li><strong>Match Up!</strong></li>
+ </ul>
+ <ul>
+ <li><a href="/">Games</a></li>
+ <li><a href="/players">Players</a></li>
+ <li><a href="/login/">Admin</a></li>
+ </ul>
</nav>
{%- endmacro %} \ No newline at end of file
diff --git a/app/templates/players.j2 b/app/templates/players.j2
index 0499b73..f10b0a9 100644
--- a/app/templates/players.j2
+++ b/app/templates/players.j2
@@ -3,44 +3,45 @@
<html lang="en">
{{ header(url_for) }}
<body>
- <section class="section">
- {{ navbar(url_for) }}
- <h4 class="title is-4">Members</h4>
+ <header class="container">{{ navbar(url_for) }}</header>
+ <main class="container">
+ <h3 >Members</h3>
<div class="parent">
{% for regular in regulars %}
<div class="cell"> {{ player_button(regular) }} </div>
{% endfor %}
</div>
- <h4 class="title is-4">Guests</h4>
+ <h3>Guests</h3>
<div class="parent">
{% for guest in guests %}
<div class="cell"> {{ player_button(guest) }} </div>
{% endfor %}
</div>
- </section>
- <section class="section">
- <div class="column">
- <button class="button is-dark is-responsive"
- hx-post="/reset_players">RESET!</button>
- </div>
- <div class="column">
- <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" />
- <span class="file-cta">
- <span class="file-icon">
- <i class="fas fa-upload"></i>
- </span>
- <span class="file-label"> Choose a file… </span>
- </span>
- <span class="file-name"> No file uploaded </span>
- </label>
- <button class="button is-dark is-responsive">UPDATE!</button>
- </div>
- </form>
- </div>
- {{ footer() }}
- </section>
+ <h3>Controls</h3>
+ <section class="section">
+ <div class="column">
+ <button class="button is-dark is-responsive"
+ hx-post="/reset_players">RESET!</button>
+ </div>
+ <div class="column">
+ <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" />
+ <span class="file-cta">
+ <span class="file-icon">
+ <i class="fas fa-upload"></i>
+ </span>
+ <span class="file-label"> Choose a file… </span>
+ </span>
+ <span class="file-name"> No file uploaded </span>
+ </label>
+ <button class="button is-dark is-responsive">UPDATE!</button>
+ </div>
+ </form>
+ </div>
+ <footer class="container">{{ footer() }}</footer>
+ </section>
+ </main>
</body>
</html> \ No newline at end of file