Now can do all CRUD and just need search and pagination.
This commit is contained in:
parent
b0ba0c7e16
commit
e178ca6733
5 changed files with 62 additions and 10 deletions
|
@ -7,12 +7,13 @@
|
|||
<h1>Admin Tables</h1>
|
||||
|
||||
<block x-data="Tables">
|
||||
<button type="button"><a href="/admin/new/table/{{ .Table }}/">New</a></button>
|
||||
<table>
|
||||
<template x-for="item in theData">
|
||||
<tr>
|
||||
<td>
|
||||
<a x-bind:href="'/admin/table/{{ .Table }}/' + item.id + '/'">
|
||||
^
|
||||
#
|
||||
</a>
|
||||
</td>
|
||||
<template x-for="(value, key) in item">
|
||||
|
|
31
views/admin/table/new.html
Normal file
31
views/admin/table/new.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
<script>
|
||||
let Data = new GetJson("/api/admin/new/table/{{ .Table }}/");
|
||||
</script>
|
||||
|
||||
<blockstart>
|
||||
<h1>Admin Tables</h1>
|
||||
|
||||
<block x-init="item = await Data.oneThing()" x-data="{item: {}}">
|
||||
<form method="POST" action="/api/admin/new/table/{{ .Table }}/">
|
||||
<card>
|
||||
<top><h2>{{ .Table }} : New</h2></top>
|
||||
<middle>
|
||||
<template x-for="(value, key) in item">
|
||||
<div>
|
||||
<label x-text="key" x-bind:for="key"></label>
|
||||
<input x-bind:name="key" x-text="value" x-model="item[key]" x-bind:id="key" />
|
||||
</div>
|
||||
</template>
|
||||
</middle>
|
||||
<bottom>
|
||||
<button-group>
|
||||
<button type="button"><a href="/admin/table/{{ .Table }}/">Back</a></button>
|
||||
<button type="submit">Insert</button>
|
||||
<button type="button">Clear</button>
|
||||
</button-group>
|
||||
</bottom>
|
||||
</card>
|
||||
</form>
|
||||
</block>
|
||||
|
||||
</blockstart>
|
Loading…
Add table
Add a link
Reference in a new issue