use sessionStorage & add user admin pages
This commit is contained in:
@ -29,9 +29,9 @@ All Sales
|
||||
import {showTable, currentPage} from "/static/js/all-sales.js"
|
||||
|
||||
let curPage = currentPage;
|
||||
if (localStorage.getItem("cur-page") !== null) {
|
||||
curPage = localStorage.getItem("cur-page");
|
||||
localStorage.removeItem("cur-page");
|
||||
if (sessionStorage.getItem("cur-page") !== null) {
|
||||
curPage = sessionStorage.getItem("cur-page");
|
||||
sessionStorage.removeItem("cur-page");
|
||||
}
|
||||
showTable({{.API}}, pageSize, curPage);
|
||||
</script>
|
||||
|
@ -32,9 +32,9 @@ All Subscriptions
|
||||
import {showTable, currentPage} from "/static/js/all-subscriptions.js"
|
||||
|
||||
let curPage = currentPage;
|
||||
if (localStorage.getItem("cur-page") !== null) {
|
||||
curPage = localStorage.getItem("cur-page");
|
||||
localStorage.removeItem("cur-page");
|
||||
if (sessionStorage.getItem("cur-page") !== null) {
|
||||
curPage = sessionStorage.getItem("cur-page");
|
||||
sessionStorage.removeItem("cur-page");
|
||||
}
|
||||
showTable({{.API}}, pageSize, curPage);
|
||||
</script>
|
||||
|
25
cmd/web/templates/all-users.page.gohtml
Normal file
25
cmd/web/templates/all-users.page.gohtml
Normal file
@ -0,0 +1,25 @@
|
||||
{{ template "base". }}
|
||||
{{ define "title" }}
|
||||
All Users
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<h2 class="mt-5">All Admin users</h2>
|
||||
<hr>
|
||||
<div class="float-end">
|
||||
<a class="btn btn-outline-secondary" href="/admin/all-users/0">Add User</a>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<table id="user-table" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
{{ end }}
|
||||
{{ define "js" }}
|
||||
<script>let tbody = document.getElementById("user-table").getElementByTagName("tbody")[0]</script>
|
||||
{{ end }}
|
@ -70,6 +70,12 @@
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="/admin/all-users">All Users</a>
|
||||
</li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="/logout">Logout</a>
|
||||
</li>
|
||||
|
11
cmd/web/templates/one-user.page.gohtml
Normal file
11
cmd/web/templates/one-user.page.gohtml
Normal file
@ -0,0 +1,11 @@
|
||||
{{ template "base". }}
|
||||
{{ define "title" }}
|
||||
Admin User
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<h2 class="mt-5">Admin user</h2>
|
||||
<hr>
|
||||
{{ end }}
|
||||
{{ define "js" }}
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user