Add dropdown menu for column 'Actions' in tables

This commit is contained in:
Frederic Guillot 2016-01-12 22:19:43 -05:00
parent dfd0c4e48d
commit fde0c0bad5
6 changed files with 34 additions and 19 deletions

View File

@ -8,7 +8,7 @@ New features:
Improvements:
* Add dropdown menu for subtasks
* Add dropdown menu for subtasks, categories, swimlanes, columns, custom filters and groups
* Add new template hooks
Bug fixes:

View File

@ -5,12 +5,14 @@
<table>
<tr>
<th><?= t('Category Name') ?></th>
<th><?= t('Actions') ?></th>
<th class="column-8"><?= t('Actions') ?></th>
</tr>
<?php foreach ($categories as $category_id => $category_name): ?>
<tr>
<td><?= $this->e($category_name) ?></td>
<td>
<div class="dropdown">
<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>
<?= $this->url->link(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
@ -19,6 +21,7 @@
<?= $this->url->link(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
</li>
</ul>
</div>
</td>
</tr>
<?php endforeach ?>

View File

@ -10,21 +10,23 @@
<h3><?= t('Change columns') ?></h3>
<table>
<tr>
<th><?= t('Column title') ?></th>
<th><?= t('Task limit') ?></th>
<th><?= t('Actions') ?></th>
<th class="column-70"><?= t('Column title') ?></th>
<th class="column-25"><?= t('Task limit') ?></th>
<th class="column-5"><?= t('Actions') ?></th>
</tr>
<?php foreach ($columns as $column): ?>
<tr>
<td class="column-60"><?= $this->e($column['title']) ?>
<td><?= $this->e($column['title']) ?>
<?php if (! empty($column['description'])): ?>
<span class="tooltip" title='<?= $this->e($this->text->markdown($column['description'])) ?>'>
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>
</td>
<td class="column-10"><?= $this->e($column['task_limit']) ?></td>
<td class="column-30">
<td><?= $this->e($column['task_limit']) ?></td>
<td>
<div class="dropdown">
<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>
<?= $this->url->link(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
@ -43,6 +45,7 @@
<?= $this->url->link(t('Remove'), 'column', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
</li>
</ul>
</div>
</td>
</tr>
<?php endforeach ?>

View File

@ -5,12 +5,12 @@
<div>
<table>
<tr>
<th><?= t('Name') ?></th>
<th><?= t('Filter') ?></th>
<th><?= t('Shared') ?></th>
<th><?= t('Append/Replace') ?></th>
<th><?= t('Owner') ?></th>
<th><?= t('Actions') ?></th>
<th class="column-15"><?= t('Name') ?></th>
<th class="column-30"><?= t('Filter') ?></th>
<th class="column-10"><?= t('Shared') ?></th>
<th class="column-15"><?= t('Append/Replace') ?></th>
<th class="column-25"><?= t('Owner') ?></th>
<th class="column-5"><?= t('Actions') ?></th>
</tr>
<?php foreach ($custom_filters as $filter): ?>
<tr>
@ -33,10 +33,13 @@
<td><?= $this->e($filter['owner_name'] ?: $filter['owner_username']) ?></td>
<td>
<?php if ($filter['user_id'] == $this->user->getId() || $this->user->hasProjectAccess('customfilter', 'edit', $project['id'])): ?>
<div class="dropdown">
<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><?= $this->url->link(t('Remove'), 'customfilter', 'remove', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id']), true) ?></li>
<li><?= $this->url->link(t('Edit'), 'customfilter', 'edit', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?></li>
</ul>
</div>
<?php endif ?>
</td>
</tr>

View File

@ -8,12 +8,12 @@
<?php if ($paginator->isEmpty()): ?>
<p class="alert"><?= t('There is no group.') ?></p>
<?php else: ?>
<table class="table-small">
<table class="table-small table-fixed">
<tr>
<th class="column-5"><?= $paginator->order(t('Id'), 'id') ?></th>
<th class="column-20"><?= $paginator->order(t('External Id'), 'external_id') ?></th>
<th><?= $paginator->order(t('Name'), 'name') ?></th>
<th class="column-20"><?= t('Actions') ?></th>
<th class="column-5"><?= t('Actions') ?></th>
</tr>
<?php foreach ($paginator->getCollection() as $group): ?>
<tr>
@ -27,12 +27,15 @@
<?= $this->e($group['name']) ?>
</td>
<td>
<div class="dropdown">
<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><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li>
<li><?= $this->url->link(t('Members'), 'group', 'users', array('group_id' => $group['id'])) ?></li>
<li><?= $this->url->link(t('Edit'), 'group', 'edit', array('group_id' => $group['id'])) ?></li>
<li><?= $this->url->link(t('Remove'), 'group', 'confirm', array('group_id' => $group['id'])) ?></li>
</ul>
</div>
</td>
</tr>
<?php endforeach ?>

View File

@ -1,10 +1,10 @@
<table>
<tr>
<?php if (! isset($hide_position)): ?>
<th><?= t('Position') ?></th>
<th class="column-10"><?= t('Position') ?></th>
<?php endif ?>
<th class="column-60"><?= t('Name') ?></th>
<th class="column-35"><?= t('Actions') ?></th>
<th><?= t('Name') ?></th>
<th class="column-8"><?= t('Actions') ?></th>
</tr>
<?php foreach ($swimlanes as $swimlane): ?>
<tr>
@ -13,6 +13,8 @@
<?php endif ?>
<td><?= $this->e($swimlane['name']) ?></td>
<td>
<div class="dropdown">
<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>
<?php if ($swimlane['position'] != 0 && $swimlane['position'] != 1): ?>
<li>
@ -38,6 +40,7 @@
<?= $this->url->link(t('Remove'), 'swimlane', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
</ul>
</div>
</td>
</tr>
<?php endforeach ?>