diff options
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/layout.php | 10 | ||||
-rw-r--r-- | app/Template/project/index.php | 44 | ||||
-rw-r--r-- | app/Template/project_user/layout.php | 28 | ||||
-rw-r--r-- | app/Template/project_user/roles.php | 33 | ||||
-rw-r--r-- | app/Template/project_user/sidebar.php | 28 | ||||
-rw-r--r-- | app/Template/project_user/tasks.php | 46 | ||||
-rw-r--r-- | app/Template/user/edit.php | 4 |
7 files changed, 179 insertions, 14 deletions
diff --git a/app/Template/layout.php b/app/Template/layout.php index 7d986309..fcdc23a0 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -12,7 +12,7 @@ <?php endif ?> <?php if (! isset($not_editable)): ?> - <?= $this->asset->js('assets/js/app.js', true) ?> + <?= $this->asset->js('assets/js/app.js') ?> <?php endif ?> <?= $this->asset->colorCss() ?> @@ -48,7 +48,13 @@ <ul> <?php if (isset($board_selector) && ! empty($board_selector)): ?> <li> - <select id="board-selector" tabindex="-1" data-notfound="<?= t('No results match:') ?>" data-placeholder="<?= t('Display another project') ?>" data-board-url="<?= $this->url->href('board', 'show', array('project_id' => 'PROJECT_ID')) ?>"> + <select id="board-selector" + class="chosen-select select-auto-redirect" + tabindex="-1" + data-notfound="<?= t('No results match:') ?>" + data-placeholder="<?= t('Display another project') ?>" + data-redirect-regex="PROJECT_ID" + data-redirect-url="<?= $this->url->href('board', 'show', array('project_id' => 'PROJECT_ID')) ?>"> <option value=""></option> <?php foreach($board_selector as $board_id => $board_name): ?> <option value="<?= $board_id ?>"><?= $this->e($board_name) ?></option> diff --git a/app/Template/project/index.php b/app/Template/project/index.php index 1fb3b5d6..96e359b6 100644 --- a/app/Template/project/index.php +++ b/app/Template/project/index.php @@ -5,18 +5,24 @@ <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> <?php endif ?> <li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?></li> + <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('Users overview'), 'projectuser', 'managers') ?></li> + <?php endif ?> </ul> </div> <section> <?php if ($paginator->isEmpty()): ?> <p class="alert"><?= t('No project') ?></p> <?php else: ?> - <table class="table-fixed"> + <table class="table-stripped"> <tr> - <th class="column-8"><?= $paginator->order(t('Id'), 'id') ?></th> - <th class="column-8"><?= $paginator->order(t('Status'), 'is_active') ?></th> - <th class="column-8"><?= $paginator->order(t('Identifier'), 'identifier') ?></th> + <th class="column-5"><?= $paginator->order(t('Id'), 'id') ?></th> + <th class="column-5"><?= $paginator->order(t('Status'), 'is_active') ?></th> <th class="column-20"><?= $paginator->order(t('Project'), 'name') ?></th> + <?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?> + <th class="column-15"><?= t('Managers') ?></th> + <th class="column-15"><?= t('Members') ?></th> + <?php endif ?> <th><?= t('Columns') ?></th> </tr> <?php foreach ($paginator->getCollection() as $project): ?> @@ -32,16 +38,14 @@ <?php endif ?> </td> <td> - <?= $this->e($project['identifier']) ?> - </td> - <td> - <?= $this->url->link('<i class="fa fa-th"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> + <?= $this->url->link('<i class="fa fa-th"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> + <?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'gantt', 'project', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?> <?php if ($project['is_public']): ?> - <i class="fa fa-share-alt fa-fw"></i> + <i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i> <?php endif ?> <?php if ($project['is_private']): ?> - <i class="fa fa-lock fa-fw"></i> + <i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i> <?php endif ?> <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?> @@ -51,6 +55,26 @@ </span> <?php endif ?> </td> + <?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?> + <td> + <ul> + <?php foreach ($project['managers'] as $user_id => $user_name): ?> + <li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li> + <?php endforeach ?> + </ul> + </td> + <td> + <?php if ($project['is_everybody_allowed'] == 1): ?> + <?= t('Everybody') ?> + <?php else: ?> + <ul> + <?php foreach ($project['members'] as $user_id => $user_name): ?> + <li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li> + <?php endforeach ?> + </ul> + <?php endif ?> + </td> + <?php endif ?> <td class="dashboard-project-stats"> <?php foreach ($project['columns'] as $column): ?> <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> diff --git a/app/Template/project_user/layout.php b/app/Template/project_user/layout.php new file mode 100644 index 00000000..23486cb7 --- /dev/null +++ b/app/Template/project_user/layout.php @@ -0,0 +1,28 @@ +<section id="main"> + <div class="page-header"> + <ul> + <?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li> + <?php endif ?> + <li> + <i class="fa fa-lock fa-fw"></i> + <?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?> + </li> + <li> + <i class="fa fa-folder fa-fw"></i> + <?= $this->url->link(t('All projects'), 'project', 'index') ?> + </li> + </ul> + </div> + <section class="sidebar-container"> + + <?= $this->render('project_user/sidebar', array('users' => $users, 'action' => $action, 'filter' => $filter)) ?> + + <div class="sidebar-content"> + <div class="page-header"> + <h2><?= $this->e($title) ?></h2> + </div> + <?= $content_for_sublayout ?> + </div> + </section> +</section>
\ No newline at end of file diff --git a/app/Template/project_user/roles.php b/app/Template/project_user/roles.php new file mode 100644 index 00000000..35d16241 --- /dev/null +++ b/app/Template/project_user/roles.php @@ -0,0 +1,33 @@ +<?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('No project') ?></p> +<?php else: ?> + <table class="table-fixed"> + <tr> + <th class="column-20"><?= $paginator->order(t('User'), 'users.username') ?></th> + <th class="column-25"><?= $paginator->order(t('Project'), 'projects.name') ?></th> + <th><?= t('Columns') ?></th> + </tr> + <?php foreach ($paginator->getCollection() as $project): ?> + <tr> + <td> + <?= $this->e($this->user->getFullname($project)) ?> + </td> + <td> + <?= $this->url->link('<i class="fa fa-th"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?> + <?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'gantt', 'project', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?> + <?= $this->url->link('<i class="fa fa-cog fa-fw"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Project settings')) ?> + + <?= $this->e($project['project_name']) ?> + </td> + <td class="dashboard-project-stats"> + <?php foreach ($project['columns'] as $column): ?> + <strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong> + <span><?= $this->e($column['title']) ?></span> + <?php endforeach ?> + </td> + </tr> + <?php endforeach ?> + </table> + + <?= $paginator ?> +<?php endif ?>
\ No newline at end of file diff --git a/app/Template/project_user/sidebar.php b/app/Template/project_user/sidebar.php new file mode 100644 index 00000000..f57323d5 --- /dev/null +++ b/app/Template/project_user/sidebar.php @@ -0,0 +1,28 @@ +<div class="sidebar"> + <h2><?= t('Actions') ?></h2> + + <?= $this->form->select( + 'user_id', + $users, + $filter, + array(), + array('data-redirect-url="'.$this->url->href('projectuser', $action, array('user_id' => 'USER_ID')).'"', 'data-redirect-regex="USER_ID"'), + 'chosen-select select-auto-redirect' + ) ?> + + <br/><br/> + <ul> + <li> + <?= $this->url->link(t('Project managers'), 'projectuser', 'managers', $filter) ?> + </li> + <li> + <?= $this->url->link(t('Project members'), 'projectuser', 'members', $filter) ?> + </li> + <li> + <?= $this->url->link(t('Open tasks'), 'projectuser', 'opens', $filter) ?> + </li> + <li> + <?= $this->url->link(t('Closed tasks'), 'projectuser', 'closed', $filter) ?> + </li> + </ul> +</div>
\ No newline at end of file diff --git a/app/Template/project_user/tasks.php b/app/Template/project_user/tasks.php new file mode 100644 index 00000000..f4fc2723 --- /dev/null +++ b/app/Template/project_user/tasks.php @@ -0,0 +1,46 @@ +<?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('No tasks found.') ?></p> +<?php elseif (! $paginator->isEmpty()): ?> + <table class="table-small"> + <tr> + <th class="column-5"><?= $paginator->order(t('Id'), 'tasks.id') ?></th> + <th class="column-10"><?= $paginator->order(t('Project'), 'projects.name') ?></th> + <th class="column-15"><?= $paginator->order(t('Column'), 'tasks.column_id') ?></th> + <th><?= $paginator->order(t('Title'), 'tasks.title') ?></th> + <th class="column-15"><?= $paginator->order(t('Assignee'), 'users.username') ?></th> + <th class="column-15"><?= $paginator->order(t('Start date'), 'tasks.date_started') ?></th> + <th class="column-15"><?= $paginator->order(t('Due date'), 'tasks.date_due') ?></th> + </tr> + <?php foreach ($paginator->getCollection() as $task): ?> + <tr> + <td class="task-table color-<?= $task['color_id'] ?>"> + <?= $this->url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + </td> + <td> + <?= $this->url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + </td> + <td> + <?= $this->e($task['column_name']) ?> + </td> + <td> + <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + </td> + <td> + <?php if ($task['assignee_username']): ?> + <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?> + <?php else: ?> + <?= t('Unassigned') ?> + <?php endif ?> + </td> + <td> + <?= dt('%B %e, %Y', $task['date_started']) ?> + </td> + <td> + <?= dt('%B %e, %Y', $task['date_due']) ?> + </td> + </tr> + <?php endforeach ?> + </table> + + <?= $paginator ?> +<?php endif ?> diff --git a/app/Template/user/edit.php b/app/Template/user/edit.php index a60ee681..cd10b2ab 100644 --- a/app/Template/user/edit.php +++ b/app/Template/user/edit.php @@ -23,8 +23,8 @@ <?= $this->form->select('language', $languages, $values, $errors) ?><br/> <?php if ($this->user->isAdmin()): ?> - <?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1) ?><br/> - <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1) ?><br/> + <?= $this->form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1) ?> + <?= $this->form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1) ?> <?php endif ?> <div class="form-actions"> |