| 1 |
{{ define "title"}}{{ t "page.settings.title" }}{{ end }} |
| 2 |
|
| 3 |
{{ define "page_header"}} |
| 4 |
<section class="page-header" aria-labelledby="page-header-title"> |
| 5 |
<h1 id="page-header-title">{{ t "page.settings.title" }}</h1> |
| 6 |
{{ template "settings_menu" dict "user" .user }} |
| 7 |
</section> |
| 8 |
{{ end }} |
| 9 |
|
| 10 |
{{ define "content"}} |
| 11 |
{{ if and (not disableLocalAuth) (hasOAuth2Provider "google") }} |
| 12 |
<fieldset> |
| 13 |
<legend>{{ t "form.prefs.fieldset.google_authentication" }}</legend> |
| 14 |
{{ if .user.GoogleID }} |
| 15 |
<form method="post" action="{{ routePath "/oauth2/%s/unlink" "google" }}"> |
| 16 |
<input type="hidden" name="csrf" value="{{ .csrf }}"> |
| 17 |
<button type="submit" class="button button-danger" data-label-loading="{{ t "form.submit.saving" }}">{{ t "page.settings.unlink_google_account" }}</button> |
| 18 |
</form> |
| 19 |
{{ else }} |
| 20 |
<p> |
| 21 |
<a href="{{ routePath "/oauth2/%s/redirect" "google" }}">{{ t "page.settings.link_google_account" }}</a> |
| 22 |
</p> |
| 23 |
{{ end }} |
| 24 |
</fieldset> |
| 25 |
{{ else if and (not disableLocalAuth) (hasOAuth2Provider "oidc") }} |
| 26 |
<fieldset> |
| 27 |
<legend>{{ t "form.prefs.fieldset.oidc_authentication" oidcProviderName }}</legend> |
| 28 |
{{ if .user.OpenIDConnectID }} |
| 29 |
<form method="post" action="{{ routePath "/oauth2/%s/unlink" "oidc" }}"> |
| 30 |
<input type="hidden" name="csrf" value="{{ .csrf }}"> |
| 31 |
<button type="submit" class="button button-danger" data-label-loading="{{ t "form.submit.saving" }}">{{ t "page.settings.unlink_oidc_account" oidcProviderName }}</button> |
| 32 |
</form> |
| 33 |
{{ else }} |
| 34 |
<p> |
| 35 |
<a href="{{ routePath "/oauth2/%s/redirect" "oidc" }}">{{ t "page.settings.link_oidc_account" oidcProviderName }}</a> |
| 36 |
</p> |
| 37 |
{{ end }} |
| 38 |
</fieldset> |
| 39 |
{{ end }} |
| 40 |
{{ if .webAuthnEnabled }} |
| 41 |
<fieldset> |
| 42 |
<legend>{{ t "page.settings.webauthn.passkeys" }}</legend> |
| 43 |
|
| 44 |
<template id="webauthn-error"> |
| 45 |
<div role="alert" class="alert alert-error" id="webauthn-error-alert"> |
| 46 |
<h4>{{ t "page.settings.webauthn.register.error" }}</h4> |
| 47 |
<p id="webauthn-error-message"></p> |
| 48 |
</div> |
| 49 |
</template> |
| 50 |
|
| 51 |
{{ if .webAuthnCerts}} |
| 52 |
<table> |
| 53 |
<tr> |
| 54 |
<th>{{ t "page.settings.webauthn.passkey_name" }}</th> |
| 55 |
<th>{{ t "page.settings.webauthn.added_on" }}</th> |
| 56 |
<th>{{ t "page.settings.webauthn.last_seen_on" }}</th> |
| 57 |
<th>{{ t "page.settings.webauthn.actions" }}</th> |
| 58 |
</tr> |
| 59 |
{{ range .webAuthnCerts }} |
| 60 |
<tr> |
| 61 |
<td>{{ .Name }}</td> |
| 62 |
<td>{{ elapsed $.user.Timezone .AddedOn }}</td> |
| 63 |
<td>{{ elapsed $.user.Timezone .LastSeenOn }}</td> |
| 64 |
<td> |
| 65 |
<a href="#" |
| 66 |
data-confirm="true" |
| 67 |
data-label-question="{{ t "confirm.question" }}" |
| 68 |
data-label-yes="{{ t "confirm.yes" }}" |
| 69 |
data-label-no="{{ t "confirm.no" }}" |
| 70 |
data-label-loading="{{ t "confirm.loading" }}" |
| 71 |
data-url="{{ routePath "/webauthn/%s/delete" .HandleEncoded }}">{{ icon "delete" }}{{ t "action.remove" }}</a> |
| 72 |
<a href="{{ routePath "/webauthn/%s/rename" .HandleEncoded }}">{{ icon "edit" }} {{ t "action.edit" }}</a> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
{{ end }} |
| 76 |
</table> |
| 77 |
{{ end }} |
| 78 |
|
| 79 |
<div class="buttons"> |
| 80 |
<button type="button" class="button button-primary" id="webauthn-register" disabled> |
| 81 |
{{ t "page.settings.webauthn.register" }} |
| 82 |
</button> |
| 83 |
{{ if gt .countWebAuthnCerts 0}} |
| 84 |
<button type="button" class="button button-danger" id="webauthn-delete"> |
| 85 |
{{ plural "page.settings.webauthn.delete" .countWebAuthnCerts .countWebAuthnCerts }} |
| 86 |
</button> |
| 87 |
{{ end }} |
| 88 |
</div> |
| 89 |
</fieldset> |
| 90 |
{{ end }} |
| 91 |
<form method="post" autocomplete="off" action="{{ routePath "/settings" }}"> |
| 92 |
<input type="hidden" name="csrf" value="{{ .csrf }}"> |
| 93 |
|
| 94 |
{{ if .errorMessage }} |
| 95 |
<div role="alert" class="alert alert-error">{{ .errorMessage }}</div> |
| 96 |
{{ end }} |
| 97 |
|
| 98 |
{{ if not disableLocalAuth }} |
| 99 |
<fieldset> |
| 100 |
<legend>{{ t "form.prefs.fieldset.authentication_settings" }}</legend> |
| 101 |
|
| 102 |
<label for="form-username">{{ t "form.user.label.username" }}</label> |
| 103 |
<input type="text" name="username" id="form-username" value="{{ .form.Username }}" autocomplete="username" required> |
| 104 |
|
| 105 |
<label for="form-password">{{ t "form.user.label.password" }}</label> |
| 106 |
<input type="password" name="password" id="form-password" value="{{ .form.Password }}" autocomplete="new-password"> |
| 107 |
|
| 108 |
<label for="form-confirmation">{{ t "form.user.label.confirmation" }}</label> |
| 109 |
<input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}" autocomplete="new-password"> |
| 110 |
|
| 111 |
<div class="buttons"> |
| 112 |
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button> |
| 113 |
</div> |
| 114 |
</fieldset> |
| 115 |
{{ end }} |
| 116 |
|
| 117 |
<fieldset> |
| 118 |
<legend>{{ t "form.prefs.fieldset.reader_settings" }}</legend> |
| 119 |
|
| 120 |
<label for="form-cjk-reading-speed">{{ t "form.prefs.label.cjk_reading_speed" }}</label> |
| 121 |
<input type="number" name="cjk_reading_speed" id="form-cjk-reading-speed" value="{{ .form.CJKReadingSpeed }}" min="1"> |
| 122 |
|
| 123 |
<label for="form-default-reading-speed">{{ t "form.prefs.label.default_reading_speed" }}</label> |
| 124 |
<input type="number" name="default_reading_speed" id="form-default-reading-speed" value="{{ .form.DefaultReadingSpeed }}" min="1"> |
| 125 |
|
| 126 |
<label for="form-media-playback-rate">{{ t "form.prefs.label.media_playback_rate" }}</label> |
| 127 |
<input type="number" name="media_playback_rate" id="form-media-playback-rate" value="{{ .form.MediaPlaybackRate }}" min="0.25" max="4" step="any" /> |
| 128 |
|
| 129 |
<label><input type="checkbox" name="show_reading_time" value="1" {{ if .form.ShowReadingTime }}checked{{ end }}> {{ t "form.prefs.label.show_reading_time" }}</label> |
| 130 |
|
| 131 |
<label><input type="radio" name="mark_read_behavior" value="{{ .readBehaviors.NoAutoMarkAsRead }}" |
| 132 |
{{ if eq .form.MarkReadBehavior .readBehaviors.NoAutoMarkAsRead }}checked{{end}} > {{ t "form.prefs.label.mark_read_manually" }}</label> |
| 133 |
<label><input type="radio" name="mark_read_behavior" value="{{ .readBehaviors.MarkAsReadOnView }}" |
| 134 |
{{ if eq .form.MarkReadBehavior .readBehaviors.MarkAsReadOnView }}checked{{end}} > {{ t "form.prefs.label.mark_read_on_view" }}</label> |
| 135 |
<label><input type="radio" name="mark_read_behavior" value="{{ .readBehaviors.MarkAsReadOnViewButWaitForPlayerCompletion }}" |
| 136 |
{{ if eq .form.MarkReadBehavior .readBehaviors.MarkAsReadOnViewButWaitForPlayerCompletion }}checked{{end}}> {{ t "form.prefs.label.mark_read_on_view_or_media_completion" }}</label> |
| 137 |
<label><input type="radio" name="mark_read_behavior" value="{{ .readBehaviors.MarkAsReadOnlyOnPlayerCompletion }}" |
| 138 |
{{ if eq .form.MarkReadBehavior .readBehaviors.MarkAsReadOnlyOnPlayerCompletion }}checked{{end}} > {{ t "form.prefs.label.mark_read_on_media_completion" }}</label> |
| 139 |
|
| 140 |
<div class="buttons"> |
| 141 |
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button> |
| 142 |
</div> |
| 143 |
</fieldset> |
| 144 |
|
| 145 |
<fieldset> |
| 146 |
<legend>{{ t "form.prefs.fieldset.application_settings" }}</legend> |
| 147 |
|
| 148 |
<label for="form-language">{{ t "form.prefs.label.language" }}</label> |
| 149 |
<select id="form-language" name="language"> |
| 150 |
{{ range $key, $value := .languages }} |
| 151 |
<option value="{{ $key }}" {{ if eq $key $.form.Language }}selected="selected"{{ end }}>{{ $value }}</option> |
| 152 |
{{ end }} |
| 153 |
</select> |
| 154 |
|
| 155 |
<label for="form-timezone">{{ t "form.prefs.label.timezone" }}</label> |
| 156 |
<select id="form-timezone" name="timezone"> |
| 157 |
{{ range $value := .timezones }} |
| 158 |
<option value="{{ $value }}" {{ if eq $value $.form.Timezone }}selected="selected"{{ end }}>{{ $value }}</option> |
| 159 |
{{ end }} |
| 160 |
</select> |
| 161 |
|
| 162 |
<label for="form-theme">{{ t "form.prefs.label.theme" }}</label> |
| 163 |
<select id="form-theme" name="theme"> |
| 164 |
{{ range $key, $value := .themes }} |
| 165 |
<option value="{{ $key }}" {{ if eq $key $.form.Theme }}selected="selected"{{ end }}>{{ $value }}</option> |
| 166 |
{{ end }} |
| 167 |
</select> |
| 168 |
|
| 169 |
<div class="form-label-row"> |
| 170 |
<label for="form-display-mode">{{ t "form.prefs.label.display_mode" }}</label> |
| 171 |
|
| 172 |
<a href="https://developer.mozilla.org/en-US/docs/Web/Manifest/display" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}> |
| 173 |
{{ icon "external-link" }} |
| 174 |
</a> |
| 175 |
</div> |
| 176 |
<select id="form-display-mode" name="display_mode"> |
| 177 |
<option value="fullscreen" {{ if eq "fullscreen" $.form.DisplayMode }}selected="selected"{{ end }}>{{ t "form.prefs.select.fullscreen" }}</option> |
| 178 |
<option value="standalone" {{ if eq "standalone" $.form.DisplayMode }}selected="selected"{{ end }}>{{ t "form.prefs.select.standalone" }}</option> |
| 179 |
<option value="minimal-ui" {{ if eq "minimal-ui" $.form.DisplayMode }}selected="selected"{{ end }}>{{ t "form.prefs.select.minimal_ui" }}</option> |
| 180 |
<option value="browser" {{ if eq "browser" $.form.DisplayMode }}selected="selected"{{ end }}>{{ t "form.prefs.select.browser" }}</option> |
| 181 |
</select> |
| 182 |
|
| 183 |
<label for="form-default-home-page">{{ t "form.prefs.label.default_home_page" }}</label> |
| 184 |
<select id="form-default-home-page" name="default_home_page"> |
| 185 |
{{ range $key, $value := .default_home_pages }} |
| 186 |
<option value="{{ $key }}" {{ if eq $key $.form.DefaultHomePage }}selected="selected"{{ end }}>{{ t $value }}</option> |
| 187 |
{{ end }} |
| 188 |
</select> |
| 189 |
|
| 190 |
<label for="form-entry-direction">{{ t "form.prefs.label.entry_sorting" }}</label> |
| 191 |
<select id="form-entry-direction" name="entry_direction"> |
| 192 |
<option value="asc" {{ if eq "asc" $.form.EntryDirection }}selected="selected"{{ end }}>{{ t "form.prefs.select.older_first" }}</option> |
| 193 |
<option value="desc" {{ if eq "desc" $.form.EntryDirection }}selected="selected"{{ end }}>{{ t "form.prefs.select.recent_first" }}</option> |
| 194 |
</select> |
| 195 |
|
| 196 |
<label for="form-entry-order">{{ t "form.prefs.label.entry_order" }}</label> |
| 197 |
<select id="form-entry-order" name="entry_order"> |
| 198 |
<option value="published_at" {{ if eq "published_at" $.form.EntryOrder }}selected="selected"{{ end }}>{{ t "form.prefs.select.publish_time" }}</option> |
| 199 |
<option value="created_at" {{ if eq "created_at" $.form.EntryOrder }}selected="selected"{{ end }}>{{ t "form.prefs.select.created_time" }}</option> |
| 200 |
</select> |
| 201 |
|
| 202 |
<label for="form-categories-sorting-order">{{ t "form.prefs.label.categories_sorting_order" }}</label> |
| 203 |
<select id="form-categories-sorting-order" name="categories_sorting_order"> |
| 204 |
{{ range $key, $value := .categories_sorting_options }} |
| 205 |
<option value="{{ $key }}" {{ if eq $key $.form.CategoriesSortingOrder }}selected="selected"{{ end }}>{{ t $value }}</option> |
| 206 |
{{ end }} |
| 207 |
</select> |
| 208 |
|
| 209 |
<label for="form-gesture-nav">{{ t "form.prefs.label.gesture_nav" }}</label> |
| 210 |
<select id="form-gesture-nav" name="gesture_nav"> |
| 211 |
<option value="none" {{ if eq "none" $.form.GestureNav }}selected="selected"{{ end }}>{{ t "form.prefs.select.none" }}</option> |
| 212 |
<option value="tap" {{ if eq "tap" $.form.GestureNav }}selected="selected"{{ end }}>{{ t "form.prefs.select.tap" }}</option> |
| 213 |
<option value="swipe" {{ if eq "swipe" $.form.GestureNav }}selected="selected"{{ end }}>{{ t "form.prefs.select.swipe" }}</option> |
| 214 |
</select> |
| 215 |
|
| 216 |
<label for="form-entries-per-page">{{ t "form.prefs.label.entries_per_page" }}</label> |
| 217 |
<input type="number" name="entries_per_page" id="form-entries-per-page" value="{{ .form.EntriesPerPage }}" min="1" max="{{ .maxEntriesPerPage }}"> |
| 218 |
|
| 219 |
<label><input type="checkbox" name="keyboard_shortcuts" value="1" {{ if .form.KeyboardShortcuts }}checked{{ end }}> {{ t "form.prefs.label.keyboard_shortcuts" }}</label> |
| 220 |
|
| 221 |
<label><input type="checkbox" name="entry_swipe" value="1" {{ if .form.EntrySwipe }}checked{{ end }}> {{ t "form.prefs.label.entry_swipe" }}</label> |
| 222 |
|
| 223 |
<label><input type="checkbox" name="always_open_external_links" value="1" {{ if .form.AlwaysOpenExternalLinks }}checked{{ end }}> {{ t "form.prefs.label.always_open_external_links" }}</label> |
| 224 |
|
| 225 |
<label><input type="checkbox" name="open_external_links_in_new_tab" value="1" {{ if .form.OpenExternalLinksInNewTab }}checked{{ end }}> {{ t "form.prefs.label.open_external_links_in_new_tab" }}</label> |
| 226 |
|
| 227 |
<label for="form-custom-css">{{t "form.prefs.label.custom_css" }}</label> |
| 228 |
<textarea id="form-custom-css" name="custom_css" cols="40" rows="10" spellcheck="false">{{ .form.CustomCSS }}</textarea> |
| 229 |
|
| 230 |
<label for="form-external-font-hosts">{{t "form.prefs.label.external_font_hosts" }}</label> |
| 231 |
<input type="text" id="form-external-font-hosts" name="external_font_hosts" spellcheck="false" value="{{ .form.ExternalFontHosts }}"> |
| 232 |
<div class="form-help">{{t "form.prefs.help.external_font_hosts" }}</div> |
| 233 |
|
| 234 |
<label for="form-custom-js">{{t "form.prefs.label.custom_js" }}</label> |
| 235 |
<textarea id="form-custom-js" name="custom_js" cols="40" rows="10" spellcheck="false">{{ .form.CustomJS }}</textarea> |
| 236 |
|
| 237 |
<div class="buttons"> |
| 238 |
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button> |
| 239 |
</div> |
| 240 |
</fieldset> |
| 241 |
|
| 242 |
<fieldset> |
| 243 |
<legend>{{ t "form.prefs.fieldset.global_feed_settings" }}</legend> |
| 244 |
<div class="form-label-row"> |
| 245 |
<label for="form-block-filter-rules"> |
| 246 |
{{ t "form.feed.label.block_filter_entry_rules" }} |
| 247 |
</label> |
| 248 |
|
| 249 |
<a href=" https://miniflux.app/docs/rules.html#filtering-rules" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}> |
| 250 |
{{ icon "external-link" }} |
| 251 |
</a> |
| 252 |
</div> |
| 253 |
<textarea id="form-block-filter-rules" name="block_filter_entry_rules" cols="40" rows="10" spellcheck="false">{{ .form.BlockFilterEntryRules }}</textarea> |
| 254 |
|
| 255 |
<div class="form-label-row"> |
| 256 |
<label for="form-keep-filter-rules"> |
| 257 |
{{ t "form.feed.label.keep_filter_entry_rules" }} |
| 258 |
</label> |
| 259 |
|
| 260 |
<a href=" https://miniflux.app/docs/rules.html#filtering-rules" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}> |
| 261 |
{{ icon "external-link" }} |
| 262 |
</a> |
| 263 |
</div> |
| 264 |
<textarea id="form-keep-filter-rules" name="keep_filter_entry_rules" cols="40" rows="10" spellcheck="false">{{ .form.KeepFilterEntryRules }}</textarea> |
| 265 |
|
| 266 |
<div class="buttons"> |
| 267 |
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button> |
| 268 |
</div> |
| 269 |
</fieldset> |
| 270 |
</form> |
| 271 |
|
| 272 |
{{ end }} |