updated course creation

This commit is contained in:
Rolf
2026-03-20 11:00:05 +01:00
parent 3a1da1482c
commit ef22436c76
2 changed files with 15 additions and 11 deletions
+4 -4
View File
@@ -44,16 +44,16 @@
</div>
</div>
<div class="card">
{% set course_par = holes | sum(attribute='par') %}
<div class="card"
x-data="{ pars: { {% for h in holes %}'{{ h.hole_number }}': {{ h.par or 4 }}{% if not loop.last %}, {% endif %}{% endfor %} }, coursePar() { return Object.values(this.pars).reduce((a, b) => a + parseInt(b), 0); } }">
<h2 style="font-size:0.95rem; color:var(--text-muted); margin-bottom:0.75rem;">
Hole details <span style="font-weight:400;">— Course par: <strong>{{ course_par }}</strong></span>
Hole details <span style="font-weight:400;">— Course par: <strong x-text="coursePar()"></strong></span>
</h2>
<div class="hole-pars-grid">
{% for h in holes %}
<div class="hole-par-cell">
<div class="hole-par-label">{{ h.hole_number }}</div>
<select name="par_{{ h.hole_number }}" class="hole-par-select">
<select name="par_{{ h.hole_number }}" class="hole-par-select" x-model="pars['{{ h.hole_number }}']">
<option value="3" {% if h.par == 3 %}selected{% endif %}>3</option>
<option value="4" {% if h.par == 4 %}selected{% endif %}>4</option>
<option value="5" {% if h.par == 5 %}selected{% endif %}>5</option>