aboutsummaryrefslogtreecommitdiff
path: root/app/views/auth
diff options
context:
space:
mode:
authorGravatar Inverle <inverle@proton.me> 2025-08-08 17:39:38 +0200
committerGravatar GitHub <noreply@github.com> 2025-08-08 17:39:38 +0200
commitd9197d7e32a97f29829ffd4cf4371b1853e51fa2 (patch)
tree83549245e159f9cbdad05868a359afcf278bec79 /app/views/auth
parenta3854c2f5978ab40c023c8bdf9b4be96eca3ef22 (diff)
New JS attribute: `data-auto-leave-validation` (#7785)
Instead of a repeating pattern like: `<input type="text" value="something" data-leave-validation="something">`, you can now put a `data-auto-leave-validation="1"` attribute on a `<form>` for example, and it will automatically set the `data-leave-validation` attributes inside the form elements. `data_auto_leave_validation(parent)` from `extra.js` is called on slider open and page load. --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Diffstat (limited to 'app/views/auth')
-rw-r--r--app/views/auth/index.phtml12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml
index c36134177..a0aa28256 100644
--- a/app/views/auth/index.phtml
+++ b/app/views/auth/index.phtml
@@ -5,13 +5,13 @@
?>
<main class="post">
<h1><?= _t('gen.menu.authentication') ?></h1>
- <form method="post" action="<?= _url('auth', 'index') ?>">
+ <form method="post" action="<?= _url('auth', 'index') ?>" data-auto-leave-validation="1">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<div class="form-group">
<label class="group-name" for="auth_type"><?= _t('admin.auth.type') ?></label>
<div class="group-controls">
- <select id="auth_type" name="auth_type" required="required" data-leave-validation="<?= FreshRSS_Context::systemConf()->auth_type ?>">
+ <select id="auth_type" name="auth_type" required="required">
<?php if (!in_array(FreshRSS_Context::systemConf()->auth_type, ['form', 'http_auth', 'none'], true)) { ?>
<option selected="selected"></option>
<?php } ?>
@@ -29,7 +29,7 @@
<label class="checkbox" for="anon_access">
<input type="checkbox" name="anon_access" id="anon_access" value="1"<?=
FreshRSS_Context::systemConf()->allow_anonymous ? ' checked="checked"' : '',
- FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->allow_anonymous ?>"/>
+ FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
<?= _t('admin.auth.allow_anonymous', FreshRSS_Context::systemConf()->default_user) ?>
</label>
</div>
@@ -40,7 +40,7 @@
<label class="checkbox" for="anon_refresh">
<input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?=
FreshRSS_Context::systemConf()->allow_anonymous_refresh ? ' checked="checked"' : '',
- FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->allow_anonymous_refresh ?>"/>
+ FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
<?= _t('admin.auth.allow_anonymous_refresh') ?>
</label>
</div>
@@ -51,7 +51,7 @@
<label class="checkbox" for="unsafe_autologin">
<input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?=
FreshRSS_Context::systemConf()->unsafe_autologin_enabled ? ' checked="checked"' : '',
- FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->unsafe_autologin_enabled ?>"/>
+ FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
<?= _t('admin.auth.unsafe_autologin') ?>
<kbd><?= Minz_Url::display(['c' => 'auth', 'a' => 'login', 'params' => ['u' => 'alice', 'p' => '1234']], 'html', true) ?></kbd>
</label>
@@ -63,7 +63,7 @@
<label class="checkbox" for="api_enabled">
<input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?=
FreshRSS_Context::systemConf()->api_enabled ? ' checked="checked"' : '',
- FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"' ?> data-leave-validation="<?= FreshRSS_Context::systemConf()->api_enabled ?>"/>
+ FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"' ?> />
<?= _t('admin.auth.api_enabled') ?>
</label>
</div>