summaryrefslogtreecommitdiff
path: root/app/Template/task_external_link/show.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-18 21:00:14 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-18 21:00:14 -0400
commit854457baf0043b51ce9c30f36a6fecaed97cb04d (patch)
tree0f73023f63654ee7313ac79e83d9d19e58658a1a /app/Template/task_external_link/show.php
parent68fba8fb64afe00aedccdf72f25d79b26356f2ab (diff)
Improve task summary sections
Diffstat (limited to 'app/Template/task_external_link/show.php')
-rw-r--r--app/Template/task_external_link/show.php72
1 files changed, 12 insertions, 60 deletions
diff --git a/app/Template/task_external_link/show.php b/app/Template/task_external_link/show.php
index e9339e86..8ed11803 100644
--- a/app/Template/task_external_link/show.php
+++ b/app/Template/task_external_link/show.php
@@ -1,60 +1,12 @@
-<div class="task-show-title color-<?= $task['color_id'] ?>">
- <h2><?= $this->text->e($task['title']) ?></h2>
-</div>
-
-<div class="page-header">
- <h2><?= t('External links') ?></h2>
- <ul>
- <li>
- <i class="fa fa-external-link fa-fw"></i>
- <?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- </ul>
-</div>
-
-<?php if (empty($links)): ?>
- <p class="alert"><?= t('There is no external link for the moment.') ?></p>
-<?php else: ?>
- <table class="table-stripped table-small">
- <tr>
- <th class="column-10"><?= t('Type') ?></th>
- <th><?= t('Title') ?></th>
- <th class="column-10"><?= t('Dependency') ?></th>
- <th class="column-15"><?= t('Creator') ?></th>
- <th class="column-15"><?= t('Date') ?></th>
- <?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
- <th class="column-5"><?= t('Action') ?></th>
- <?php endif ?>
- </tr>
- <?php foreach ($links as $link): ?>
- <tr>
- <td>
- <?= $link['type'] ?>
- </td>
- <td>
- <a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
- </td>
- <td>
- <?= $this->text->e($link['dependency_label']) ?>
- </td>
- <td>
- <?= $this->text->e($link['creator_name'] ?: $link['creator_username']) ?>
- </td>
- <td>
- <?= $this->dt->date($link['date_creation']) ?>
- </td>
- <?php if ($this->user->hasProjectAccess('TaskExternalLink', '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->url->link(t('Edit'), 'TaskExternalLink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
- <li><?= $this->url->link(t('Remove'), 'TaskExternalLink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
- </ul>
- </div>
- </td>
- <?php endif ?>
- </tr>
- <?php endforeach ?>
- </table>
-<?php endif ?>
+<section class="accordion-section <?= empty($links) ? 'accordion-collapsed' : '' ?>">
+ <div class="accordion-title">
+ <h3><a href="#" class="fa accordion-toggle"></a> <?= t('External links') ?></h3>
+ </div>
+ <div class="accordion-content">
+ <?= $this->render('task_external_link/table', array(
+ 'links' => $links,
+ 'task' => $task,
+ 'project' => $project,
+ )) ?>
+ </div>
+</section>