add object detail page but inserting relations doesnt work anymore
This commit is contained in:
@@ -37,6 +37,9 @@ window.Yopa = {
|
||||
|
||||
onLoad(() => {
|
||||
setTimeout(() => {
|
||||
document.getElementsByClassName('toast')[0].style.display = 'none';
|
||||
let toasts = document.getElementsByClassName('toast');
|
||||
if (toasts.length) {
|
||||
toasts[0].style.display = 'none';
|
||||
}
|
||||
}, 3000)
|
||||
})
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,64 @@
|
||||
{% extends "_layout" %}
|
||||
|
||||
{% block title -%}
|
||||
{{object.name}}
|
||||
{%- endblock %}
|
||||
|
||||
{% block nav -%}
|
||||
<a href="/">Home</a>
|
||||
{%- endblock %}
|
||||
|
||||
{% block content -%}
|
||||
|
||||
<h1>{{kind}} "{{object.name}}"</h1>
|
||||
|
||||
<table>
|
||||
{% 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 %}
|
||||
</table>
|
||||
|
||||
{% for relation in relations %}
|
||||
<h3>{{relation.model.name}}</h3>
|
||||
|
||||
<ul>
|
||||
{% for instance in relation.instances %}
|
||||
<li>
|
||||
<b>{{instance.related.name}}</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 %}
|
||||
Reference in New Issue
Block a user