sample users admin

This commit is contained in:
Zeni Kim 2024-12-04 08:39:08 -05:00
parent 19c24593fe
commit 0f520e67af
9 changed files with 488 additions and 3 deletions

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
{{template "page_head" "Goffee"}}
<body>
<div class="container">
<h2>Add user form</h2>
{{if .ErrorMessages }}<div class="alert alert-dismissible alert-warning">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<ul>
{{range $i, $a := .ErrorMessages}}
<li>{{$a}}</li>
{{end}}
</ul>
</div>{{end}}
<form method="POST" id="add_user" action="/admin/users/add">
{{template "form_input" .FieldName}}
{{template "form_input" .FieldFullname}}
{{template "form_input" .FieldEmail}}
{{template "form_input" .FieldPassword}}
<hr>
{{template "form_button" .SubmitButton}}
</form>
</div>
{{template "page_footer"}}
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
{{template "page_head" "Goffee"}}
<body>
<div class="container">
<h2>Edit user form</h2>
{{if .ErrorMessages }}<div class="alert alert-dismissible alert-warning">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<ul>
{{range $i, $a := .ErrorMessages}}
<li>{{$a}}</li>
{{end}}
</ul>
</div>{{end}}
<form method="POST" id="add_user" action="/admin/users/edit/{{.FieldKey.Value}}">
{{template "form_input" .FieldName}}
{{template "form_input" .FieldFullname}}
{{template "form_input" .FieldEmail}}
{{template "form_input" .FieldPassword}}
{{template "form_input" .FieldKey}}
{{template "form_button" .SubmitButton}}
</form>
<hr>
<form method="POST" id="del_user" action="/admin/users/delete">
{{template "form_input" .FieldKey}}
{{template "form_button" .DeleteButton}}
</form>
</div>
{{template "page_footer"}}
</body>
</html>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
{{template "page_head" "Goffee"}}
<body>
<div class="container">
<div class="d-flex justify-content-between mb-2">
<h2>Users</h2>
<div class=" align-self-end ">
{{template "content_href" .AddButton}}
</div>
</div>
<div class="section table-container">
{{template "content_table" .TableUsers}}
</div>
</div>
{{template "page_footer"}}
</body>
</html>