diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-11-25 22:06:39 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-11-25 22:06:39 -0500 |
commit | e582d4047b061f0c17e6366fed2bf1cabd624c10 (patch) | |
tree | 4f400b1df198103fb257d468b1aab8c625f32d29 /app/Template | |
parent | a8da794b60029c23424ee330e020d18f5f9ac947 (diff) |
Add groups (teams)
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/group/associate.php | 25 | ||||
-rw-r--r-- | app/Template/group/create.php | 19 | ||||
-rw-r--r-- | app/Template/group/dissociate.php | 19 | ||||
-rw-r--r-- | app/Template/group/edit.php | 22 | ||||
-rw-r--r-- | app/Template/group/index.php | 45 | ||||
-rw-r--r-- | app/Template/group/remove.php | 19 | ||||
-rw-r--r-- | app/Template/group/users.php | 44 | ||||
-rw-r--r-- | app/Template/user/create_local.php | 2 | ||||
-rw-r--r-- | app/Template/user/index.php | 1 |
9 files changed, 195 insertions, 1 deletions
diff --git a/app/Template/group/associate.php b/app/Template/group/associate.php new file mode 100644 index 00000000..dc665bb3 --- /dev/null +++ b/app/Template/group/associate.php @@ -0,0 +1,25 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + </ul> + </div> + <?php if (empty($users)): ?> + <p class="alert"><?= t('There is no user available.') ?></p> + <?php else: ?> + <form method="post" action="<?= $this->url->href('group', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('group_id', $values) ?> + + <?= $this->form->label(t('User'), 'user_id') ?> + <?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?><br/> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </form> + <?php endif ?> +</section> diff --git a/app/Template/group/create.php b/app/Template/group/create.php new file mode 100644 index 00000000..696e5013 --- /dev/null +++ b/app/Template/group/create.php @@ -0,0 +1,19 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + </ul> + </div> + <form method="post" action="<?= $this->url->href('group', 'save') ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?><br/> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </form> +</section> diff --git a/app/Template/group/dissociate.php b/app/Template/group/dissociate.php new file mode 100644 index 00000000..2b0b1af4 --- /dev/null +++ b/app/Template/group/dissociate.php @@ -0,0 +1,19 @@ +<section id="main"> + <div class="page-header"> + <?php if ($this->user->isAdmin()): ?> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + </ul> + <?php endif ?> + </div> + <div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove the user "%s" from the group "%s"?', $user['name'] ?: $user['username'], $group['name']) ?></p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'group', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'users', array('group_id' => $group['id'])) ?> + </div> + </div> +</section> diff --git a/app/Template/group/edit.php b/app/Template/group/edit.php new file mode 100644 index 00000000..4d7e5e81 --- /dev/null +++ b/app/Template/group/edit.php @@ -0,0 +1,22 @@ +<section id="main"> + <div class="page-header"> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + </ul> + </div> + <form method="post" action="<?= $this->url->href('group', 'update') ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('external_id', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?><br/> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </form> +</section> diff --git a/app/Template/group/index.php b/app/Template/group/index.php new file mode 100644 index 00000000..24de02a0 --- /dev/null +++ b/app/Template/group/index.php @@ -0,0 +1,45 @@ +<section id="main"> + <div class="page-header"> + <?php if ($this->user->isAdmin()): ?> + <ul> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> + <li><i class="fa fa-user-plus fa-fw"></i><?= $this->url->link(t('New group'), 'group', 'create') ?></li> + </ul> + <?php endif ?> + </div> + <?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('There is no group.') ?></p> + <?php else: ?> + <table class="table-small"> + <tr> + <th class="column-5"><?= $paginator->order(t('Id'), 'id') ?></th> + <th class="column-20"><?= $paginator->order(t('External Id'), 'external_id') ?></th> + <th><?= $paginator->order(t('Name'), 'name') ?></th> + <th class="column-20"><?= t('Actions') ?></th> + </tr> + <?php foreach ($paginator->getCollection() as $group): ?> + <tr> + <td> + #<?= $group['id'] ?> + </td> + <td> + <?= $this->e($group['external_id']) ?> + </td> + <td> + <?= $this->e($group['name']) ?> + </td> + <td> + <ul> + <li><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Users'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Edit'), 'group', 'edit', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Remove'), 'group', 'confirm', array('group_id' => $group['id'])) ?></li> + </ul> + </td> + </tr> + <?php endforeach ?> + </table> + + <?= $paginator ?> + <?php endif ?> +</section> diff --git a/app/Template/group/remove.php b/app/Template/group/remove.php new file mode 100644 index 00000000..48da91d5 --- /dev/null +++ b/app/Template/group/remove.php @@ -0,0 +1,19 @@ +<section id="main"> + <div class="page-header"> + <?php if ($this->user->isAdmin()): ?> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> + </ul> + <?php endif ?> + </div> + <div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove this group: "%s"?', $group['name']) ?></p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'group', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'group', 'index') ?> + </div> + </div> +</section> diff --git a/app/Template/group/users.php b/app/Template/group/users.php new file mode 100644 index 00000000..56ad82cf --- /dev/null +++ b/app/Template/group/users.php @@ -0,0 +1,44 @@ +<section id="main"> + <div class="page-header"> + <?php if ($this->user->isAdmin()): ?> + <ul> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> + </ul> + <?php endif ?> + </div> + <?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('There is no user in this group.') ?></p> + <?php else: ?> + <table> + <tr> + <th><?= $paginator->order(t('Id'), 'id') ?></th> + <th><?= $paginator->order(t('Username'), 'username') ?></th> + <th><?= $paginator->order(t('Name'), 'name') ?></th> + <th><?= $paginator->order(t('Email'), 'email') ?></th> + <th><?= t('Actions') ?></th> + </tr> + <?php foreach ($paginator->getCollection() as $user): ?> + <tr> + <td> + <?= $this->url->link('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> + </td> + <td> + <?= $this->url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + </td> + <td> + <?= $this->e($user['name']) ?> + </td> + <td> + <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a> + </td> + <td> + <?= $this->url->link(t('Remove this user'), 'group', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id'])) ?> + </td> + </tr> + <?php endforeach ?> + </table> + + <?= $paginator ?> + <?php endif ?> +</section> diff --git a/app/Template/user/create_local.php b/app/Template/user/create_local.php index 98c38f0d..6e6ca6ac 100644 --- a/app/Template/user/create_local.php +++ b/app/Template/user/create_local.php @@ -49,4 +49,4 @@ </div> </form> </section> -</section>
\ No newline at end of file +</section> diff --git a/app/Template/user/index.php b/app/Template/user/index.php index 4008b920..7c6ecc1e 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -5,6 +5,7 @@ <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New local user'), 'user', 'create') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New remote user'), 'user', 'create', array('remote' => 1)) ?></li> <li><i class="fa fa-upload fa-fw"></i><?= $this->url->link(t('Import'), 'userImport', 'step1') ?></li> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> </ul> <?php endif ?> </div> |