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.
59 lines
1.3 KiB
HTML
59 lines
1.3 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 %}{% call macros::item_name(item, item_class, false) %}{% endblock %} – Item Details – {{ branding }}{% endblock %}
|
||
{% block page_actions %}
|
||
<a class="btn btn-warning" href="/item/{{ item.id }}/edit">Edit</a>
|
||
{% endblock %}
|
||
{% block main %}
|
||
<table class="table">
|
||
<tbody>
|
||
<tr>
|
||
<th>
|
||
UUID
|
||
</th>
|
||
<td>{{ item.id }}</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
Name
|
||
</th>
|
||
<td>
|
||
{% call macros::item_name_terse(item, true) %}
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
Class
|
||
</th>
|
||
<td>
|
||
<a href="/item-class/{{ item.class }}">{{ item_class.name }}</a>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
Parents
|
||
</th>
|
||
<td>
|
||
{%- call macros::parents_breadcrumb(item, parents, item_classes, full=true) %}
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
{% if children.len() != 0 %}
|
||
<h3 class="mt-4">Direct Children</h3>
|
||
|
||
<ul>
|
||
{% for child in children %}
|
||
<li><a href="/item/{{ child.id }}">{% call macros::item_name(child, item_classes.get(child.class).unwrap(), true) %}</a></li>
|
||
{% endfor %}
|
||
</ul>
|
||
{% endif %}
|
||
{% endblock %}
|