diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-08-30 14:08:46 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-08-30 14:08:46 -0800 |
commit | 9194a2604d79ef97994d01c35fb454f745b5412c (patch) | |
tree | 365dd4294e536c440610bee4f07a1bffb00d00eb /app/Templates/project_index.php | |
parent | e1eba08398c6c6ece684f9db6dedb0dff5d43071 (diff) |
Projects management refactoring
Diffstat (limited to 'app/Templates/project_index.php')
-rw-r--r-- | app/Templates/project_index.php | 109 |
1 files changed, 21 insertions, 88 deletions
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&action=show&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&action=show&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&action=tasks&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&action=show&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&action=show&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&action=index&project_id=<?= $project['id'] ?>"><?= t('Categories') ?></a> - </li> - <li> - <a href="?controller=project&action=edit&project_id=<?= $project['id'] ?>"><?= t('Edit project') ?></a> - </li> - <li> - <a href="?controller=project&action=users&project_id=<?= $project['id'] ?>"><?= t('Edit users access') ?></a> - </li> - <li> - <a href="?controller=board&action=edit&project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a> - </li> - <li> - <a href="?controller=action&action=index&project_id=<?= $project['id'] ?>"><?= t('Automatic actions') ?></a> - </li> - <li> - <?php if ($project['is_active']): ?> - <a href="?controller=project&action=disable&project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Disable') ?></a> - <?php else: ?> - <a href="?controller=project&action=enable&project_id=<?= $project['id'].Helper\param_csrf() ?>"><?= t('Enable') ?></a> - <?php endif ?> - </li> - <li> - <a href="?controller=project&action=confirm&project_id=<?= $project['id'] ?>"><?= t('Remove') ?></a> - </li> - <li> - <a href="?controller=board&action=readonly&token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a> - </li> - <li> - <a href="?controller=project&action=export&project_id=<?= $project['id'] ?>"><?= t('Tasks Export') ?></a> - </li> - <li> - <a href="?controller=project&action=duplicate&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 |