diff options
Diffstat (limited to 'app/Template/file')
-rw-r--r-- | app/Template/file/new.php | 14 | ||||
-rw-r--r-- | app/Template/file/open.php | 6 | ||||
-rw-r--r-- | app/Template/file/remove.php | 15 | ||||
-rw-r--r-- | app/Template/file/screenshot.php | 17 | ||||
-rw-r--r-- | app/Template/file/show.php | 56 |
5 files changed, 108 insertions, 0 deletions
diff --git a/app/Template/file/new.php b/app/Template/file/new.php new file mode 100644 index 00000000..a1a59eae --- /dev/null +++ b/app/Template/file/new.php @@ -0,0 +1,14 @@ +<div class="page-header"> + <h2><?= t('Attach a document') ?></h2> +</div> + +<form action="<?= $this->url->href('file', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" enctype="multipart/form-data"> + <?= $this->form->csrf() ?> + <input type="file" name="files[]" multiple /> + <div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? $this->text->bytes($max_size) : $max_size ?></div> + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/file/open.php b/app/Template/file/open.php new file mode 100644 index 00000000..3df012b6 --- /dev/null +++ b/app/Template/file/open.php @@ -0,0 +1,6 @@ +<div class="page-header"> + <h2><?= $this->e($file['name']) ?></h2> + <div class="task-file-viewer"> + <img src="<?= $this->url->href('file', 'image', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/> + </div> +</div>
\ No newline at end of file diff --git a/app/Template/file/remove.php b/app/Template/file/remove.php new file mode 100644 index 00000000..37f648eb --- /dev/null +++ b/app/Template/file/remove.php @@ -0,0 +1,15 @@ +<div class="page-header"> + <h2><?= t('Remove a file') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this file: "%s"?', $this->e($file['name'])) ?> + </p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </div> +</div>
\ No newline at end of file diff --git a/app/Template/file/screenshot.php b/app/Template/file/screenshot.php new file mode 100644 index 00000000..89d9324c --- /dev/null +++ b/app/Template/file/screenshot.php @@ -0,0 +1,17 @@ +<div class="page-header"> + <h2><?= t('Add a screenshot') ?></h2> +</div> + +<div id="screenshot-zone"> + <p id="screenshot-inner"><?= t('Take a screenshot and press CTRL+V or ⌘+V to paste here.') ?></p> +</div> + +<form action="<?= $this->url->href('file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => $redirect)) ?>" method="post"> + <input type="hidden" name="screenshot"/> + <?= $this->form->csrf() ?> + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> + </div> +</form> diff --git a/app/Template/file/show.php b/app/Template/file/show.php new file mode 100644 index 00000000..7d5dc96f --- /dev/null +++ b/app/Template/file/show.php @@ -0,0 +1,56 @@ +<?php if (! empty($files) || ! empty($images)): ?> +<div id="attachments" class="task-show-section"> + + <div class="page-header"> + <h2><?= t('Attachments') ?></h2> + </div> + <?php if (! empty($images)): ?> + <h3><?= t('Images') ?></h3> + <ul class="task-show-images"> + <?php foreach ($images as $file): ?> + <li> + <?php if (function_exists('imagecreatetruecolor')): ?> + <div class="img_container"> + <img src="<?= $this->url->href('file', 'thumbnail', array('width' => 250, 'height' => 100, 'file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" alt="<?= $this->e($file['name']) ?>"/> + </div> + <?php endif ?> + <p> + <?= $this->e($file['name']) ?> + <span class="column-tooltip" title='<?= t('uploaded by: %s', $file['user_name'] ?: $file['username']).'<br>'.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'<br>'.t('size: %s', $this->text->bytes($file['size'])) ?>'> + <i class="fa fa-info-circle"></i> + </span> + </p> + <span class="task-show-file-actions task-show-image-actions"> + <i class="fa fa-eye"></i> <?= $this->url->link(t('open'), 'file', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + <i class="fa fa-trash"></i> <?= $this->url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + <i class="fa fa-download"></i> <?= $this->url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + </span> + </li> + <?php endforeach ?> + </ul> + <?php endif ?> + + <?php if (! empty($files)): ?> + <h3><?= t('Files') ?></h3> + <table class="task-show-file-table"> + <?php foreach ($files as $file): ?> + <tr> + <td><i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i></td> + <td> + <?= $this->e($file['name']) ?> + <span class="column-tooltip" title='<?= t('uploaded by: %s', $file['user_name'] ?: $file['username']).'<br>'.t('uploaded on: %s', dt('%B %e, %Y at %k:%M %p', $file['date'])).'<br>'.t('size: %s', $this->text->bytes($file['size'])) ?>'> + <i class="fa fa-info-circle"></i> + </span> + </td> + <td> + <span class="task-show-file-actions"> + <i class="fa fa-trash"></i> <?= $this->url->link(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + <i class="fa fa-download"></i> <?= $this->url->link(t('download'), 'file', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + </span> + </td> + </tr> + <?php endforeach ?> + </table> + <?php endif ?> +</div> +<?php endif ?>
\ No newline at end of file |