Initial commit
This commit is contained in:
27
templates/partials/player_row.html
Normal file
27
templates/partials/player_row.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<div
|
||||
class="player-row glass glass-hover rounded-2xl p-4 flex items-center justify-between gap-3 transition"
|
||||
data-player-id="{{ player.id }}"
|
||||
data-player-name="{{ player.name|lower }}"
|
||||
>
|
||||
<div class="min-w-0">
|
||||
<div class="text-base font-medium truncate">{{ player.name }}</div>
|
||||
<div class="text-xs text-slate-400">Нажмите, чтобы {% if present %}снять отметку{% else %}отметиться{% endif %}</div>
|
||||
</div>
|
||||
|
||||
<form class="attendance-form flex items-center gap-3" method="post" action="/api/attendance/toggle">
|
||||
<input type="hidden" name="player_id" value="{{ player.id }}" />
|
||||
<input type="hidden" name="session_date" value="{{ session_date if session_date is defined else selected_date }}" />
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="min-w-[120px] sm:min-w-[140px] px-4 py-2 rounded-xl text-sm font-semibold border transition
|
||||
{% if present %}
|
||||
bg-emerald-600 border-emerald-500 text-white
|
||||
{% else %}
|
||||
bg-slate-950/50 border-slate-800 text-slate-200 hover:border-slate-600
|
||||
{% endif %}"
|
||||
>
|
||||
{% if present %}Пришёл{% else %}Не пришёл{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
47
templates/partials/teams.html
Normal file
47
templates/partials/teams.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<div class="glass rounded-2xl p-4 sm:p-5">
|
||||
<div class="flex items-center justify-between gap-3 flex-wrap">
|
||||
<div>
|
||||
<h2 class="text-lg font-semibold">Команды</h2>
|
||||
<div class="text-xs text-slate-400">Отметились: {{ count }} · Дата: {{ session_date }}</div>
|
||||
</div>
|
||||
<form class="teams-form" method="post" action="/api/teams/random">
|
||||
<input type="hidden" name="session_date" value="{{ session_date if session_date is defined else selected_date }}" />
|
||||
<button
|
||||
type="submit"
|
||||
class="px-3 py-2 rounded-xl text-sm font-semibold bg-indigo-600 border border-indigo-500"
|
||||
>
|
||||
Перемешать
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if count < 2 %}
|
||||
<div class="mt-4 text-sm text-slate-300">
|
||||
Нужно минимум 2 отметившихся, чтобы разделить на команды.
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="mt-4 grid sm:grid-cols-2 gap-3">
|
||||
<div class="glass rounded-2xl p-4">
|
||||
<div class="text-sm font-semibold text-slate-200">Команда A</div>
|
||||
<ol class="mt-2 space-y-1 text-slate-100">
|
||||
{% for n in team_a %}
|
||||
<li class="flex items-center justify-between">
|
||||
<span class="truncate">{{ loop.index }}. {{ n }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
<div class="glass rounded-2xl p-4">
|
||||
<div class="text-sm font-semibold text-slate-200">Команда B</div>
|
||||
<ol class="mt-2 space-y-1 text-slate-100">
|
||||
{% for n in team_b %}
|
||||
<li class="flex items-center justify-between">
|
||||
<span class="truncate">{{ loop.index }}. {{ n }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user