wip edit form data

This commit is contained in:
2021-02-18 01:16:26 +01:00
parent 95381c1da3
commit 7ab333515d
8 changed files with 177 additions and 16 deletions
@@ -20,7 +20,7 @@ Objects
<ul>
{% for object in table.objects %}
<li><a href="/object/detail/{{object.id}}">{{object.name}}</a>
<li><a href="/object/detail/{{object.id}}">{{object.name}}</a> (<a href="/object/update/{{object.id}}">Edit</a>)
{% endfor %}
</ul>
@@ -14,7 +14,6 @@ Create {{model.name}}
<script>
onLoad(() => {
// TODO populate dynamically from the database
window.app = Yopa.newObjectForm({{ form_data | json_encode | safe }})
});
</script>
@@ -0,0 +1,21 @@
{% extends "_layout" %}
{% block title -%}
Edit {{object.name}}
{%- endblock %}
{% block nav -%}
<a href="/">Home</a>
{%- endblock %}
{% block content -%}
<div id="edit-object-form"></div>
<script>
onLoad(() => {
window.app = Yopa.editObjectForm({{ form_data | json_encode | safe }})
});
</script>
{%- endblock %}