list of objects and some other stuff

This commit is contained in:
2021-02-15 20:49:01 +01:00
parent b5a4900209
commit 97af2fd924
17 changed files with 238 additions and 126 deletions
@@ -90,10 +90,13 @@ export default {
data: data
})
.then(function (response) {
console.log('Response', response);
location.href = '/objects';
})
.catch(function (error) {
console.log('Error', error);
// TODO show error toast instead
alert(error.response ?
error.response.data :
error)
});
},
@@ -129,13 +132,15 @@ export default {
<property v-for="(property, pi) in properties" :model="property" :values="values[property.id]" :key="pi"></property>
</table>
<h3>Relations</h3>
<div v-if="relations.length > 0">
<h3>Relations</h3>
<new-relation
v-for="relation in relations"
:ref="setRelationRef"
:model_id="relation.id"
:objects="objects"
:schema="schema"
></new-relation>
<new-relation
v-for="relation in relations"
:ref="setRelationRef"
:model_id="relation.id"
:objects="objects"
:schema="schema"
></new-relation>
</div>
</template>
+6
View File
@@ -34,3 +34,9 @@ window.Yopa = {
return instance;
}
};
onLoad(() => {
setTimeout(() => {
document.getElementsByClassName('toast')[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
@@ -6,12 +6,12 @@
{%- endblock %}
{% block nav -%}
<a href="/takeout">Takeout</a>
<a href="/">Home</a>
{%- endblock %}
{% block content -%}
<h1>Welcome to YOPA</h1>
<h1>Models</h1>
<a href="/model/object/create">New model</a>
@@ -0,0 +1,29 @@
{% extends "_layout" %}
{% block title -%}
Objects
{%- endblock %}
{% block nav -%}
<a href="/models">Edit models</a>
<a href="/takeout">JSON</a>
{%- endblock %}
{% block content -%}
<h1>Objects</h1>
{% for table in models %}
<h2>{{ table.model.name }}</h2>
<a href="/object/create/{{table.model.id}}">Add {{ table.model.name }}</a>
<ul>
{% for object in table.objects %}
<li><a href="/object/detail/{{object.id}}">{{object.name}}</a>
{% endfor %}
</ul>
{% endfor %}
{%- endblock %}