Move user setting mocks to real settings
This commit is contained in:
parent
0b97c2cecc
commit
b786c88f52
4 changed files with 18 additions and 16 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{{ template "sync/layout/base.html" . }}
|
||||
{{ template "sync/layout/authenticated.html" . }}
|
||||
|
||||
{{ define "title" }}Dash{{ end }}
|
||||
{{ define "extraheader" }}
|
||||
|
|
@ -21,12 +21,6 @@
|
|||
<div class="card-header bg-white">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h3 class="mb-0">Add New User</h3>
|
||||
<a
|
||||
href="user-management.html"
|
||||
class="btn btn-outline-secondary btn-sm"
|
||||
>
|
||||
<i class="bi bi-arrow-left me-1"></i> Back to Users
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -145,7 +139,7 @@
|
|||
|
||||
<!-- Form actions -->
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a href="user-management.html" class="btn btn-secondary">
|
||||
<a href="{{ .URL.SettingUser }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{{ template "sync/layout/base.html" . }}
|
||||
{{ template "sync/layout/authenticated.html" . }}
|
||||
|
||||
{{ define "title" }}Dash{{ end }}
|
||||
{{ define "title" }}Setting - Users{{ end }}
|
||||
{{ define "extraheader" }}
|
||||
<style>
|
||||
.form-check-input.switch-lg {
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="mb-0">User Management</h1>
|
||||
<a
|
||||
href="{{ .URLs.SettingUserAdd }}"
|
||||
href="{{ .URL.SettingUserAdd }}"
|
||||
class="btn btn-primary"
|
||||
id="addUserBtn"
|
||||
>
|
||||
|
|
@ -34,8 +34,6 @@ func Router() chi.Router {
|
|||
addMock(r, "/mock/report/{code}/schedule", "sync/mock/report-schedule.html")
|
||||
addMock(r, "/mock/report/{code}/update", "sync/mock/report-update.html")
|
||||
addMock(r, "/mock/service-request/{code}", "sync/mock/service-request-detail.html")
|
||||
addMock(r, "/mock/setting/user", "sync/mock/setting-user.html")
|
||||
addMock(r, "/mock/setting/user/add", "sync/mock/setting-user-add.html")
|
||||
|
||||
// Utility endpoints
|
||||
r.Get("/oauth/refresh", getOAuthRefresh)
|
||||
|
|
@ -62,6 +60,8 @@ func Router() chi.Router {
|
|||
r.Method("GET", "/setting/integration", auth.NewEnsureAuth(getSettingIntegration))
|
||||
r.Method("GET", "/setting/pesticide", authenticatedHandler(getSettingPesticide))
|
||||
r.Method("GET", "/setting/pesticide/add", authenticatedHandler(getSettingPesticideAdd))
|
||||
r.Method("GET", "/setting/user", authenticatedHandler(getSettingUserList))
|
||||
r.Method("GET", "/setting/user/add", authenticatedHandler(getSettingUserAdd))
|
||||
r.Method("GET", "/signout", auth.NewEnsureAuth(getSignout))
|
||||
r.Method("GET", "/source/{globalid}", auth.NewEnsureAuth(getSource))
|
||||
r.Method("GET", "/stadia", auth.NewEnsureAuth(getStadia))
|
||||
|
|
|
|||
|
|
@ -128,13 +128,21 @@ func getSettingIntegration(w http.ResponseWriter, r *http.Request, u *models.Use
|
|||
html.RenderOrError(w, "sync/setting-integration.html", data)
|
||||
}
|
||||
|
||||
type contentSettingPesticide struct{}
|
||||
type contentSettingPlaceholder struct{}
|
||||
|
||||
func getSettingPesticide(ctx context.Context, user *models.User) (string, interface{}, *errorWithStatus) {
|
||||
content := contentSettingPesticide{}
|
||||
content := contentSettingPlaceholder{}
|
||||
return "sync/setting-pesticide.html", content, nil
|
||||
}
|
||||
func getSettingPesticideAdd(ctx context.Context, user *models.User) (string, interface{}, *errorWithStatus) {
|
||||
content := contentSettingPesticide{}
|
||||
content := contentSettingPlaceholder{}
|
||||
return "sync/setting-pesticide-add.html", content, nil
|
||||
}
|
||||
func getSettingUserAdd(ctx context.Context, user *models.User) (string, interface{}, *errorWithStatus) {
|
||||
content := contentSettingPlaceholder{}
|
||||
return "sync/setting-user-add.html", content, nil
|
||||
}
|
||||
func getSettingUserList(ctx context.Context, user *models.User) (string, interface{}, *errorWithStatus) {
|
||||
content := contentSettingPlaceholder{}
|
||||
return "sync/setting-user-list.html", content, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue