Simon Bruder
c4a73204aa
This vastly changes how item names are displayed. To make this more ergonomic, it adds some helper macros. This also aids in adhering to DRY.
38 lines
1 KiB
HTML
38 lines
1 KiB
HTML
{#
|
||
SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
|
||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||
#}
|
||
|
||
{%- import "macros.html" as macros -%}
|
||
{% extends "base.html" %}
|
||
{% block title %}{% block page_title %}Item List{% endblock %} – {{ branding }}{% endblock %}
|
||
{% block page_actions %}
|
||
<a class="btn btn-primary" href="/items/add">Add</a>
|
||
{% endblock %}
|
||
{% block main %}
|
||
<table class="table">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Class</th>
|
||
<th>Parents</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for item in item_list -%}
|
||
{% let class = item_classes.get(item.class).unwrap() %}
|
||
{# inlining this breaks? #}
|
||
{%- let parents = item_parents.get(item.id).unwrap() %}
|
||
<tr>
|
||
<td><a href="/item/{{ item.id }}">{% call macros::item_name_terse(item, true) %}</a></td>
|
||
<td><a href="/item-class/{{ class.id }}">{{ class.name }}</a></td>
|
||
<td>
|
||
{%- call macros::parents_breadcrumb(item, parents, item_classes, full=false) %}
|
||
</td>
|
||
</tr>
|
||
{% endfor -%}
|
||
</tbody>
|
||
</table>
|
||
{% endblock %}
|