mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
The Retention page (#6789) showed only the variable names (ATTACHMENTS_RETENTION_DAYS, ...), the raw choices uploaded and card-inactive, and Default () with nothing between the brackets whenever the variable was set but empty - which is what a Helm chart or a docker-compose file listing the variable does. Catalog fields (models/lib/authConfigCatalog.js) can name a labelKey, a helpKey and choiceLabelKeys: the form shows the translated label with the variable name beside it, a help line, and the choices by name. Fields without them look as before. An empty variable is unset for the value shown, as the retention code itself reads it, so the default is shown again; yes/no defaults are translated. The five retention fields use them; seven new strings in every language (low confidence for the rarest and constructed ones). From the reporter's patch. Thanks to Raymond-Voogt and xet7 ! Fixes #6819.
83 lines
4.3 KiB
Plaintext
83 lines
4.3 KiB
Plaintext
//- A catalog-driven override form. Empty values inherit the environment/default.
|
|
//- Used by SAML (models/lib/samlConfig.js) and by every section of
|
|
//- models/lib/authConfigCatalog.js (LDAP, OAuth2/OIDC, CAS, Header login, Login).
|
|
//- A secret is never sent to the browser: its input is always empty, and the
|
|
//- line under it says only whether one is set and where it comes from.
|
|
template(name="authProviderSettings")
|
|
if currentUser.isAdmin
|
|
if error.get
|
|
.warning {{error.get}}
|
|
if loaded.get
|
|
form.js-auth-provider-settings
|
|
if sectionEnvOnly
|
|
p.description {{_ 'login-setting-env-only'}}
|
|
ul.setting-detail
|
|
each fields
|
|
li.accounts-form
|
|
if labelKey
|
|
label(for="auth-{{key}}")
|
|
| {{_ labelKey}}
|
|
span.quiet ({{envVar}})
|
|
else
|
|
label(for="auth-{{key}}")= envVar
|
|
.form-group
|
|
//- Environment-only (Header login): the value in effect,
|
|
//- read-only, and no js-auth-config-field so nothing is saved.
|
|
if envOnly
|
|
input.wekan-form-control(id="auth-{{key}}" type="text" value="{{effective}}" readonly)
|
|
else if booleanField
|
|
select.wekan-form-control.js-auth-config-field(id="auth-{{key}}" data-key="{{key}}" data-boolean="true")
|
|
option(value="" selected=inherit) {{_ 'default'}} ({{effective}})
|
|
option(value="true" selected=enabled) {{_ 'yes'}}
|
|
option(value="false" selected=disabled) {{_ 'no'}}
|
|
else if choiceField
|
|
select.wekan-form-control.js-auth-config-field(id="auth-{{key}}" data-key="{{key}}")
|
|
option(value="" selected=inherit) {{_ 'default'}} ({{effective}})
|
|
each choiceOptions
|
|
option(value="{{value}}" selected=selected)= label
|
|
else if secretField
|
|
.description.js-auth-secret-status(data-key="{{key}}")= secretStatus
|
|
input.wekan-form-control.js-auth-config-field(id="auth-{{key}}" data-key="{{key}}" type="password" value="" autocomplete="new-password" placeholder="{{_ 'password'}}")
|
|
if secretStoredHere
|
|
label.auth-secret-clear
|
|
input.js-auth-secret-clear(type="checkbox" data-key="{{key}}")
|
|
| {{_ 'login-setting-clear-secret'}}
|
|
else if multiline
|
|
textarea.wekan-form-control.js-auth-config-field(id="auth-{{key}}" data-key="{{key}}" rows="5" placeholder="{{effective}}")= value
|
|
else if numberField
|
|
input.wekan-form-control.js-auth-config-field(id="auth-{{key}}" data-key="{{key}}" type="number" min="0" value="{{value}}" placeholder="{{effective}}")
|
|
else
|
|
input.wekan-form-control.js-auth-config-field(id="auth-{{key}}" data-key="{{key}}" type="text" value="{{value}}" placeholder="{{effective}}")
|
|
unless secretField
|
|
span.ldap-source-badge= sourceLabel
|
|
if helpKey
|
|
.description {{_ helpKey}}
|
|
if restart
|
|
.description {{_ 'login-setting-after-restart'}}
|
|
unless sectionEnvOnly
|
|
li
|
|
button.primary.js-auth-provider-save(type="submit" disabled=busy.get) {{_ 'save'}}
|
|
each urls
|
|
p
|
|
a(href="{{url}}" target="_blank" rel="noopener noreferrer")= url
|
|
else
|
|
+spinner
|
|
|
|
//- LDAP / Test connection, under the LDAP section. Runs the admin-only
|
|
//- ldap_test_connection method against the settings in effect (Admin Panel
|
|
//- value, else LDAP_* environment variable).
|
|
template(name="ldapTestConnection")
|
|
ul.setting-detail
|
|
li.accounts-form
|
|
button.js-ldap-test-connection.primary {{_ 'ldap-test-connection'}}
|
|
if result.get
|
|
li.accounts-form
|
|
span(class="{{resultClass}}")= result.get
|
|
//- Sync now: runs the LDAP background sync once (ldap_sync_now), with the
|
|
//- import/update settings in effect.
|
|
li.accounts-form
|
|
button.js-ldap-sync-now.primary(disabled=syncing.get) {{_ 'ldap-sync-now'}}
|
|
if syncResult.get
|
|
li.accounts-form
|
|
span.js-ldap-sync-result(class="{{syncResultClass}}")= syncResult.get
|