aboutsummaryrefslogtreecommitdiff
path: root/app/views/user
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/user
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/user')
-rw-r--r--app/views/user/details.phtml2
-rw-r--r--app/views/user/manage.phtml2
-rw-r--r--app/views/user/profile.phtml4
3 files changed, 4 insertions, 4 deletions
diff --git a/app/views/user/details.phtml b/app/views/user/details.phtml
index b85ff4fea..2840586bf 100644
--- a/app/views/user/details.phtml
+++ b/app/views/user/details.phtml
@@ -10,7 +10,7 @@
?>
<div class="post">
<h2><?= $this->username ?><?php if ($isAdmin) echo ' ― ', _t('admin.user.admin'); ?></h2>
- <form method="post" action="<?= _url('user', 'manage', 'username', $this->username); ?>">
+ <form method="post" action="<?= _url('user', 'manage', 'username', $this->username); ?>" data-auto-leave-validation="1">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken(); ?>" />
<div class="form-group">
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml
index 84e8afb0a..d416d0c0c 100644
--- a/app/views/user/manage.phtml
+++ b/app/views/user/manage.phtml
@@ -6,7 +6,7 @@
<main class="post">
<h1><?= _t('gen.menu.user_management') ?></h1>
<h2><?= _t('admin.user.create') ?></h2>
- <form method="post" action="<?= _url('user', 'create') ?>" autocomplete="off">
+ <form method="post" action="<?= _url('user', 'create') ?>" autocomplete="off" data-auto-leave-validation="1">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<input type="hidden" name="originController" value="<?= Minz_Request::controllerName() ?>" />
<input type="hidden" name="originAction" value="<?= Minz_Request::actionName() ?>" />
diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml
index 5f7991887..d49147c59 100644
--- a/app/views/user/profile.phtml
+++ b/app/views/user/profile.phtml
@@ -7,7 +7,7 @@
?>
<main class="post">
- <form id="crypto-form" method="post" action="<?= _url('user', 'profile') ?>">
+ <form id="crypto-form" method="post" action="<?= _url('user', 'profile') ?>" data-auto-leave-validation="1">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<h1><?= _t('conf.profile') ?></h1>
@@ -41,7 +41,7 @@
<label class="group-name" for="token"><?= _t('admin.auth.token') ?></label>
<?php $token = FreshRSS_Context::userConf()->token; ?>
<div class="group-controls">
- <input type="text" id="token" name="token" value="<?= $token ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" data-leave-validation="<?= $token ?>"/>
+ <input type="text" id="token" name="token" value="<?= $token ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
<p class="help"><?= _i('help') ?> <?= _t('admin.auth.token_help') ?></p>
<kbd><?= Minz_Url::display(['a' => 'rss', 'params' => ['user' => Minz_User::name() ?? '',
'token' => $token, 'hours' => FreshRSS_Context::userConf()->since_hours_posts_per_rss]], 'html', true) ?></kbd>