Refactoring/simplification of the pull-request about links

This commit is contained in:
Frederic Guillot
2015-02-14 16:11:13 -05:00
parent 364382b1b5
commit f7e4c3928a
77 changed files with 1407 additions and 2588 deletions

View File

@@ -1,28 +1,15 @@
<section class="tooltip-tasklinks">
<div>
<ul>
<?php
$previous_link = null;
foreach ($links as $link): ?>
<?php if (null == $previous_link || $previous_link != $link['label']): ?>
<?php if (null != $previous_link): ?>
</ul>
<div class="tooltip-tasklinks">
<ul>
<?php foreach($links as $link): ?>
<li>
<strong><?= t($link['label']) ?></strong>
<?= $this->a(
$this->e('#'.$link['task_id'].' - '.$link['title']),
'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']),
false,
$link['is_active'] ? '' : 'task-link-closed'
) ?>
</li>
<?php endif ?>
<?php $previous_link = $link['label']; ?>
<li><?= t($this->e($link['label'])) ?>
<ul>
<?php endif ?>
<li<?php if (0 == $link['task_inverse_is_active']): ?> class="task-closed"<?php endif ?>>
<?= $this->e($link['task_inverse_category']) ?>
<?= $this->a('#'.$this->e($link['task_inverse_id']).' - '.trim($this->e($link['task_inverse_title'])),
'task',
'show',
array('task_id' => $link['task_inverse_id'], 'project_id' => $link['task_inverse_project_id'])) ?>
</li>
<?php endforeach ?>
</ul>
</li>
</ul>
</div>
</section>
<?php endforeach ?>
</ul>
</div>