aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/change_password_form.php24
-rw-r--r--templates/preferences_page.php3
2 files changed, 27 insertions, 0 deletions
diff --git a/templates/change_password_form.php b/templates/change_password_form.php
new file mode 100644
index 0000000..7a463fd
--- /dev/null
+++ b/templates/change_password_form.php
@@ -0,0 +1,24 @@
+<form method="post" action="/todo" hx-post="/fragment/changePassword" hx-disabled-elt="find button" hx-swap="outerHTML">
+ <div class="row">
+ <label for="changePassword-current"><?= __('changePassword.currentPassword') ?></label>
+ <input type="password" id="changePassword-current" name="current" autocomplete="off" required
+ value="<?= $current ?? '' ?>">
+ </div>
+ <div class="row">
+ <label for="changePassword-new"><?= __('changePassword.newPassword') ?></label>
+ <input type="password" id="changePassword-new" name="new" autocomplete="off" required value="<?= $new ?? '' ?>">
+ </div>
+ <div class="row">
+ <label for="changePassword-newRepeat"><?= __('changePassword.newPassword.repeat') ?></label>
+ <input type="password" id="changePassword-newRepeat" name="newRepeat" autocomplete="off" required
+ value="<?= $newRepeat ?? '' ?>">
+ </div>
+ <div class="row">
+ <button class="primary"><?= __('changePassword.action') ?></button>
+ </div>
+ <?php if (isset($error)): ?>
+ <p class="error"><?= htmlspecialchars($error) ?></p>
+ <?php elseif ($success ?? false): ?>
+ <span class="temporaryIndicator"><?= __('changePassword.success') ?></span>
+ <?php endif; ?>
+</form> \ No newline at end of file
diff --git a/templates/preferences_page.php b/templates/preferences_page.php
index bcb39b6..2744747 100644
--- a/templates/preferences_page.php
+++ b/templates/preferences_page.php
@@ -1,4 +1,7 @@
<?php call_template('skeleton', ['pageTitle' => __('preferences.pageTitle')], function () {
global $user, $saved;
call_template('preferences_form', ['user' => $user, 'saved' => $saved ?? false]);
+ ?>
+ <h2><?= __('changePassword.heading') ?></h2>
+ <?php call_template('change_password_form');
}); \ No newline at end of file