2018-09-21 21:53:29 -04:00
{{ define "title"}}{{ t "page.settings.title" }}{{ end }}
2017-11-20 00:10:04 -05:00
{{ define "content"}}
< section class = "page-header" >
2018-09-21 21:53:29 -04:00
< h1 > {{ t "page.settings.title" }}< / h1 >
2019-11-17 20:26:47 -05:00
{{ template "settings_menu" dict "user" .user }}
2017-11-20 00:10:04 -05:00
< / section >
< form method = "post" autocomplete = "off" action = "{{ route " updateSettings " } } " >
< input type = "hidden" name = "csrf" value = "{{ .csrf }}" >
{{ if .errorMessage }}
< div class = "alert alert-error" > {{ t .errorMessage }}< / div >
{{ end }}
2018-09-21 21:53:29 -04:00
< label for = "form-username" > {{ t "form.user.label.username" }}< / label >
2020-12-23 13:29:51 -05:00
< input type = "text" name = "username" id = "form-username" value = "{{ .form.Username }}" autocomplete = "username" required >
2017-11-20 00:10:04 -05:00
2018-09-21 21:53:29 -04:00
< label for = "form-password" > {{ t "form.user.label.password" }}< / label >
2018-06-30 21:05:51 -04:00
< input type = "password" name = "password" id = "form-password" value = "{{ .form.Password }}" autocomplete = "new-password" >
2017-11-20 00:10:04 -05:00
2018-09-21 21:53:29 -04:00
< label for = "form-confirmation" > {{ t "form.user.label.confirmation" }}< / label >
2018-06-30 21:05:51 -04:00
< input type = "password" name = "confirmation" id = "form-confirmation" value = "{{ .form.Confirmation }}" autocomplete = "new-password" >
2017-11-20 00:10:04 -05:00
2018-09-21 21:53:29 -04:00
< label for = "form-language" > {{ t "form.prefs.label.language" }}< / label >
2017-11-20 00:10:04 -05:00
< select id = "form-language" name = "language" >
{{ range $key, $value := .languages }}
< option value = "{{ $key }}" { { if eq $ key $ . form . Language } } selected = "selected" { { end } } > {{ $value }}< / option >
{{ end }}
< / select >
2018-09-21 21:53:29 -04:00
< label for = "form-timezone" > {{ t "form.prefs.label.timezone" }}< / label >
2017-11-20 00:10:04 -05:00
< select id = "form-timezone" name = "timezone" >
{{ range $key, $value := .timezones }}
< option value = "{{ $key }}" { { if eq $ key $ . form . Timezone } } selected = "selected" { { end } } > {{ $value }}< / option >
{{ end }}
< / select >
2018-09-21 21:53:29 -04:00
< label for = "form-theme" > {{ t "form.prefs.label.theme" }}< / label >
2017-11-20 00:10:04 -05:00
< select id = "form-theme" name = "theme" >
{{ range $key, $value := .themes }}
< option value = "{{ $key }}" { { if eq $ key $ . form . Theme } } selected = "selected" { { end } } > {{ $value }}< / option >
{{ end }}
< / select >
2021-02-28 16:29:51 -05:00
< label for = "form-display-mode" > {{ t "form.prefs.label.display_mode" }}< / label >
< select id = "form-display-mode" name = "display_mode" >
< option value = "fullscreen" { { if eq " fullscreen " $ . form . DisplayMode } } selected = "selected" { { end } } > {{ t "form.prefs.select.fullscreen" }}< / option >
< option value = "standalone" { { if eq " standalone " $ . form . DisplayMode } } selected = "selected" { { end } } > {{ t "form.prefs.select.standalone" }}< / option >
< option value = "minimal-ui" { { if eq " minimal-ui " $ . form . DisplayMode } } selected = "selected" { { end } } > {{ t "form.prefs.select.minimal_ui" }}< / option >
< option value = "browser" { { if eq " browser " $ . form . DisplayMode } } selected = "selected" { { end } } > {{ t "form.prefs.select.browser" }}< / option >
< / select >
2018-09-21 21:53:29 -04:00
< label for = "form-entry-direction" > {{ t "form.prefs.label.entry_sorting" }}< / label >
2017-12-02 20:04:01 -05:00
< select id = "form-entry-direction" name = "entry_direction" >
2018-09-21 21:53:29 -04:00
< option value = "asc" { { if eq " asc " $ . form . EntryDirection } } selected = "selected" { { end } } > {{ t "form.prefs.select.older_first" }}< / option >
< option value = "desc" { { if eq " desc " $ . form . EntryDirection } } selected = "selected" { { end } } > {{ t "form.prefs.select.recent_first" }}< / option >
2017-12-02 20:04:01 -05:00
< / select >
2020-07-08 19:24:54 -04:00
< label for = "form-entries-per-page" > {{ t "form.prefs.label.entries_per_page" }}< / label >
< input type = "number" name = "entries_per_page" id = "form-entries-per-page" value = "{{ .form.EntriesPerPage }}" min = "1" >
2019-04-28 21:20:46 -04:00
< label > < input type = "checkbox" name = "keyboard_shortcuts" value = "1" { { if . form . KeyboardShortcuts } } checked { { end } } > {{ t "form.prefs.label.keyboard_shortcuts" }}< / label >
2020-09-27 10:41:04 -04:00
2020-07-16 22:46:24 -04:00
< label > < input type = "checkbox" name = "show_reading_time" value = "1" { { if . form . ShowReadingTime } } checked { { end } } > {{ t "form.prefs.label.show_reading_time" }}< / label >
2019-04-28 21:20:46 -04:00
2020-09-27 10:41:04 -04:00
< label > < input type = "checkbox" name = "entry_swipe" value = "1" { { if . form . EntrySwipe } } checked { { end } } > {{ t "form.prefs.label.entry_swipe" }}< / label >
2021-01-04 23:29:12 -05:00
< label > {{t "form.prefs.label.custom_css" }}< / label > < textarea name = "custom_css" cols = "40" rows = "8" spellcheck = "false" > {{ .form.CustomCSS }}< / textarea >
2017-11-20 00:10:04 -05:00
< div class = "buttons" >
2018-09-21 21:53:29 -04:00
< button type = "submit" class = "button button-primary" data-label-loading = "{{ t " form . submit . saving " } } " > {{ t "action.update" }}< / button >
2017-11-20 00:10:04 -05:00
< / div >
< / form >
2017-11-24 19:09:10 -05:00
{{ if hasOAuth2Provider "google" }}
< div class = "panel" >
2020-12-22 00:14:10 -05:00
{{ if .user.GoogleID }}
2018-09-21 21:53:29 -04:00
< a href = "{{ route " oauth2Unlink " " provider " " google " } } " > {{ t "page.settings.unlink_google_account" }}< / a >
2017-11-24 19:09:10 -05:00
{{ else }}
2018-09-21 21:53:29 -04:00
< a href = "{{ route " oauth2Redirect " " provider " " google " } } " > {{ t "page.settings.link_google_account" }}< / a >
2017-11-24 19:09:10 -05:00
{{ end }}
< / div >
2020-03-07 21:45:19 -05:00
{{ else if hasOAuth2Provider "oidc" }}
< div class = "panel" >
2020-12-22 00:14:10 -05:00
{{ if .user.OpenIDConnectID }}
2020-03-07 21:45:19 -05:00
< a href = "{{ route " oauth2Unlink " " provider " " oidc " } } " > {{ t "page.settings.unlink_oidc_account" }}< / a >
{{ else }}
< a href = "{{ route " oauth2Redirect " " provider " " oidc " } } " > {{ t "page.settings.link_oidc_account" }}< / a >
{{ end }}
< / div >
2017-11-24 19:09:10 -05:00
{{ end }}
2017-11-20 00:10:04 -05:00
{{ end }}