summaryrefslogtreecommitdiff
path: root/templates/user_index.php
diff options
context:
space:
mode:
Diffstat (limited to 'templates/user_index.php')
-rw-r--r--templates/user_index.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/templates/user_index.php b/templates/user_index.php
new file mode 100644
index 00000000..c83a5417
--- /dev/null
+++ b/templates/user_index.php
@@ -0,0 +1,46 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= t('Users') ?><span id="page-counter"> (<?= $nb_users ?>)</span></h2>
+ <ul>
+ <li><a href="?controller=user&amp;action=create"><?= t('New user') ?></a></li>
+ </ul>
+ </div>
+ <section>
+ <?php if (empty($users)): ?>
+ <p class="alert"><?= t('No user') ?></p>
+ <?php else: ?>
+ <table>
+ <tr>
+ <th><?= t('Username') ?></th>
+ <th><?= t('Administrator') ?></th>
+ <th><?= t('Default Project') ?></th>
+ <?php if ($_SESSION['user']['is_admin'] == 1): ?>
+ <th><?= t('Actions') ?></th>
+ <?php endif ?>
+ </tr>
+ <?php foreach ($users as $user): ?>
+ <tr>
+ <td>
+ <?= Helper\escape($user['username']) ?>
+ </td>
+ <td>
+ <?= $user['is_admin'] ? t('Yes') : t('No') ?>
+ </td>
+ <td>
+ <?= $projects[$user['default_project_id']] ?>
+ </td>
+ <?php if ($_SESSION['user']['is_admin'] == 1): ?>
+ <td>
+ <a href="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>"><?= t('edit') ?></a>
+ <?php if (count($users) > 1): ?>
+ <?= t('or') ?>
+ <a href="?controller=user&amp;action=confirm&amp;user_id=<?= $user['id'] ?>"><?= t('remove') ?></a>
+ <?php endif ?>
+ </td>
+ <?php endif ?>
+ </tr>
+ <?php endforeach ?>
+ </table>
+ <?php endif ?>
+ </section>
+</section> \ No newline at end of file