a small relational database with user-editable schema for manual data entry
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
yopa/yopa-web/resources/templates/objects/object_detail.html.tera

102 lines
2.2 KiB

{% extends "_layout" %}
{% block title -%}
{{object.name}}
{%- endblock %}
{% block nav -%}
<a href="/" class="btn btn-link">
<i class="icon icon-home"></i>Home</a>
<a href="/object/update/{{object.id}}" class="btn btn-link">
<i class="icon icon-edit"></i>Edit</a>
<a href="/object/delete/{{object.id}}" class="btn btn-link"
onclick="return confirm('Delete object?')">
<i class="icon icon-delete"></i>Delete</a>
{%- endblock %}
{% block content -%}
<h1>{{kind}} "{{object.name}}"</h1>
<table class="table table-striped object-display">
<tbody>
{% for property in properties %}
{% for value in property.values %}
<tr>
{% if loop.first %}
<th rowspan="{{property.values | length}}">
{{ property.model.name }}
</th>
{% endif %}
<td title="{{value.id}}">
{{ value.value | print_typed_value }}
</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
{% for relation in relations %}
<h3>{{relation.model.name}}</h3>
<ul>
{% for instance in relation.instances %}
<li>
<b><a href="/object/detail/{{instance.related.id}}">{{instance.related.name}}</a></b>
{% if instance.properties %}
<br>
<small>
{% for property in instance.properties %}
{%- if 0 != loop.index0 -%}
;
{%- endif -%}
{% for value in property.values %}
{%- if loop.first -%}
<i>{{ property.model.name }}:</i>
{%- else -%}
,
{% endif -%}
{{ value.value | print_typed_value }}
{% endfor %}
{% endfor %}
</small>
{% endif %}
</li>
{% endfor %}
</ul>
{% endfor %}
{% for relation in reciprocal_relations %}
<h3>{{relation.model.reciprocal_name}}</h3>
<ul>
{% for instance in relation.instances %}
<li>
<b><a href="/object/detail/{{instance.related.id}}">{{instance.related.name}}</a></b>
{% if instance.properties %}
<br>
<small>
{% for property in instance.properties %}
{%- if 0 != loop.index0 -%}
;
{%- endif -%}
{% for value in property.values %}
{%- if loop.first -%}
<i>{{ property.model.name }}:</i>
{%- else -%}
,
{% endif -%}
{{ value.value | print_typed_value }}
{% endfor %}
{% endfor %}
</small>
{% endif %}
</li>
{% endfor %}
</ul>
{% endfor %}
{%- endblock %}