li7y/templates/item_details.html
Simon Bruder c4a73204aa
Make item name optional
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.
2024-07-11 01:16:45 +02:00

59 lines
1.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{#
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 %}