You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
<script>
|
|
let page = 0;
|
|
let Tables = new GetJson(`/api/admin/table/{{ .Table }}/?page=${page}`);
|
|
|
|
const newPage = (new_page_num) => {
|
|
console.log("the function");
|
|
page = new_page_num;
|
|
new GetJson(`/api/admin/table/{{ .Table }}/?page=${page}`);
|
|
}
|
|
</script>
|
|
|
|
<blockstart>
|
|
<h1><a href="/admin/table/">«</a> Admin {{ .Table }}</h1>
|
|
|
|
<block x-data="Tables" x-effect="newPage(page)">
|
|
<block class="horizontal">
|
|
<button type="button"><a href="/admin/new/table/{{ .Table }}/">New</a></button>
|
|
<button type="button" @click="page -= 1">Prev</button>
|
|
<button type="button" @click="page += 1">Next</button>
|
|
<input type="text" name="search" size="35" placeholder="Search" />
|
|
<button type="button">Search</button>
|
|
</block>
|
|
<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">
|
|
<td x-text="value"></td>
|
|
</template>
|
|
</tr>
|
|
</template>
|
|
</table>
|
|
</block>
|
|
|
|
</blockstart>
|
|
|