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

@@ -5,13 +5,10 @@
>
<thead>
<tr>
<th class="column-40"><?= t('Title') ?></th>
<th><?= t('Assignee') ?></th>
<th class="column-45"><?= t('Title') ?></th>
<th class="column-15"><?= t('Assignee') ?></th>
<?= $this->hook->render('template:subtask:table:header:before-timetracking') ?>
<th><?= t('Time tracking') ?></th>
<?php if ($editable): ?>
<th class="column-5"></th>
<?php endif ?>
</tr>
</thead>
<tbody>
@@ -19,7 +16,11 @@
<tr data-subtask-id="<?= $subtask['id'] ?>">
<td>
<?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) ?>
<?php else: ?>
<?= $this->subtask->getTitle($subtask) ?>
@@ -32,36 +33,23 @@
</td>
<?= $this->hook->render('template:subtask:table:rows', array('subtask' => $subtask)) ?>
<td>
<ul class="no-bullet">
<li>
<?php if (! empty($subtask['time_spent'])): ?>
<strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php endif ?>
<?php if (! empty($subtask['time_spent'])): ?>
<strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php endif ?>
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
<?php if ($editable && $subtask['user_id'] == $this->user->getId()): ?>
<li>
<?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->dt->age($subtask['timer_start_date']) ?>)
<?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') ?>
<?php endif ?>
</li>
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
<?php if ($editable && $subtask['user_id'] == $this->user->getId()): ?>
<?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->dt->age($subtask['timer_start_date']) ?>)
<?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') ?>
<?php endif ?>
</ul>
<?php endif ?>
</td>
<?php if ($editable): ?>
<td>
<?= $this->render('subtask/menu', array(
'task' => $task,
'subtask' => $subtask,
)) ?>
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</tbody>