gabriel / musehub public
issue_rows.html html
41 lines 1.5 KB
c0f0b481 release: merge dev → main (#5) Gabriel Cardona <cgcardona@gmail.com> 5d ago
1 {# fragments/issue_rows.html — bare HTMX fragment: issue list rows.
2
3 This template is intentionally minimal — no <html>, no <head>, no nav.
4 It is rendered in two contexts:
5
6 1. Full-page load: included inline by musehub/pages/issue_list.html inside
7 the ``<div id="issue-rows">`` target container.
8
9 2. HTMX partial swap: returned directly when the handler detects
10 ``HX-Request: true``, replacing only the ``#issue-rows`` container.
11
12 Required context variables
13 --------------------------
14 issues : list[IssueResponse] — current page of filtered issues
15 labels_data : list[dict] — all repo labels ({name, color}) for colour lookup
16 active_label : str — currently active label filter ('' if none)
17 base_url : str — repo base URL, e.g. /owner/slug
18
19 Pattern: copy this file for every other list-page fragment. All context
20 variables are prepared server-side by the route handler — no JS fetches.
21 #}
22 {% from "musehub/macros/issue.html" import issue_row %}
23 {% from "musehub/macros/empty_state.html" import empty_state %}
24
25 {% if issues %}
26 {% for issue in issues %}
27 {{ issue_row(
28 issue,
29 base_url=base_url,
30 labels=labels_data,
31 active_labels=[active_label] if active_label else [],
32 show_checkbox=True,
33 ) }}
34 {% endfor %}
35 {% else %}
36 {{ empty_state(
37 "📭",
38 "No issues",
39 "No issues match the current filters. Try adjusting the state, label, or milestone.",
40 ) }}
41 {% endif %}