summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorRafael de Camargo <rafacamargo123@gmail.com>2019-05-22 10:32:36 -0300
committerfguillot <fred@kanboard.net>2019-05-26 20:54:42 +0200
commitc60d642a1a9976e7d43e8711784533abeb74a07f (patch)
tree048fd6413e816ccb8c81633d2e3ee019f9254142 /app/Template
parent96dd20c0cd0b3d30da7240444be734d92e3c0536 (diff)
Add View File on popover to tooltip
Merged this if with the if used on template:task_file:files
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/tooltip_files.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Template/board/tooltip_files.php b/app/Template/board/tooltip_files.php
index 390139eb..5cd9b004 100644
--- a/app/Template/board/tooltip_files.php
+++ b/app/Template/board/tooltip_files.php
@@ -10,9 +10,12 @@
<tr>
<td>
<?= $this->url->icon('download', t('Download'), 'FileViewerController', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
- <?php if ($file['is_image'] == 1): ?>
+ <?php if ($this->file->getPreviewType($file['name']) !== null || $file['is_image'] == 1): ?>
&nbsp;<?= $this->modal->large('eye', t('View file'), 'FileViewerController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
- &nbsp;<?= $this->url->icon('external-link', t('View file'), 'FileViewerController', 'image', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, '', '', true) ?>
+ &nbsp;<?= $this->url->icon('external-link', t('View file'), 'FileViewerController', ($file['is_image'] == 1 ? 'image' : 'show'), array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, '', '', true) ?>
+ <?php elseif ($this->file->getBrowserViewType($file['name']) !== null): ?>
+ <i class="fa fa-eye fa-fw"></i>
+ <?= $this->url->link(t('View file'), 'FileViewerController', 'browser', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, '', '', true) ?>
<?php endif ?>
</td>
</tr>