feat(11-04): add client name links in printer_list.html and client_list.html
- printer_list.html: extract group_client_id from first printer in group;
wrap client name in <a href="/clients/{id}"> when id present; Unassigned
group renders as plain text (no dead link)
- client_list.html: wrap client name cell in <a href="/clients/{{ c.id }}">
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for c in clients %}
|
{% for c in clients %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ c.name }}</td>
|
<td><a href="/clients/{{ c.id }}">{{ c.name }}</a></td>
|
||||||
<td>{{ c.created_at.strftime('%Y-%m-%d') if c.created_at else '—' }}</td>
|
<td>{{ c.created_at.strftime('%Y-%m-%d') if c.created_at else '—' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -4,7 +4,12 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% for client_name, printers in grouped.items() %}
|
{% for client_name, printers in grouped.items() %}
|
||||||
<section>
|
<section>
|
||||||
|
{% set group_client_id = printers[0].client_id if printers else None %}
|
||||||
|
{% if group_client_id %}
|
||||||
|
<h3><a href="/clients/{{ group_client_id }}">{{ client_name }}</a></h3>
|
||||||
|
{% else %}
|
||||||
<h3>{{ client_name }}</h3>
|
<h3>{{ client_name }}</h3>
|
||||||
|
{% endif %}
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user