I can now list the contents of a table and display a form for one row to update/delete, but haven't implemented update and delete.
parent
2b40d6fdc3
commit
d12817f4cc
@ -1,15 +1,31 @@ |
|||||||
<script> |
<script> |
||||||
let Data = new GetJson("/api/admin/table/{{ .Table }}/{{ .Id }}/") |
let Data = new GetJson("/api/admin/table/{{ .Table }}/{{ .Id }}/"); |
||||||
console.log("Data", Data) |
|
||||||
</script> |
</script> |
||||||
|
|
||||||
<blockstart> |
<blockstart> |
||||||
<h1>Admin Tables</h1> |
<h1>Admin Tables</h1> |
||||||
|
|
||||||
<block x-data="Data"> |
<block x-init="item = await Data.oneThing()" x-data="{item: {}}"> |
||||||
<ul> |
<form method="POST" action="/api/admin/table/{{ .Table }}/{{ .Id }}/"> |
||||||
<h1 x-text="item.id"></h1> |
<card> |
||||||
</ul> |
<top><h1>{{ .Table }} : {{ .Id }}</h1></top> |
||||||
|
<middle> |
||||||
|
<template x-for="(value, key) in item"> |
||||||
|
<div> |
||||||
|
<label x-text="key" x-bind:for="key"></label> |
||||||
|
<input x-text="value" x-bind:value="value" x-bind:id="key" /> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
</middle> |
||||||
|
<bottom> |
||||||
|
<button-group> |
||||||
|
<button type="button">Back</button> |
||||||
|
<button type="submit">Update</button> |
||||||
|
<button type="button">Delete</button> |
||||||
|
</button-group> |
||||||
|
</bottom> |
||||||
|
</card> |
||||||
|
</form> |
||||||
</block> |
</block> |
||||||
|
|
||||||
</blockstart> |
</blockstart> |
||||||
|
Loading…
Reference in new issue