Improve task view table

This commit is contained in:
Frederic Guillot
2017-02-18 16:25:59 -05:00
parent d67e9d35ed
commit ab40004558
6 changed files with 44 additions and 51 deletions

View File

@@ -7,6 +7,7 @@ New features:
Improvements: Improvements:
* Improve task view tables
* Simplify automatic actions table * Simplify automatic actions table
* Show category description in tooltip * Show category description in tooltip
* Show category creation form in modal dialog * Show category creation form in modal dialog

View File

@@ -1,19 +1,29 @@
<?php if (! empty($links)): ?> <?php if (! empty($links)): ?>
<table class="table-striped table-scrolling"> <table class="table-striped table-scrolling">
<tr> <tr>
<th class="column-10"><?= t('Type') ?></th> <th class="column-15"><?= t('Type') ?></th>
<th><?= t('Title') ?></th> <th><?= t('Title') ?></th>
<th class="column-10"><?= t('Dependency') ?></th> <th class="column-10"><?= t('Dependency') ?></th>
<th class="column-15"><?= t('Creator') ?></th> <th class="column-15"><?= t('Creator') ?></th>
<th class="column-15"><?= t('Date') ?></th> <th class="column-15"><?= t('Date') ?></th>
<?php if ($this->user->hasProjectAccess('TaskExternalLinkController', 'edit', $task['project_id'])): ?>
<th class="column-5"><?= t('Action') ?></th>
<?php endif ?>
</tr> </tr>
<?php foreach ($links as $link): ?> <?php foreach ($links as $link): ?>
<tr> <tr>
<td> <td>
<?= $link['type'] ?> <?php if ($this->user->hasProjectAccess('TaskExternalLinkController', 'edit', $task['project_id'])): ?>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a>
<ul>
<li>
<?= $this->modal->medium('edit', t('Edit'), 'TaskExternalLinkController', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->modal->confirm('trash-o', t('Remove'), 'TaskExternalLinkController', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
</ul>
</div>
<?php endif ?>
<?= $this->text->e($link['type']) ?>
</td> </td>
<td> <td>
<a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a> <a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
@@ -27,21 +37,6 @@
<td> <td>
<?= $this->dt->date($link['date_creation']) ?> <?= $this->dt->date($link['date_creation']) ?>
</td> </td>
<?php if ($this->user->hasProjectAccess('TaskExternalLinkController', 'edit', $task['project_id'])): ?>
<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->modal->medium('edit', t('Edit'), 'TaskExternalLinkController', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->modal->confirm('trash-o', t('Remove'), 'TaskExternalLinkController', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
</ul>
</div>
</td>
<?php endif ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</table> </table>

View File

@@ -5,20 +5,16 @@
<?php foreach ($grouped_links as $link): ?> <?php foreach ($grouped_links as $link): ?>
<?php if (! $hide_td): ?> <?php if (! $hide_td): ?>
<tr> <tr>
<td class="column-40" colspan="2"> <th class="column-45">
<?= t('This task') ?> <?= t('This task') ?>
<strong><?= t($label) ?></strong> <em><?= t($label) ?></em>
<span class="task-links-task-count">(<?= count($grouped_links) ?>)</span> <span class="task-links-task-count">(<?= count($grouped_links) ?>)</span>
</td> </th>
<th><?= t('Assignee') ?></th> <th class="column-15"><?= t('Assignee') ?></th>
<th><?= t('Time tracking') ?></th> <th><?= t('Time tracking') ?></th>
<?php if ($editable): ?>
<th class="column-5"></th>
<?php endif ?>
</tr> </tr>
<?php $hide_td = true ?> <?php $hide_td = true ?>
<?php endif ?> <?php endif ?>
<tr> <tr>
<td> <td>
<?php if ($is_public): ?> <?php if ($is_public): ?>
@@ -31,6 +27,20 @@
$link['is_active'] ? '' : 'task-link-closed' $link['is_active'] ? '' : 'task-link-closed'
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?php if ($editable && $this->user->hasProjectAccess('Tasklink', 'edit', $task['project_id'])): ?>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a>
<ul>
<li>
<?= $this->modal->medium('edit', t('Edit'), 'TaskInternalLinkController', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->modal->confirm('trash-o', t('Remove'), 'TaskInternalLinkController', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
</ul>
</div>
<?php endif ?>
<?= $this->url->link( <?= $this->url->link(
$this->text->e('#'.$link['task_id'].' '.$link['title']), $this->text->e('#'.$link['task_id'].' '.$link['title']),
'TaskViewController', 'TaskViewController',
@@ -41,13 +51,7 @@
) ?> ) ?>
<?php endif ?> <?php endif ?>
<?php if ($link['project_id'] != $project['id']): ?> (<?php if ($link['project_id'] != $project['id']): ?><?= $this->text->e($link['project_name']) ?> - <?php endif ?><?= $this->text->e($link['column_title']) ?>)
<br>
<?= $this->text->e($link['project_name']) ?>
<?php endif ?>
</td>
<td>
<?= $this->text->e($link['column_title']) ?>
</td> </td>
<td> <td>
<?php if (! empty($link['task_assignee_username'])): ?> <?php if (! empty($link['task_assignee_username'])): ?>
@@ -67,21 +71,6 @@
<strong><?= $this->text->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?> <strong><?= $this->text->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?> <?php endif ?>
</td> </td>
<?php if ($editable && $this->user->hasProjectAccess('Tasklink', 'edit', $task['project_id'])): ?>
<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->modal->medium('edit', t('Edit'), 'TaskInternalLinkController', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li>
<?= $this->modal->confirm('trash-o', t('Remove'), 'TaskInternalLinkController', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
</ul>
</div>
</td>
<?php endif ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
<?php endforeach ?> <?php endforeach ?>

File diff suppressed because one or more lines are too long

View File

@@ -56,3 +56,10 @@ ul.dropdown-submenu-open
.dropdown-menu-link-text:hover .dropdown-menu-link-text:hover
text-decoration: underline text-decoration: underline
td
a.dropdown-menu
i
color: #dedede
&:hover i
color: color('primary')

View File

@@ -6,6 +6,7 @@
.task-links-task-count .task-links-task-count
color: color('light') color: color('light')
font-weight: normal
.task-link-closed .task-link-closed
text-decoration: line-through text-decoration: line-through