aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/user.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-01-20 10:22:19 +0100
committervincent-peugnet <v.peugnet@free.fr>2020-01-20 10:22:19 +0100
commit9fc3c177b3228f7d68ce464a7d5056002ca9a8d0 (patch)
tree3d253664ce27d8eee5b68f314c11dae96a515a84 /app/view/templates/user.php
parent8567e8fd802a379d63b9e019123d7f29f6e28f81 (diff)
downloadwcms-9fc3c177b3228f7d68ce464a7d5056002ca9a8d0.tar.gz
wcms-9fc3c177b3228f7d68ce464a7d5056002ca9a8d0.zip
refactoring ui for info user admin sections
Diffstat (limited to 'app/view/templates/user.php')
-rw-r--r--app/view/templates/user.php259
1 files changed, 138 insertions, 121 deletions
diff --git a/app/view/templates/user.php b/app/view/templates/user.php
index 21a7639..f281c93 100644
--- a/app/view/templates/user.php
+++ b/app/view/templates/user.php
@@ -10,157 +10,174 @@
<main class="user">
-<section>
+ <section>
+ <div class="block">
-<article>
+
+ <h1>User : <?= $user->id() ?></h1>
+
+ <div class="scroll">
-<h1>User : <?= $user->id() ?></h1>
-<h2>Infos</h2>
+ <h2>Infos</h2>
-<p>Connections count : <?= $getuser->connectcount() ?></p>
+ <p>Connections count : <?= $getuser->connectcount() ?></p>
-<p>Account will expire in : <?= $getuser->expiredate('hrdi') ?></p>
+ <p>Account will expire in : <?= $getuser->expiredate('hrdi') ?></p>
-<h2>Preferences</h2>
+ <h2>Preferences</h2>
-<form action="<?= $this->url('userpref') ?>" method="post">
+ <form action="<?= $this->url('userpref') ?>" method="post">
-<p>
- <input type="number" name="cookie" value="<?= $getuser->cookie() ?>" id="cookie" min="0" max="365">
- <label for="cookie">Cookie conservation time <i>(In days)</i></label>
- <input type="submit" value="submit">
-</p>
-
-</form>
-
-</article>
-
-
-<?php if($user->isadmin()) { ?>
-
-<article>
-
-<h1>Admin panel</h1>
-
-<table>
-<tr>
-<th>id</th><th>password</th><th>hash</th><th>level</th><th>set expiration date</th><th>action</th><th>expire</th><th>connect</th>
-</tr>
-
-<tr>
- <form action="<?= $this->url('useradd') ?>" method="post">
- <td>
- <input type="text" name="id" maxlength="128" required>
- </td>
- <td>
- <input type="password" name="password" minlength="4" maxlength="64" required>
- </td>
-
- <td>
- <input type="hidden" name="passwordhashed" value="0">
- <input type="checkbox" name="passwordhashed" value="1">
- </td>
-
- <td>
- <select name="level" id="level">
- <option value="1">reader</option>
- <option value="2">invite</option>
- <option value="3">editor</option>
- <option value="4">super editor</option>
- <option value="10">admin</option>
- </select>
- </td>
- <td>
- <input type="date" name="expiredate" id="expiredate" min="<?= $now ?>">
- </td>
- <td>
- <input type="submit" value="add">
- </td>
- <td>
-
- </td>
- <td>
-
- </td>
-
- </form>
-</tr>
+ <p>
+ <input type="number" name="cookie" value="<?= $getuser->cookie() ?>" id="cookie" min="0" max="365">
+ <label for="cookie">Cookie conservation time <i>(In days)</i></label>
+ <input type="submit" value="submit">
+ </p>
+
+ </form>
+
+
+ </div>
+
+
+ </div>
+ </section>
-<?php
-foreach ($userlist as $user ) {
- ?>
- <tr>
- <form action="<?= $this->url('userupdate') ?>" method="post">
-
- <td>
- <?= $user->id() ?>
- </td>
-
- <td>
- <input type="password" name="password" minlength="4" maxlength="64" >
- </td>
-
- <td>
- <?= $user->passwordhashed() ? '🔑' : '<input type="hidden" name="passwordhashed" value="0"><input type="checkbox" name="passwordhashed" value="1">' ?>
- </td>
-
- <td>
- <select name="level" id="level">
- <option value="1" <?= $user->level() === 1 ? 'selected' : '' ?>>reader</option>
- <option value="2" <?= $user->level() === 2 ? 'selected' : '' ?>>invite</option>
- <option value="3" <?= $user->level() === 3 ? 'selected' : '' ?>>editor</option>
- <option value="4" <?= $user->level() === 4 ? 'selected' : '' ?>>super editor</option>
- <option value="10" <?= $user->level() === 10 ? 'selected' : '' ?>>admin</option>
- </select>
- </td>
-
-
- <td>
- <input type="date" name="expiredate" id="expiredate"<?= $user->expiredate() !== false ? 'value="' . $user->expiredate('string') . '"' : '' ?>>
- <span>reset<input type="checkbox" name="expiredate" id="expiredate" value="null"></span>
+ <?php if($user->isadmin()) { ?>
+
+ <section>
- </td>
+ <div class="block">
+
+ <h1>Admin panel</h1>
+
+ <div class="scroll">
+
+ <table>
+ <tr>
+ <th>id</th><th>password</th><th>hash</th><th>level</th><th>set expiration date</th><th>action</th><th>expire</th><th>connect</th>
+ </tr>
+
+ <tr>
+ <form action="<?= $this->url('useradd') ?>" method="post">
+ <td>
+ <input type="text" name="id" maxlength="128" required>
+ </td>
+ <td>
+ <input type="password" name="password" minlength="4" maxlength="64" required>
+ </td>
+
+ <td>
+ <input type="hidden" name="passwordhashed" value="0">
+ <input type="checkbox" name="passwordhashed" value="1">
+ </td>
+
+ <td>
+ <select name="level" id="level">
+ <option value="1">reader</option>
+ <option value="2">invite</option>
+ <option value="3">editor</option>
+ <option value="4">super editor</option>
+ <option value="10">admin</option>
+ </select>
+ </td>
+ <td>
+ <input type="date" name="expiredate" id="expiredate" min="<?= $now ?>">
+ </td>
+ <td>
+ <input type="submit" value="add">
+ </td>
+ <td>
+
+ </td>
+ <td>
+
+ </td>
+
+ </form>
+ </tr>
+
+
+ <?php
+ foreach ($userlist as $user ) {
+ ?>
+
+ <tr>
+ <form action="<?= $this->url('userupdate') ?>" method="post">
+
+ <td>
+ <?= $user->id() ?>
+ </td>
+
+ <td>
+ <input type="password" name="password" minlength="4" maxlength="64" >
+ </td>
+
+ <td>
+ <?= $user->passwordhashed() ? '🔑' : '<input type="hidden" name="passwordhashed" value="0"><input type="checkbox" name="passwordhashed" value="1">' ?>
+ </td>
+
+ <td>
+ <select name="level" id="level">
+ <option value="1" <?= $user->level() === 1 ? 'selected' : '' ?>>reader</option>
+ <option value="2" <?= $user->level() === 2 ? 'selected' : '' ?>>invite</option>
+ <option value="3" <?= $user->level() === 3 ? 'selected' : '' ?>>editor</option>
+ <option value="4" <?= $user->level() === 4 ? 'selected' : '' ?>>super editor</option>
+ <option value="10" <?= $user->level() === 10 ? 'selected' : '' ?>>admin</option>
+ </select>
+ </td>
+
+
+ <td>
+ <input type="date" name="expiredate" id="expiredate"<?= $user->expiredate() !== false ? 'value="' . $user->expiredate('string') . '"' : '' ?>>
+ <span>reset<input type="checkbox" name="expiredate" id="expiredate" value="null"></span>
+
+ </td>
+
+ <td>
+ <input type="hidden" name="id" value="<?= $user->id() ?>">
+ <input type="submit" name="action" value="update">
+ <input type="submit" name="action" value="delete">
+ </form>
+
+ </td>
+
- <td>
- <input type="hidden" name="id" value="<?= $user->id() ?>">
- <input type="submit" name="action" value="update">
- <input type="submit" name="action" value="delete">
- </form>
- </td>
+ <td>
+ <?= $user->expiredate('hrdi') ?>
+ </td>
+ <td>
+ <?= $user->connectcount() ?>
+ </td>
- <td>
- <?= $user->expiredate('hrdi') ?>
- </td>
+ </tr>
- <td>
- <?= $user->connectcount() ?>
- </td>
+ <?php
+ }
+ ?>
+ </table>
- </tr>
- <?php
- }
-?>
+ </div>
-</table>
+ </div>
-</article>
-<?php } ?>
+ </section>
+ <?php } ?>
-</section>
</main>