summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-13 22:36:41 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-13 22:36:41 -0400
commitae70f47cc12587414c03b11a377cba97e1f10361 (patch)
treee42aaa89320597c1b15d56cf02b81fb80f8809c2 /app
parent64e10a645accf8c80c0e7b6686de2ed38621805a (diff)
Added dropdown for projects
Diffstat (limited to 'app')
-rw-r--r--app/Template/app/projects.php2
-rw-r--r--app/Template/project/dropdown.php76
-rw-r--r--app/Template/project/index.php7
-rw-r--r--app/Template/project_header/dropdown.php49
4 files changed, 90 insertions, 44 deletions
diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php
index 733a108d..c0110b07 100644
--- a/app/Template/app/projects.php
+++ b/app/Template/app/projects.php
@@ -14,7 +14,7 @@
<?php foreach ($paginator->getCollection() as $project): ?>
<tr>
<td>
- <?= $this->url->link('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?>
+ <?= $this->render('project/dropdown', array('project' => $project)) ?>
</td>
<td>
<?php if ($project['is_private']): ?>
diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php
index 980f9a44..843574fe 100644
--- a/app/Template/project/dropdown.php
+++ b/app/Template/project/dropdown.php
@@ -1,40 +1,44 @@
-<li>
- <i class="fa fa-dashboard fa-fw"></i>&nbsp;
- <?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
-</li>
+<div class="dropdown">
+ <a href="#" class="dropdown-menu dashboard-table-link">#<?= $project['id'] ?></a>
+ <ul>
+ <li>
+ <i class="fa fa-th fa-fw"></i>
+ <?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'])) ?>
+ </li>
+ <li>
+ <i class="fa fa-calendar fa-fw"></i>
+ <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
+ </li>
+ <li>
+ <i class="fa fa-list fa-fw"></i>
+ <?= $this->url->link(t('Listing'), 'listing', 'show', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php if ($this->user->hasProjectAccess('Gantt', 'project', $project['id'])): ?>
+ <li>
+ <i class="fa fa-sliders fa-fw"></i>
+ <?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php endif ?>
-<?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?>
-<li>
- <i class="fa fa-filter fa-fw"></i>&nbsp;
- <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
-</li>
-<?php endif ?>
+ <li>
+ <i class="fa fa-dashboard fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
+ </li>
-<?php if ($project['is_public']): ?>
-<li>
- <i class="fa fa-share-alt fa-fw"></i>&nbsp;<?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
-</li>
-<?php endif ?>
+ <?php if ($this->user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?>
+ <li>
+ <i class="fa fa-line-chart fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php endif ?>
-<?= $this->hook->render('template:project:dropdown', array('project' => $project)) ?>
+ <?= $this->hook->render('template:project:dropdown', array('project' => $project)) ?>
-<?php if ($this->user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?>
- <li>
- <i class="fa fa-line-chart fa-fw"></i>&nbsp;
- <?= $this->url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
- </li>
-<?php endif ?>
-
-<?php if ($this->user->hasProjectAccess('export', 'tasks', $project['id'])): ?>
- <li>
- <i class="fa fa-download fa-fw"></i>&nbsp;
- <?= $this->url->link(t('Exports'), 'export', 'tasks', array('project_id' => $project['id'])) ?>
- </li>
-<?php endif ?>
-
-<?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
- <li>
- <i class="fa fa-cog fa-fw"></i>&nbsp;
- <?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
- </li>
-<?php endif ?>
+ <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
+ <li>
+ <i class="fa fa-cog fa-fw"></i>
+ <?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php endif ?>
+ </ul>
+</div>
diff --git a/app/Template/project/index.php b/app/Template/project/index.php
index e10467eb..3edb0523 100644
--- a/app/Template/project/index.php
+++ b/app/Template/project/index.php
@@ -28,7 +28,7 @@
<?php foreach ($paginator->getCollection() as $project): ?>
<tr>
<td>
- <?= $this->url->link('#'.$project['id'], 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link') ?>
+ <?= $this->render('project/dropdown', array('project' => $project)) ?>
</td>
<td>
<?php if ($project['is_active']): ?>
@@ -38,9 +38,6 @@
<?php endif ?>
</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')) ?>
-
<?php if ($project['is_public']): ?>
<i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i>
<?php endif ?>
@@ -54,7 +51,7 @@
</span>
<?php endif ?>
- <?= $this->url->link($this->text->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
+ <?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
</td>
<td>
<?= $this->dt->date($project['start_date']) ?>
diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php
index 759a5135..fdfcaf26 100644
--- a/app/Template/project_header/dropdown.php
+++ b/app/Template/project_header/dropdown.php
@@ -29,6 +29,51 @@
</span>
</li>
<?php endif ?>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
+
+ <li>
+ <i class="fa fa-dashboard fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
+ </li>
+
+ <?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?>
+ <li>
+ <i class="fa fa-filter fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php endif ?>
+
+ <?php if ($project['is_public']): ?>
+ <li>
+ <i class="fa fa-share-alt fa-fw"></i>&nbsp;<?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
+ </li>
+ <?php endif ?>
+
+ <?= $this->hook->render('template:project:dropdown', array('project' => $project)) ?>
+
+ <?php if ($this->user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?>
+ <li>
+ <i class="fa fa-line-chart fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php endif ?>
+
+ <?php if ($this->user->hasProjectAccess('export', 'tasks', $project['id'])): ?>
+ <li>
+ <i class="fa fa-download fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Exports'), 'export', 'tasks', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php endif ?>
+
+ <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
+ <li>
+ <i class="fa fa-cog fa-fw"></i>&nbsp;
+ <?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
+ </li>
+ <?php endif ?>
+
+ <li>
+ <i class="fa fa-folder fa-fw" aria-hidden="true"></i>
+ <?= $this->url->link(t('Manage projects'), 'project', 'index') ?>
+ </li>
</ul>
-</div> \ No newline at end of file
+</div>