Files
fitguide/app/templates/admin/_augmented_part_row.html
T

37 lines
1.7 KiB
HTML

<tr id="augmented-part-{{ ap.id }}">
<td>{{ ap.id }}</td>
<td>{{ ap.sku or '—' }}</td>
<td><a href="/admin/augmented-parts/{{ ap.id }}">{{ ap.description | truncate(60) }}</a></td>
<td>{{ ap.colour.name }}</td>
<td>{{ ap.manufacturer.name }}</td>
<td>{{ ap.scope_model.name if ap.scope_model else '—' }}</td>
<td>{{ ap.part_type.name }}</td>
<td>{{ ap.sub_part_type.name if ap.sub_part_type else '—' }}</td>
<td>{% if ap.archived %}<span class="tag">Archived</span>{% else %}—{% endif %}</td>
<td>{% if ap.on_website %}<span class="tag">Yes</span>{% else %}—{% endif %}</td>
<td>{% if ap.preferred_part %}<span class="tag">Yes</span>{% else %}—{% endif %}</td>
<td class="row-actions">
<button class="btn btn-ghost"
hx-get="/admin/augmented-parts/{{ ap.id }}/edit"
hx-target="#augmented-part-{{ ap.id }}"
hx-swap="outerHTML">Edit</button>
{% if ap.archived %}
<button class="btn btn-ghost"
hx-post="/admin/augmented-parts/{{ ap.id }}/unarchive"
hx-target="#augmented-part-{{ ap.id }}"
hx-swap="outerHTML">Unarchive</button>
{% else %}
<button class="btn btn-ghost"
hx-post="/admin/augmented-parts/{{ ap.id }}/archive"
hx-target="#augmented-part-{{ ap.id }}"
hx-swap="outerHTML"
hx-confirm="Archive {{ ap.sku or ap.description }}?">Archive</button>
{% endif %}
<button class="btn btn-danger"
hx-delete="/admin/augmented-parts/{{ ap.id }}"
hx-target="#augmented-part-{{ ap.id }}"
hx-swap="outerHTML"
hx-confirm="Delete {{ ap.sku or ap.description }}?">Delete</button>
</td>
</tr>