refactor the preferences page
parent
5553a8af01
commit
56416b78ec
|
|
@ -69,6 +69,7 @@ func PreferencesHandler(app *App) http.HandlerFunc {
|
||||||
BasePath: app.Config.ThreadrDir,
|
BasePath: app.Config.ThreadrDir,
|
||||||
StaticPath: app.Config.ThreadrDir + "/static",
|
StaticPath: app.Config.ThreadrDir + "/static",
|
||||||
CurrentURL: r.URL.Path,
|
CurrentURL: r.URL.Path,
|
||||||
|
ContentTemplate: "preferences-content",
|
||||||
},
|
},
|
||||||
Preferences: prefs,
|
Preferences: prefs,
|
||||||
ShowSuccess: showSuccess,
|
ShowSuccess: showSuccess,
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,15 @@
|
||||||
{{define "preferences"}}
|
{{define "preferences"}}{{template "base" .}}{{end}}
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
{{define "preferences-content"}}
|
||||||
<head>
|
<header>
|
||||||
<title>{{.Title}}</title>
|
|
||||||
<link rel="stylesheet" href="{{.StaticPath}}/style.css">
|
|
||||||
<script src="{{.StaticPath}}/app.js" defer></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{{template "navbar" .}}
|
|
||||||
<main>
|
|
||||||
<header>
|
|
||||||
<h2>Preferences</h2>
|
<h2>Preferences</h2>
|
||||||
</header>
|
</header>
|
||||||
{{if .ShowSuccess}}
|
{{if .ShowSuccess}}
|
||||||
<div class="notification success" style="position: static; margin-bottom: 1em; animation: none;">
|
<div class="notification success" style="position: static; margin-bottom: 1em; animation: none;">
|
||||||
Preferences saved successfully!
|
Preferences saved successfully!
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<section>
|
<section>
|
||||||
<form method="post" action="{{.BasePath}}/preferences/">
|
<form method="post" action="{{.BasePath}}/preferences/">
|
||||||
<h3>Draft Auto-Save</h3>
|
<h3>Draft Auto-Save</h3>
|
||||||
<label for="auto_save_drafts" style="display: flex; align-items: center; gap: 0.5em; cursor: pointer;">
|
<label for="auto_save_drafts" style="display: flex; align-items: center; gap: 0.5em; cursor: pointer;">
|
||||||
|
|
@ -30,9 +22,5 @@
|
||||||
|
|
||||||
<input type="submit" value="Save Preferences" style="margin-top: 2em;">
|
<input type="submit" value="Save Preferences" style="margin-top: 2em;">
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
|
||||||
{{template "cookie_banner" .}}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue