actually add seasons
This commit is contained in:
1 parent
cae60c9305
commit
48ad7fe1a6
11 files changed
+700
-10
No files matched your search
@@ -26,6 +26,15 @@
|
||||
<span>Date <span class="info-tip" tabindex="0"><svg width="13" height="13" viewBox="0 0 13 13" fill="none" aria-hidden="true"><circle cx="6.5" cy="6.5" r="5.5" stroke="currentColor" stroke-width="1.2"/><path d="M6.5 6v3.5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/><circle cx="6.5" cy="4" r=".7" fill="currentColor"/></svg><span class="info-tip__bubble">The night the game was played. Same-day sessions automatically become S1, S2, etc.</span></span></span>
|
||||
<input type="date" name="session_date" value="{{ form.session_date }}" required>
|
||||
</label>
|
||||
<label>
|
||||
<span>Season <span class="form-opt-hint">(optional)</span></span>
|
||||
<select name="season_id">
|
||||
<option value="">No season</option>
|
||||
{% for s in seasons %}
|
||||
<option value="{{ s.id }}" {{ 'selected' if form.season_id == s.id else '' }}>{{ s.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Label <span class="form-opt-hint">(optional)</span> <span class="info-tip" tabindex="0"><svg width="13" height="13" viewBox="0 0 13 13" fill="none" aria-hidden="true"><circle cx="6.5" cy="6.5" r="5.5" stroke="currentColor" stroke-width="1.2"/><path d="M6.5 6v3.5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/><circle cx="6.5" cy="4" r=".7" fill="currentColor"/></svg><span class="info-tip__bubble">A short name for this session — 'Main table', 'Side game', etc. Shown in the session list alongside the date.</span></span></span>
|
||||
<input type="text" name="label" value="{{ form.label or '' }}" placeholder="e.g. Main table">
|
||||
@@ -48,8 +57,19 @@
|
||||
<h2 class="panel__title">All sessions</h2>
|
||||
</div>
|
||||
<div style="display:flex;align-items:center;gap:8px;">
|
||||
<span class="panel__tag" id="sess-count-label">{{ sessions|length }} total</span>
|
||||
{% if can_manage and empty_count > 0 %}
|
||||
{% if seasons %}
|
||||
<select class="session-filter-select" onchange="if(this.value) window.location=this.value;">
|
||||
<option value="{{ url_for('leagues.sessions', league_ref=league.url_ref) }}" {{ 'selected' if not selected_season else '' }}>All seasons</option>
|
||||
{% for s in seasons %}
|
||||
<option value="{{ url_for('leagues.sessions', league_ref=league.url_ref, season=s.id) }}" {{ 'selected' if selected_season_id == s.id else '' }}>{{ s.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% if selected_season %}
|
||||
<a class="btn btn--ghost btn--sm" href="{{ url_for('leagues.sessions', league_ref=league.url_ref) }}">Clear</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<span class="panel__tag" id="sess-count-label">{{ sessions|length }}{% if selected_season %} / {{ all_session_count }}{% endif %} total</span>
|
||||
{% if can_manage and empty_count > 0 and not selected_season %}
|
||||
<form method="post" action="{{ url_for('leagues.prune_empty_sessions', league_ref=league.url_ref) }}" style="margin:0;">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button class="btn btn--ghost btn--sm" type="submit">Prune empty ({{ empty_count }})</button>
|
||||
@@ -71,8 +91,9 @@
|
||||
<div>
|
||||
{% for session in sessions %}
|
||||
{% set sm = db_id_to_summary.get(session.id) %}
|
||||
{% set season_name = season_map[session.season_id].name if session.season_id and season_map.get(session.season_id) else '' %}
|
||||
<div class="session-row session-row--{{ session.status }}"
|
||||
data-search="{{ (session.display_label ~ ' ' ~ session.session_date.isoformat() ~ ' ' ~ session.session_date.strftime('%B %Y') ~ ' ' ~ (session.notes or '')) | lower }}">
|
||||
data-search="{{ (session.display_label ~ ' ' ~ session.session_date.isoformat() ~ ' ' ~ session.session_date.strftime('%B %Y') ~ ' ' ~ (session.notes or '') ~ ' ' ~ season_name) | lower }}">
|
||||
<div class="session-row__info">
|
||||
<div class="session-date-block">
|
||||
<span class="session-date-block__mon">{{ session.session_date.strftime('%b') }}</span>
|
||||
@@ -84,6 +105,9 @@
|
||||
</div>
|
||||
<div class="session-row__meta">
|
||||
<span>S{{ session.sequence_on_date }}</span>
|
||||
{% if session.season_id and season_map.get(session.season_id) %}
|
||||
<span class="season-tag">{{ season_map[session.season_id].name }}</span>
|
||||
{% endif %}
|
||||
{% if sm and sm.entries %}
|
||||
<span>· {{ sm.entries|length }} player{{ 's' if sm.entries|length != 1 else '' }}</span>
|
||||
<span>· {{ sm.total_invested_cents | money }} pot</span>
|
||||
|
||||
Reference in new issue
Block a user