Simplify subtasks table

This commit is contained in:
Frederic Guillot
2017-02-18 16:03:01 -05:00
parent 76f73eebea
commit d67e9d35ed
2 changed files with 22 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
<div class="dropdown"> <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> <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a>
<ul> <ul>
<li> <li>
<?= $this->modal->medium('edit', t('Edit'), 'SubtaskController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?> <?= $this->modal->medium('edit', t('Edit'), 'SubtaskController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>

View File

@@ -5,13 +5,10 @@
> >
<thead> <thead>
<tr> <tr>
<th class="column-40"><?= t('Title') ?></th> <th class="column-45"><?= t('Title') ?></th>
<th><?= t('Assignee') ?></th> <th class="column-15"><?= t('Assignee') ?></th>
<?= $this->hook->render('template:subtask:table:header:before-timetracking') ?> <?= $this->hook->render('template:subtask:table:header:before-timetracking') ?>
<th><?= t('Time tracking') ?></th> <th><?= t('Time tracking') ?></th>
<?php if ($editable): ?>
<th class="column-5"></th>
<?php endif ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -19,7 +16,11 @@
<tr data-subtask-id="<?= $subtask['id'] ?>"> <tr data-subtask-id="<?= $subtask['id'] ?>">
<td> <td>
<?php if ($editable): ?> <?php if ($editable): ?>
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change subtask position') ?>"></i> <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change subtask position') ?>"></i>&nbsp;
<?= $this->render('subtask/menu', array(
'task' => $task,
'subtask' => $subtask,
)) ?>
<?= $this->subtask->toggleStatus($subtask, $task['project_id'], true) ?> <?= $this->subtask->toggleStatus($subtask, $task['project_id'], true) ?>
<?php else: ?> <?php else: ?>
<?= $this->subtask->getTitle($subtask) ?> <?= $this->subtask->getTitle($subtask) ?>
@@ -32,36 +33,23 @@
</td> </td>
<?= $this->hook->render('template:subtask:table:rows', array('subtask' => $subtask)) ?> <?= $this->hook->render('template:subtask:table:rows', array('subtask' => $subtask)) ?>
<td> <td>
<ul class="no-bullet"> <?php if (! empty($subtask['time_spent'])): ?>
<li> <strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php if (! empty($subtask['time_spent'])): ?> <?php endif ?>
<strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php endif ?>
<?php if (! empty($subtask['time_estimated'])): ?> <?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?> <?php endif ?>
</li>
<?php if ($editable && $subtask['user_id'] == $this->user->getId()): ?> <?php if ($editable && $subtask['user_id'] == $this->user->getId()): ?>
<li> <?php if ($subtask['is_timer_started']): ?>
<?php if ($subtask['is_timer_started']): ?> <?= $this->url->icon('pause', t('Stop timer'), 'SubtaskStatusController', 'timer', array('timer' => 'stop', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?>
<?= $this->url->icon('pause', t('Stop timer'), 'SubtaskStatusController', 'timer', array('timer' => 'stop', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?> (<?= $this->dt->age($subtask['timer_start_date']) ?>)
(<?= $this->dt->age($subtask['timer_start_date']) ?>) <?php else: ?>
<?php else: ?> <?= $this->url->icon('play-circle-o', t('Start timer'), 'SubtaskStatusController', 'timer', array('timer' => 'start', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?>
<?= $this->url->icon('play-circle-o', t('Start timer'), 'SubtaskStatusController', 'timer', array('timer' => 'start', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id']), false, 'subtask-toggle-timer') ?>
<?php endif ?>
</li>
<?php endif ?> <?php endif ?>
</ul> <?php endif ?>
</td> </td>
<?php if ($editable): ?>
<td>
<?= $this->render('subtask/menu', array(
'task' => $task,
'subtask' => $subtask,
)) ?>
</td>
<?php endif ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>