diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-09-10 22:37:57 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-09-10 22:37:57 -0400 |
commit | 44f680cf2f1463721eb5bdb7eda4d3b339e63ba9 (patch) | |
tree | ed4aeef8b32dbd76277dacf864b028677bc10809 /app/Template | |
parent | 75470c72428c8d8f278d160369558ab31b137fb1 (diff) |
Add ui to create new custom project roles and column restrictions
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/column/index.php | 2 | ||||
-rw-r--r-- | app/Template/column/remove.php | 2 | ||||
-rw-r--r-- | app/Template/column_move_restriction/create.php | 24 | ||||
-rw-r--r-- | app/Template/column_move_restriction/remove.php | 14 | ||||
-rw-r--r-- | app/Template/project/sidebar.php | 3 | ||||
-rw-r--r-- | app/Template/project_role/create.php | 18 | ||||
-rw-r--r-- | app/Template/project_role/remove.php | 14 | ||||
-rw-r--r-- | app/Template/project_role/show.php | 58 |
8 files changed, 134 insertions, 1 deletions
diff --git a/app/Template/column/index.php b/app/Template/column/index.php index 66890ba5..8c96a350 100644 --- a/app/Template/column/index.php +++ b/app/Template/column/index.php @@ -41,9 +41,11 @@ <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> <li> + <i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i> <?= $this->url->link(t('Edit'), 'ColumnController', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id']), false, 'popover') ?> </li> <li> + <i class="fa fa-trash-o fa-fw" aria-hidden="true"></i> <?= $this->url->link(t('Remove'), 'ColumnController', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id']), false, 'popover') ?> </li> </ul> diff --git a/app/Template/column/remove.php b/app/Template/column/remove.php index b231a9a7..dc0a4712 100644 --- a/app/Template/column/remove.php +++ b/app/Template/column/remove.php @@ -9,7 +9,7 @@ </p> <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'ColumnController', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id'], 'remove' => 'yes'), true, 'btn btn-red') ?> + <?= $this->url->link(t('Yes'), 'ColumnController', 'remove', array('project_id' => $project['id'], 'column_id' => $column['id']), true, 'btn btn-red') ?> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'ColumnController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </div> diff --git a/app/Template/column_move_restriction/create.php b/app/Template/column_move_restriction/create.php new file mode 100644 index 00000000..69a75ce0 --- /dev/null +++ b/app/Template/column_move_restriction/create.php @@ -0,0 +1,24 @@ +<section id="main"> + <div class="page-header"> + <h2><?= t('New column restriction for the role "%s"', $role['role']) ?></h2> + </div> + <form class="popover-form" method="post" action="<?= $this->url->href('ColumnMoveRestrictionController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('project_id', $values) ?> + <?= $this->form->hidden('role_id', $values) ?> + + <?= $this->form->label(t('Source column'), 'src_column_id') ?> + <?= $this->form->select('src_column_id', $columns, $values, $errors) ?> + + <?= $this->form->label(t('Destination column'), 'dst_column_id') ?> + <?= $this->form->select('dst_column_id', $columns, $values, $errors) ?> + + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'ProjectRoleController', 'show', array(), false, 'close-popover') ?> + </div> + + <p class="alert alert-info"><?= t('People belonging to this role won\'t be able to move tasks between the source and the destination column.') ?></p> + </form> +</section> diff --git a/app/Template/column_move_restriction/remove.php b/app/Template/column_move_restriction/remove.php new file mode 100644 index 00000000..1985e167 --- /dev/null +++ b/app/Template/column_move_restriction/remove.php @@ -0,0 +1,14 @@ +<div class="page-header"> + <h2><?= t('Remove a column restriction') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this column restriction: "%s" to "%s"?', $restriction['src_column_title'], $restriction['dst_column_title']) ?> + </p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'ColumnMoveRestrictionController', 'remove', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), true, 'btn btn-red') ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectRoleController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> +</div> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 3be0da48..6e7fff05 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -38,6 +38,9 @@ <li <?= $this->app->checkMenuSelection('ProjectPermissionController') ?>> <?= $this->url->link(t('Permissions'), 'ProjectPermissionController', 'index', array('project_id' => $project['id'])) ?> </li> + <li <?= $this->app->checkMenuSelection('ProjectRoleController') ?>> + <?= $this->url->link(t('Custom roles'), 'ProjectRoleController', 'show', array('project_id' => $project['id'])) ?> + </li> <?php endif ?> <li <?= $this->app->checkMenuSelection('ActionController') ?>> <?= $this->url->link(t('Automatic actions'), 'ActionController', 'index', array('project_id' => $project['id'])) ?> diff --git a/app/Template/project_role/create.php b/app/Template/project_role/create.php new file mode 100644 index 00000000..8eee8f70 --- /dev/null +++ b/app/Template/project_role/create.php @@ -0,0 +1,18 @@ +<section id="main"> + <div class="page-header"> + <h2><?= t('New custom project role') ?></h2> + </div> + <form class="popover-form" method="post" action="<?= $this->url->href('ProjectRoleController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('project_id', $values) ?> + + <?= $this->form->label(t('Role'), 'role') ?> + <?= $this->form->text('role', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'ProjectRoleController', 'show', array(), false, 'close-popover') ?> + </div> + </form> +</section> diff --git a/app/Template/project_role/remove.php b/app/Template/project_role/remove.php new file mode 100644 index 00000000..25875e3a --- /dev/null +++ b/app/Template/project_role/remove.php @@ -0,0 +1,14 @@ +<div class="page-header"> + <h2><?= t('Remove a custom role') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this custom role: "%s"? All people assigned to this role will become project member.', $role['role']) ?> + </p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'ProjectRoleController', 'remove', array('project_id' => $project['id'], 'role_id' => $role['role_id']), true, 'btn btn-red') ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectRoleController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> + </div> +</div> diff --git a/app/Template/project_role/show.php b/app/Template/project_role/show.php new file mode 100644 index 00000000..2114a1c9 --- /dev/null +++ b/app/Template/project_role/show.php @@ -0,0 +1,58 @@ +<div class="page-header"> + <h2><?= t('Custom Project Roles') ?></h2> + <ul> + <li> + <i class="fa fa-plus fa-fw" aria-hidden="true"></i> + <?= $this->url->link(t('Add a new custom role'), 'ProjectRoleController', 'create', array('project_id' => $project['id']), false, 'popover') ?> + </li> + </ul> +</div> + +<?php if (empty($roles)): ?> + <div class="alert"><?= t('There is no custom role for this project.') ?></div> +<?php else: ?> + <?php foreach ($roles as $role): ?> + <table class="table-striped"> + <tr> + <th> + <div class="dropdown"> + <a href="#" class="dropdown-menu"><?= t('Column restrictions for the role "%s"', $role['role']) ?> <i class="fa fa-caret-down"></i></a> + <ul> + <li> + <i class="fa fa-plus fa-fw" aria-hidden="true"></i> + <?= $this->url->link(t('Add a new column restriction'), 'ColumnMoveRestrictionController', 'create', array('project_id' => $project['id'], 'role_id' => $role['role_id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-trash-o fa-fw" aria-hidden="true"></i> + <?= $this->url->link(t('Remove this role'), 'ProjectRoleController', 'confirm', array('project_id' => $project['id'], 'role_id' => $role['role_id']), false, 'popover') ?> + </li> + </ul> + </div> + </th> + <th class="column-15"> + <?= t('Actions') ?> + </th> + </tr> + <?php if (empty($role['restrictions'])): ?> + <tr> + <td colspan="2"><?= t('There is no restriction for this role.') ?></td> + </tr> + <?php else: ?> + <?php foreach ($role['restrictions'] as $restriction): ?> + <tr> + <td> + <i class="fa fa-ban fa-fw" aria-hidden="true"></i> + <?= $this->text->e($restriction['src_column_title']) ?> + <i class="fa fa-arrow-right fa-fw" aria-hidden="true"></i> + <?= $this->text->e($restriction['dst_column_title']) ?> + </td> + <td> + <i class="fa fa-trash-o fa-fw" aria-hidden="true"></i> + <?= $this->url->link(t('Remove'), 'ColumnMoveRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), false, 'popover') ?> + </td> + </tr> + <?php endforeach ?> + <?php endif ?> + </table> + <?php endforeach ?> +<?php endif ?> |