summaryrefslogtreecommitdiff
path: root/app/Templates
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-08-30 14:08:46 -0800
committerFrédéric Guillot <fred@kanboard.net>2014-08-30 14:08:46 -0800
commit9194a2604d79ef97994d01c35fb454f745b5412c (patch)
tree365dd4294e536c440610bee4f07a1bffb00d00eb /app/Templates
parente1eba08398c6c6ece684f9db6dedb0dff5d43071 (diff)
Projects management refactoring
Diffstat (limited to 'app/Templates')
-rw-r--r--app/Templates/action_index.php127
-rw-r--r--app/Templates/action_params.php72
-rw-r--r--app/Templates/action_remove.php24
-rw-r--r--app/Templates/board_edit.php116
-rw-r--r--app/Templates/board_remove.php26
-rw-r--r--app/Templates/category_edit.php34
-rw-r--r--app/Templates/category_index.php80
-rw-r--r--app/Templates/project_disable.php14
-rw-r--r--app/Templates/project_duplicate.php14
-rw-r--r--app/Templates/project_edit.php34
-rw-r--r--app/Templates/project_enable.php14
-rw-r--r--app/Templates/project_export.php45
-rw-r--r--app/Templates/project_index.php109
-rw-r--r--app/Templates/project_layout.php17
-rw-r--r--app/Templates/project_remove.php24
-rw-r--r--app/Templates/project_share.php18
-rw-r--r--app/Templates/project_show.php50
-rw-r--r--app/Templates/project_sidebar.php47
-rw-r--r--app/Templates/project_users.php70
19 files changed, 486 insertions, 449 deletions
diff --git a/app/Templates/action_index.php b/app/Templates/action_index.php
index 36c333a9..c21395fd 100644
--- a/app/Templates/action_index.php
+++ b/app/Templates/action_index.php
@@ -1,77 +1,70 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
- <ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
- </ul>
- </div>
- <section>
+<div class="page-header">
+ <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
+</div>
- <?php if (! empty($actions)): ?>
+<?php if (! empty($actions)): ?>
- <h3><?= t('Defined actions') ?></h3>
- <table>
- <tr>
- <th><?= t('Event name') ?></th>
- <th><?= t('Action name') ?></th>
- <th><?= t('Action parameters') ?></th>
- <th><?= t('Action') ?></th>
- </tr>
+<h3><?= t('Defined actions') ?></h3>
+<table>
+ <tr>
+ <th><?= t('Event name') ?></th>
+ <th><?= t('Action name') ?></th>
+ <th><?= t('Action parameters') ?></th>
+ <th><?= t('Action') ?></th>
+ </tr>
- <?php foreach ($actions as $action): ?>
- <tr>
- <td><?= Helper\in_list($action['event_name'], $available_events) ?></td>
- <td><?= Helper\in_list($action['action_name'], $available_actions) ?></td>
- <td>
- <ul>
- <?php foreach ($action['params'] as $param): ?>
- <li>
- <?= Helper\in_list($param['name'], $available_params) ?> =
- <strong>
- <?php if (Helper\contains($param['name'], 'column_id')): ?>
- <?= Helper\in_list($param['value'], $columns_list) ?>
- <?php elseif (Helper\contains($param['name'], 'user_id')): ?>
- <?= Helper\in_list($param['value'], $users_list) ?>
- <?php elseif (Helper\contains($param['name'], 'project_id')): ?>
- <?= Helper\in_list($param['value'], $projects_list) ?>
- <?php elseif (Helper\contains($param['name'], 'color_id')): ?>
- <?= Helper\in_list($param['value'], $colors_list) ?>
- <?php elseif (Helper\contains($param['name'], 'category_id')): ?>
- <?= Helper\in_list($param['value'], $categories_list) ?>
- <?php endif ?>
- </strong>
- </li>
- <?php endforeach ?>
- </ul>
- </td>
- <td>
- <a href="?controller=action&amp;action=confirm&amp;action_id=<?= $action['id'] ?>"><?= t('Remove') ?></a>
- </td>
- </tr>
- <?php endforeach ?>
+ <?php foreach ($actions as $action): ?>
+ <tr>
+ <td><?= Helper\in_list($action['event_name'], $available_events) ?></td>
+ <td><?= Helper\in_list($action['action_name'], $available_actions) ?></td>
+ <td>
+ <ul>
+ <?php foreach ($action['params'] as $param): ?>
+ <li>
+ <?= Helper\in_list($param['name'], $available_params) ?> =
+ <strong>
+ <?php if (Helper\contains($param['name'], 'column_id')): ?>
+ <?= Helper\in_list($param['value'], $columns_list) ?>
+ <?php elseif (Helper\contains($param['name'], 'user_id')): ?>
+ <?= Helper\in_list($param['value'], $users_list) ?>
+ <?php elseif (Helper\contains($param['name'], 'project_id')): ?>
+ <?= Helper\in_list($param['value'], $projects_list) ?>
+ <?php elseif (Helper\contains($param['name'], 'color_id')): ?>
+ <?= Helper\in_list($param['value'], $colors_list) ?>
+ <?php elseif (Helper\contains($param['name'], 'category_id')): ?>
+ <?= Helper\in_list($param['value'], $categories_list) ?>
+ <?php endif ?>
+ </strong>
+ </li>
+ <?php endforeach ?>
+ </ul>
+ </td>
+ <td>
+ <a href="?controller=action&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;action_id=<?= $action['id'] ?>"><?= t('Remove') ?></a>
+ </td>
+ </tr>
+ <?php endforeach ?>
- </table>
+</table>
- <?php endif ?>
+<?php endif ?>
- <h3><?= t('Add an action') ?></h3>
- <form method="post" action="?controller=action&amp;action=params&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
- <?= Helper\form_hidden('project_id', $values) ?>
+<h3><?= t('Add an action') ?></h3>
+<form method="post" action="?controller=action&amp;action=params&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+ <?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('project_id', $values) ?>
- <?= Helper\form_label(t('Event'), 'event_name') ?>
- <?= Helper\form_select('event_name', $available_events, $values) ?><br/>
+ <?= Helper\form_label(t('Event'), 'event_name') ?>
+ <?= Helper\form_select('event_name', $available_events, $values) ?><br/>
- <?= Helper\form_label(t('Action'), 'action_name') ?>
- <?= Helper\form_select('action_name', $available_actions, $values) ?><br/>
+ <?= Helper\form_label(t('Action'), 'action_name') ?>
+ <?= Helper\form_select('action_name', $available_actions, $values) ?><br/>
- <div class="form-help">
- <?= t('When the selected event occurs execute the corresponding action.') ?>
- </div>
+ <div class="form-help">
+ <?= t('When the selected event occurs execute the corresponding action.') ?>
+ </div>
- <div class="form-actions">
- <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
- </div>
- </form>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Next step') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/action_params.php b/app/Templates/action_params.php
index da685860..92d16288 100644
--- a/app/Templates/action_params.php
+++ b/app/Templates/action_params.php
@@ -1,43 +1,37 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
- <ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
- </ul>
- </div>
- <section>
+<div class="page-header">
+ <h2><?= t('Automatic actions for the project "%s"', $project['name']) ?></h2>
+</div>
+<section>
- <h3><?= t('Define action parameters') ?></h3>
- <form method="post" action="?controller=action&amp;action=create&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
- <?= Helper\form_hidden('project_id', $values) ?>
- <?= Helper\form_hidden('event_name', $values) ?>
- <?= Helper\form_hidden('action_name', $values) ?>
+<h3><?= t('Define action parameters') ?></h3>
+<form method="post" action="?controller=action&amp;action=create&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+ <?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('project_id', $values) ?>
+ <?= Helper\form_hidden('event_name', $values) ?>
+ <?= Helper\form_hidden('action_name', $values) ?>
- <?php foreach ($action_params as $param_name => $param_desc): ?>
+ <?php foreach ($action_params as $param_name => $param_desc): ?>
- <?php if (Helper\contains($param_name, 'column_id')): ?>
- <?= Helper\form_label($param_desc, $param_name) ?>
- <?= Helper\form_select('params['.$param_name.']', $columns_list, $values) ?><br/>
- <?php elseif (Helper\contains($param_name, 'user_id')): ?>
- <?= Helper\form_label($param_desc, $param_name) ?>
- <?= Helper\form_select('params['.$param_name.']', $users_list, $values) ?><br/>
- <?php elseif (Helper\contains($param_name, 'project_id')): ?>
- <?= Helper\form_label($param_desc, $param_name) ?>
- <?= Helper\form_select('params['.$param_name.']', $projects_list, $values) ?><br/>
- <?php elseif (Helper\contains($param_name, 'color_id')): ?>
- <?= Helper\form_label($param_desc, $param_name) ?>
- <?= Helper\form_select('params['.$param_name.']', $colors_list, $values) ?><br/>
- <?php elseif (Helper\contains($param_name, 'category_id')): ?>
- <?= Helper\form_label($param_desc, $param_name) ?>
- <?= Helper\form_select('params['.$param_name.']', $categories_list, $values) ?><br/>
- <?php endif ?>
- <?php endforeach ?>
+ <?php if (Helper\contains($param_name, 'column_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $columns_list, $values) ?><br/>
+ <?php elseif (Helper\contains($param_name, 'user_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $users_list, $values) ?><br/>
+ <?php elseif (Helper\contains($param_name, 'project_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $projects_list, $values) ?><br/>
+ <?php elseif (Helper\contains($param_name, 'color_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $colors_list, $values) ?><br/>
+ <?php elseif (Helper\contains($param_name, 'category_id')): ?>
+ <?= Helper\form_label($param_desc, $param_name) ?>
+ <?= Helper\form_select('params['.$param_name.']', $categories_list, $values) ?><br/>
+ <?php endif ?>
+ <?php endforeach ?>
- <div class="form-actions">
- <input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
- </div>
- </form>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save this action') ?>" class="btn btn-blue"/>
+ <?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/action_remove.php b/app/Templates/action_remove.php
index 13679eab..4b574f11 100644
--- a/app/Templates/action_remove.php
+++ b/app/Templates/action_remove.php
@@ -1,16 +1,14 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Remove an automatic action') ?></h2>
- </div>
+<div class="page-header">
+ <h2><?= t('Remove an automatic action') ?></h2>
+</div>
- <div class="confirm">
- <p class="alert alert-info">
- <?= t('Do you really want to remove this action: "%s"?', Helper\in_list($action['event_name'], $available_events).'/'.Helper\in_list($action['action_name'], $available_actions)) ?>
- </p>
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this action: "%s"?', Helper\in_list($action['event_name'], $available_events).'/'.Helper\in_list($action['action_name'], $available_actions)) ?>
+ </p>
- <div class="form-actions">
- <a href="?controller=action&amp;action=remove&amp;action_id=<?= $action['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $action['project_id'] ?>"><?= t('cancel') ?></a>
- </div>
+ <div class="form-actions">
+ <a href="?controller=action&amp;action=remove&amp;action_id=<?= $action['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=action&amp;action=index&amp;project_id=<?= $action['project_id'] ?>"><?= t('cancel') ?></a>
</div>
-</section> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/app/Templates/board_edit.php b/app/Templates/board_edit.php
index 05d9a6f6..8832e71d 100644
--- a/app/Templates/board_edit.php
+++ b/app/Templates/board_edit.php
@@ -1,66 +1,58 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Edit the board for "%s"', $project['name']) ?></h2>
- <ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
- </ul>
- </div>
- <section>
+<div class="page-header">
+ <h2><?= t('Edit the board for "%s"', $project['name']) ?></h2>
+</div>
+<section>
- <h3><?= t('Change columns') ?></h3>
- <form method="post" action="?controller=board&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
- <?php $i = 0; ?>
- <table>
- <tr>
- <th><?= t('Position') ?></th>
- <th><?= t('Column title') ?></th>
- <th><?= t('Task limit') ?></th>
- <th><?= t('Actions') ?></th>
- </tr>
- <?php foreach ($columns as $column): ?>
- <tr>
- <td><?= Helper\form_label(t('Column %d', ++$i), 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
- <td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
- <td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
- <td>
- <ul>
- <?php if ($column['position'] != 1): ?>
- <li>
- <a href="?controller=board&amp;action=moveUp&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Up') ?></a>
- </li>
- <?php endif ?>
- <?php if ($column['position'] != count($columns)): ?>
- <li>
- <a href="?controller=board&amp;action=moveDown&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Down') ?></a>
- </li>
- <?php endif ?>
- <li>
- <a href="?controller=board&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'] ?>"><?= t('Remove') ?></a>
- </li>
- </ul>
- </td>
- </tr>
- <?php endforeach ?>
- </table>
+<h3><?= t('Change columns') ?></h3>
+<form method="post" action="?controller=board&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+ <?= Helper\form_csrf() ?>
+ <?php $i = 0; ?>
+ <table>
+ <tr>
+ <th><?= t('Position') ?></th>
+ <th><?= t('Column title') ?></th>
+ <th><?= t('Task limit') ?></th>
+ <th><?= t('Actions') ?></th>
+ </tr>
+ <?php foreach ($columns as $column): ?>
+ <tr>
+ <td><?= Helper\form_label(t('Column %d', ++$i), 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
+ <td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
+ <td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
+ <td>
+ <ul>
+ <?php if ($column['position'] != 1): ?>
+ <li>
+ <a href="?controller=board&amp;action=moveUp&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Up') ?></a>
+ </li>
+ <?php endif ?>
+ <?php if ($column['position'] != count($columns)): ?>
+ <li>
+ <a href="?controller=board&amp;action=moveDown&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>"><?= t('Move Down') ?></a>
+ </li>
+ <?php endif ?>
+ <li>
+ <a href="?controller=board&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;column_id=<?= $column['id'] ?>"><?= t('Remove') ?></a>
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ </table>
- <div class="form-actions">
- <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
- </div>
- </form>
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/>
+ </div>
+</form>
- <h3><?= t('Add a new column') ?></h3>
- <form method="post" action="?controller=board&amp;action=add&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
- <?= Helper\form_hidden('project_id', $values) ?>
- <?= Helper\form_label(t('Title'), 'title') ?>
- <?= Helper\form_text('title', $values, $errors, array('required')) ?>
+<h3><?= t('Add a new column') ?></h3>
+<form method="post" action="?controller=board&amp;action=add&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+ <?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('project_id', $values) ?>
+ <?= Helper\form_label(t('Title'), 'title') ?>
+ <?= Helper\form_text('title', $values, $errors, array('required')) ?>
- <div class="form-actions">
- <input type="submit" value="<?= t('Add this column') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
- </div>
- </form>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Add this column') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/board_remove.php b/app/Templates/board_remove.php
index 76c217b3..d6fa9a88 100644
--- a/app/Templates/board_remove.php
+++ b/app/Templates/board_remove.php
@@ -1,17 +1,15 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Remove a column') ?></h2>
- </div>
+<div class="page-header">
+ <h2><?= t('Remove a column') ?></h2>
+</div>
- <div class="confirm">
- <p class="alert alert-info">
- <?= t('Do you really want to remove this column: "%s"?', $column['title']) ?>
- <?= t('This action will REMOVE ALL TASKS associated to this column!') ?>
- </p>
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this column: "%s"?', $column['title']) ?>
+ <?= t('This action will REMOVE ALL TASKS associated to this column!') ?>
+ </p>
- <div class="form-actions">
- <a href="?controller=board&amp;action=remove&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=board&amp;action=edit&amp;project_id=<?= $column['project_id'] ?>"><?= t('cancel') ?></a>
- </div>
+ <div class="form-actions">
+ <a href="?controller=board&amp;action=remove&amp;column_id=<?= $column['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=board&amp;action=edit&amp;project_id=<?= $column['project_id'] ?>"><?= t('cancel') ?></a>
</div>
-</section> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/app/Templates/category_edit.php b/app/Templates/category_edit.php
index 327acce6..278d7e12 100644
--- a/app/Templates/category_edit.php
+++ b/app/Templates/category_edit.php
@@ -1,24 +1,16 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2>
- <ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
- </ul>
- </div>
- <section>
-
- <form method="post" action="?controller=category&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
- <?= Helper\form_hidden('id', $values) ?>
- <?= Helper\form_hidden('project_id', $values) ?>
+<div class="page-header">
+ <h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2>
+</div>
- <?= Helper\form_label(t('Category Name'), 'name') ?>
- <?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
+<form method="post" action="?controller=category&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+ <?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('id', $values) ?>
+ <?= Helper\form_hidden('project_id', $values) ?>
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- </div>
- </form>
+ <?= Helper\form_label(t('Category Name'), 'name') ?>
+ <?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/category_index.php b/app/Templates/category_index.php
index 18e81b78..4635406e 100644
--- a/app/Templates/category_index.php
+++ b/app/Templates/category_index.php
@@ -1,49 +1,41 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Categories for the project "%s"', $project['name']) ?></h2>
- <ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
- </ul>
- </div>
- <section>
-
- <?php if (! empty($categories)): ?>
- <table>
- <tr>
- <th><?= t('Category Name') ?></th>
- <th><?= t('Actions') ?></th>
- </tr>
- <?php foreach ($categories as $category_id => $category_name): ?>
- <tr>
- <td><?= Helper\escape($category_name) ?></td>
- <td>
- <ul>
- <li>
- <a href="?controller=category&amp;action=edit&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Edit') ?></a>
- </li>
- <li>
- <a href="?controller=category&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Remove') ?></a>
- </li>
- </ul>
- </td>
- </tr>
- <?php endforeach ?>
- </table>
- <?php endif ?>
+<div class="page-header">
+ <h2><?= t('Categories') ?></h2>
+</div>
- <h3><?= t('Add a new category') ?></h3>
- <form method="post" action="?controller=category&amp;action=save&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+<?php if (! empty($categories)): ?>
+<table>
+ <tr>
+ <th><?= t('Category Name') ?></th>
+ <th><?= t('Actions') ?></th>
+ </tr>
+ <?php foreach ($categories as $category_id => $category_name): ?>
+ <tr>
+ <td><?= Helper\escape($category_name) ?></td>
+ <td>
+ <ul>
+ <li>
+ <a href="?controller=category&amp;action=edit&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Edit') ?></a>
+ </li>
+ <li>
+ <a href="?controller=category&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Remove') ?></a>
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <?php endforeach ?>
+</table>
+<?php endif ?>
- <?= Helper\form_csrf() ?>
- <?= Helper\form_hidden('project_id', $values) ?>
+<h3><?= t('Add a new category') ?></h3>
+<form method="post" action="?controller=category&amp;action=save&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
- <?= Helper\form_label(t('Category Name'), 'name') ?>
- <?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
+ <?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('project_id', $values) ?>
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- </div>
- </form>
+ <?= Helper\form_label(t('Category Name'), 'name') ?>
+ <?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/project_disable.php b/app/Templates/project_disable.php
new file mode 100644
index 00000000..39f55570
--- /dev/null
+++ b/app/Templates/project_disable.php
@@ -0,0 +1,14 @@
+<div class="page-header">
+ <h2><?= t('Project activation') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to disable this project: "%s"?', $project['name']) ?>
+ </p>
+
+ <div class="form-actions">
+ <a href="?controller=project&amp;action=disable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Templates/project_duplicate.php b/app/Templates/project_duplicate.php
new file mode 100644
index 00000000..32cbd5d8
--- /dev/null
+++ b/app/Templates/project_duplicate.php
@@ -0,0 +1,14 @@
+<div class="page-header">
+ <h2><?= t('Clone this project') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to duplicate this project: "%s"?', $project['name']) ?>
+ </p>
+
+ <div class="form-actions">
+ <a href="?controller=project&amp;action=duplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Templates/project_edit.php b/app/Templates/project_edit.php
index a882fbc6..4c9420f0 100644
--- a/app/Templates/project_edit.php
+++ b/app/Templates/project_edit.php
@@ -1,25 +1,17 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Edit project') ?></h2>
- <ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
- </ul>
- </div>
- <section>
- <form method="post" action="?controller=project&amp;action=update&amp;project_id=<?= $values['id'] ?>" autocomplete="off">
+<div class="page-header">
+ <h2><?= t('Edit project') ?></h2>
+</div>
+<form method="post" action="?controller=project&amp;action=update&amp;project_id=<?= $values['id'] ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
- <?= Helper\form_hidden('id', $values) ?>
+ <?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('id', $values) ?>
- <?= Helper\form_label(t('Name'), 'name') ?>
- <?= Helper\form_text('name', $values, $errors, array('required')) ?>
+ <?= Helper\form_label(t('Name'), 'name') ?>
+ <?= Helper\form_text('name', $values, $errors, array('required')) ?>
- <?= Helper\form_checkbox('is_active', t('Activated'), 1, isset($values['is_active']) && $values['is_active'] == 1 ? true : false) ?><br/>
+ <?= Helper\form_checkbox('is_active', t('Activated'), 1, isset($values['is_active']) && $values['is_active'] == 1) ?><br/>
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
- </div>
- </form>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/project_enable.php b/app/Templates/project_enable.php
new file mode 100644
index 00000000..d2fce9f3
--- /dev/null
+++ b/app/Templates/project_enable.php
@@ -0,0 +1,14 @@
+<div class="page-header">
+ <h2><?= t('Project activation') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to enable this project: "%s"?', $project['name']) ?>
+ </p>
+
+ <div class="form-actions">
+ <a href="?controller=project&amp;action=enable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Templates/project_export.php b/app/Templates/project_export.php
index 946a68a8..46b4f369 100644
--- a/app/Templates/project_export.php
+++ b/app/Templates/project_export.php
@@ -1,33 +1,24 @@
-<section id="main">
- <div class="page-header">
- <h2>
- <?= t('Tasks exportation for "%s"', $project['name']) ?>
- </h2>
- <ul>
- <li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Back to the board') ?></a></li>
- <li><a href="?controller=project&amp;action=index"><?= t('List of projects') ?></a></li>
- </ul>
- </div>
- <section id="project-section">
-
- <form method="get" action="?" autocomplete="off">
+<div class="page-header">
+ <h2>
+ <?= t('Tasks exportation for "%s"', $project['name']) ?>
+ </h2>
+</div>
- <?= Helper\form_hidden('controller', $values) ?>
- <?= Helper\form_hidden('action', $values) ?>
- <?= Helper\form_hidden('project_id', $values) ?>
+<form method="get" action="?" autocomplete="off">
- <?= Helper\form_label(t('Start Date'), 'from') ?>
- <?= Helper\form_text('from', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?><br/>
+ <?= Helper\form_hidden('controller', $values) ?>
+ <?= Helper\form_hidden('action', $values) ?>
+ <?= Helper\form_hidden('project_id', $values) ?>
- <?= Helper\form_label(t('End Date'), 'to') ?>
- <?= Helper\form_text('to', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?>
+ <?= Helper\form_label(t('Start Date'), 'from') ?>
+ <?= Helper\form_text('from', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?><br/>
- <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
+ <?= Helper\form_label(t('End Date'), 'to') ?>
+ <?= Helper\form_text('to', $values, $errors, array('required', 'placeholder="'.t('month/day/year').'"'), 'form-date') ?>
- <div class="form-actions">
- <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/>
- </div>
- </form>
+ <div class="form-help"><?= t('Others formats accepted: %s and %s', date('Y-m-d'), date('Y_m_d')) ?></div>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Execute') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/project_index.php b/app/Templates/project_index.php
index dc71033f..8b103c52 100644
--- a/app/Templates/project_index.php
+++ b/app/Templates/project_index.php
@@ -8,99 +8,32 @@
<?php endif ?>
</div>
<section>
- <?php if (empty($projects)): ?>
+ <?php if (empty($active_projects) && empty($inactive_projects)): ?>
<p class="alert"><?= t('No project') ?></p>
<?php else: ?>
- <table>
- <tr>
- <th><?= t('Project') ?></th>
- <th><?= t('Status') ?></th>
- <th><?= t('Tasks') ?></th>
- <th><?= t('Board') ?></th>
- <?php if (Helper\is_admin()): ?>
- <th><?= t('Actions') ?></th>
- <?php endif ?>
- </tr>
- <?php foreach ($projects as $project): ?>
- <tr>
- <td>
- <a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>" title="project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
- </td>
- <td>
- <?= $project['is_active'] ? t('Active') : t('Inactive') ?>
- </td>
- <td>
- <ul>
- <?php if ($project['nb_tasks'] > 0): ?>
-
- <?php if ($project['nb_active_tasks'] > 0): ?>
- <li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('%d tasks on the board', $project['nb_active_tasks']) ?></a></li>
- <?php endif ?>
-
- <?php if ($project['nb_inactive_tasks'] > 0): ?>
- <li><a href="?controller=project&amp;action=tasks&amp;project_id=<?= $project['id'] ?>"><?= t('%d closed tasks', $project['nb_inactive_tasks']) ?></a></li>
- <?php endif ?>
+ <?php if (! empty($active_projects)): ?>
+ <h3><?= t('Active projects') ?></h3>
+ <ul class="project-listing">
+ <?php foreach ($active_projects as $project): ?>
+ <li>
+ <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
+ </li>
+ <?php endforeach ?>
+ </ul>
+ <?php endif ?>
- <li><?= t('%d tasks in total', $project['nb_tasks']) ?></li>
+ <?php if (! empty($inactive_projects)): ?>
+ <h3><?= t('Inactive projects') ?></h3>
+ <ul class="project-listing">
+ <?php foreach ($inactive_projects as $project): ?>
+ <li>
+ <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
+ </li>
+ <?php endforeach ?>
+ </ul>
+ <?php endif ?>
- <?php else: ?>
- <li><?= t('no task for this project') ?></li>
- <?php endif ?>
- </ul>
- </td>
- <td>
- <ul>
- <?php foreach ($project['columns'] as $column): ?>
- <li>
- <span title="column_id=<?= $column['id'] ?>"><?= Helper\escape($column['title']) ?></span> (<?= $column['nb_active_tasks'] ?>)
- </li>
- <?php endforeach ?>
- </ul>
- </td>
- <?php if (Helper\is_admin()): ?>
- <td>
- <ul>
- <li>
- <a href="?controller=category&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Categories') ?></a>
- </li>
- <li>
- <a href="?controller=project&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit project') ?></a>
- </li>
- <li>
- <a href="?controller=project&amp;action=users&amp;project_id=<?= $project['id'] ?>"><?= t('Edit users access') ?></a>
- </li>
- <li>
- <a href="?controller=board&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a>
- </li>
- <li>
- <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a>
- </li>
- <li>
- <?php if ($project['is_active']): ?>
- <a href="?controller=project&amp;action=disable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a>
- <?php else: ?>
- <a href="?controller=project&amp;action=enable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a>
- <?php endif ?>
- </li>
- <li>
- <a href="?controller=project&amp;action=confirm&amp;project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a>
- </li>
- <li>
- <a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a>
- </li>
- <li>
- <a href="?controller=project&amp;action=export&amp;project_id=<?= $project['id'] ?>"><?= t('Tasks Export') ?></a>
- </li>
- <li>
- <a href="?controller=project&amp;action=duplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Clone Project') ?></a>
- </li>
- </ul>
- </td>
- <?php endif ?>
- </tr>
- <?php endforeach ?>
- </table>
<?php endif ?>
</section>
</section> \ No newline at end of file
diff --git a/app/Templates/project_layout.php b/app/Templates/project_layout.php
new file mode 100644
index 00000000..c8cc9236
--- /dev/null
+++ b/app/Templates/project_layout.php
@@ -0,0 +1,17 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= t('Project "%s"', $project['name']) ?></h2>
+ <ul>
+ <li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Back to the board') ?></a></li>
+ <li><a href="?controller=project"><?= t('All projects') ?></a></li>
+ </ul>
+ </div>
+ <section class="project-show" id="project-section">
+
+ <?= Helper\template('project_sidebar', array('project' => $project)) ?>
+
+ <div class="project-show-main">
+ <?= $project_content_for_layout ?>
+ </div>
+ </section>
+</section> \ No newline at end of file
diff --git a/app/Templates/project_remove.php b/app/Templates/project_remove.php
index e25efa2f..00771b5f 100644
--- a/app/Templates/project_remove.php
+++ b/app/Templates/project_remove.php
@@ -1,16 +1,14 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Remove project') ?></h2>
- </div>
+<div class="page-header">
+ <h2><?= t('Remove project') ?></h2>
+</div>
- <div class="confirm">
- <p class="alert alert-info">
- <?= t('Do you really want to remove this project: "%s"?', $project['name']) ?>
- </p>
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this project: "%s"?', $project['name']) ?>
+ </p>
- <div class="form-actions">
- <a href="?controller=project&amp;action=remove&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
- </div>
+ <div class="form-actions">
+ <a href="?controller=project&amp;action=remove&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a>
</div>
-</section> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/app/Templates/project_share.php b/app/Templates/project_share.php
new file mode 100644
index 00000000..62e05b73
--- /dev/null
+++ b/app/Templates/project_share.php
@@ -0,0 +1,18 @@
+<div class="page-header">
+ <h2><?= t('Public access') ?></h2>
+</div>
+
+<?php if ($project['is_public']): ?>
+
+ <div class="settings">
+ <strong><a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></strong><br/>
+ <input type="text" readonly="readonly" value="<?= Helper\get_current_base_url() ?>?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>"/>
+ </div>
+
+ <a href="?controller=project&amp;action=disablePublic&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Disable public access') ?></a>
+
+<?php else: ?>
+
+ <a href="?controller=project&amp;action=enablePublic&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>" class="btn btn-blue"><?= t('Enable public access') ?></a>
+
+<?php endif ?>
diff --git a/app/Templates/project_show.php b/app/Templates/project_show.php
new file mode 100644
index 00000000..12b0ae64
--- /dev/null
+++ b/app/Templates/project_show.php
@@ -0,0 +1,50 @@
+<div class="page-header">
+ <h2><?= t('Summary') ?></h2>
+</div>
+<ul class="settings">
+ <li><strong><?= $project['is_active'] ? t('Active') : t('Inactive') ?></strong></li>
+
+ <?php if ($project['is_public']): ?>
+ <li><a href="?controller=board&amp;action=readonly&amp;token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a></li>
+ <?php else: ?>
+ <li><?= t('Public access disabled') ?></li>
+ <?php endif ?>
+
+ <?php if ($project['last_modified']): ?>
+ <li><?= dt('Last modified on %B %e, %Y at %k:%M %p', $project['last_modified']) ?></li>
+ <?php endif ?>
+
+ <?php if ($stats['nb_tasks'] > 0): ?>
+
+ <?php if ($stats['nb_active_tasks'] > 0): ?>
+ <li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('%d tasks on the board', $stats['nb_active_tasks']) ?></a></li>
+ <?php endif ?>
+
+ <?php if ($stats['nb_inactive_tasks'] > 0): ?>
+ <li><a href="?controller=project&amp;action=tasks&amp;project_id=<?= $project['id'] ?>"><?= t('%d closed tasks', $stats['nb_inactive_tasks']) ?></a></li>
+ <?php endif ?>
+
+ <li><?= t('%d tasks in total', $stats['nb_tasks']) ?></li>
+
+ <?php else: ?>
+ <li><?= t('No task for this project') ?></li>
+ <?php endif ?>
+</ul>
+
+<div class="page-header">
+ <h2><?= t('Board') ?></h2>
+</div>
+<table class="table-stripped">
+ <tr>
+ <th width="50%"><?= t('Column') ?></th>
+ <th><?= t('Task limit') ?></th>
+ <th><?= t('Active tasks') ?></th>
+ </tr>
+ <?php foreach ($stats['columns'] as $column): ?>
+ <tr>
+ <td><?= Helper\escape($column['title']) ?></td>
+ <td><?= $column['task_limit'] ?: '∞' ?></td>
+ <td><?= $column['nb_active_tasks'] ?></td>
+ </tr>
+ <?php endforeach ?>
+</table>
diff --git a/app/Templates/project_sidebar.php b/app/Templates/project_sidebar.php
new file mode 100644
index 00000000..d711e347
--- /dev/null
+++ b/app/Templates/project_sidebar.php
@@ -0,0 +1,47 @@
+<div class="project-show-sidebar">
+ <h2><?= t('Actions') ?></h2>
+ <div class="project-show-actions">
+ <ul>
+ <li>
+ <a href="?controller=project&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Summary') ?></a>
+ </li>
+ <li>
+ <a href="?controller=project&amp;action=export&amp;project_id=<?= $project['id'] ?>"><?= t('Tasks Export') ?></a>
+ </li>
+
+ <?php if (Helper\is_admin()): ?>
+ <li>
+ <a href="?controller=project&amp;action=share&amp;project_id=<?= $project['id'] ?>"><?= t('Public access') ?></a>
+ </li>
+ <li>
+ <a href="?controller=project&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit project') ?></a>
+ </li>
+ <li>
+ <a href="?controller=board&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a>
+ </li>
+ <li>
+ <a href="?controller=category&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Categories management') ?></a>
+ </li>
+ <li>
+ <a href="?controller=project&amp;action=users&amp;project_id=<?= $project['id'] ?>"><?= t('Users management') ?></a>
+ </li>
+ <li>
+ <a href="?controller=action&amp;action=index&amp;project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a>
+ </li>
+ <li>
+ <a href="?controller=project&amp;action=confirmDuplicate&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Duplicate') ?></a>
+ </li>
+ <li>
+ <?php if ($project['is_active']): ?>
+ <a href="?controller=project&amp;action=confirmDisable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a>
+ <?php else: ?>
+ <a href="?controller=project&amp;action=confirmEnable&amp;project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a>
+ <?php endif ?>
+ </li>
+ <li>
+ <a href="?controller=project&amp;action=confirmRemove&amp;project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a>
+ </li>
+ <?php endif ?>
+ </ul>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Templates/project_users.php b/app/Templates/project_users.php
index 8afac709..dca3524f 100644
--- a/app/Templates/project_users.php
+++ b/app/Templates/project_users.php
@@ -1,46 +1,36 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Project access list for "%s"', $project['name']) ?></h2>
- <ul>
- <li><a href="?controller=project"><?= t('All projects') ?></a></li>
- </ul>
- </div>
- <section>
+<div class="page-header">
+ <h2><?= t('List of authorized users') ?></h2>
+</div>
- <?php if (! empty($users['not_allowed'])): ?>
- <form method="post" action="?controller=project&amp;action=allow&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+<?php if (empty($users['allowed'])): ?>
+ <div class="alert alert-info"><?= t('Everybody have access to this project.') ?></div>
+<?php else: ?>
+<div class="listing">
+ <p><?= t('Only those users have access to this project:') ?></p>
+ <ul>
+ <?php foreach ($users['allowed'] as $user_id => $username): ?>
+ <li>
+ <strong><?= Helper\escape($username) ?></strong>
+ (<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id.Helper\param_csrf() ?>"><?= t('revoke') ?></a>)
+ </li>
+ <?php endforeach ?>
+ </ul>
+ <p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
+</div>
+<?php endif ?>
- <?= Helper\form_csrf() ?>
+<?php if (! empty($users['not_allowed'])): ?>
+ <form method="post" action="?controller=project&amp;action=allow&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
- <?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
+ <?= Helper\form_csrf() ?>
- <?= Helper\form_label(t('User'), 'user_id') ?>
- <?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
+ <?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
- <div class="form-actions">
- <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
- </div>
- </form>
- <?php endif ?>
+ <?= Helper\form_label(t('User'), 'user_id') ?>
+ <?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
- <h3><?= t('List of authorized users') ?></h3>
- <?php if (empty($users['allowed'])): ?>
- <div class="alert alert-info"><?= t('Everybody have access to this project.') ?></div>
- <?php else: ?>
- <div class="listing">
- <p><?= t('Only those users have access to this project:') ?></p>
- <ul>
- <?php foreach ($users['allowed'] as $user_id => $username): ?>
- <li>
- <strong><?= Helper\escape($username) ?></strong>
- (<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id.Helper\param_csrf() ?>"><?= t('revoke') ?></a>)
- </li>
- <?php endforeach ?>
- </ul>
- <p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
- </div>
- <?php endif ?>
-
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
+ </div>
+ </form>
+<?php endif ?> \ No newline at end of file