summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-05-09 01:21:30 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-05-09 01:21:30 -0700
commitf3f40da05e0f97ff4308ddf1085e156879854eb5 (patch)
treef2a4ac869b69773778d3aa96b218229da0e12b83 /templates
parent65466fd5c645e546707ce699b4ea289f894fea20 (diff)
Replace stars dropdown with inline star picker on add/edit form
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/form.html22
1 files changed, 14 insertions, 8 deletions
diff --git a/templates/form.html b/templates/form.html
index fce5e48..23e6d2d 100644
--- a/templates/form.html
+++ b/templates/form.html
@@ -83,14 +83,20 @@
</div>
<div class="field">
- <label for="stars">Stars</label>
- {% set current_stars = film.stars if film else 0 %}
- <select id="stars" name="stars">
- <option value="0" {% if current_stars|string == '0' %}selected{% endif %}>Unstarred</option>
- <option value="1" {% if current_stars|string == '1' %}selected{% endif %}>1 star</option>
- <option value="2" {% if current_stars|string == '2' %}selected{% endif %}>2 stars</option>
- <option value="3" {% if current_stars|string == '3' %}selected{% endif %}>3 stars</option>
- </select>
+ <label>Stars</label>
+ {% set current_stars = film.stars if film and film.stars else 0 %}
+ <input type="hidden" id="stars" name="stars" value="{{ current_stars }}">
+ <div class="star-control" role="group" aria-label="Rate film" data-form-stars data-current-stars="{{ current_stars }}">
+ {% for value in range(1, 4) %}
+ <button
+ type="button"
+ class="star-button {% if current_stars >= value %}is-active{% endif %}"
+ data-stars="{{ value }}"
+ aria-label="{{ value }} star{% if value > 1 %}s{% endif %}"
+ aria-pressed="{% if current_stars >= value %}true{% else %}false{% endif %}"
+ >✦</button>
+ {% endfor %}
+ </div>
</div>
<div class="field checkbox-field">