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/show.php | 23 |
4 files changed, 58 insertions, 0 deletions
diff --git a/app/Template/file/new.php b/app/Template/file/new.php new file mode 100644 index 00000000..63c29f1d --- /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="<?= Helper\u('file', 'save', array('task_id' => $task['id'])) ?>" method="post" enctype="multipart/form-data"> + <?= Helper\form_csrf() ?> + <input type="file" name="files[]" multiple /> + <div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? Helper\format_bytes($max_size) : $max_size ?></div> + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['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..6106e6f8 --- /dev/null +++ b/app/Template/file/open.php @@ -0,0 +1,6 @@ +<div class="page-header"> + <h2><?= Helper\escape($file['name']) ?></h2> + <div class="task-file-viewer"> + <img src="<?= Helper\u('file', 'image', array('file_id' => $file['id'], 'task_id' => $file['task_id'])) ?>" alt="<?= Helper\escape($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..4f655e5a --- /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"?', Helper\escape($file['name'])) ?> + </p> + + <div class="form-actions"> + <?= Helper\a(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + </div> +</div>
\ No newline at end of file diff --git a/app/Template/file/show.php b/app/Template/file/show.php new file mode 100644 index 00000000..92a7c100 --- /dev/null +++ b/app/Template/file/show.php @@ -0,0 +1,23 @@ +<?php if (! empty($files)): ?> +<div id="attachments" class="task-show-section"> + + <div class="page-header"> + <h2><?= t('Attachments') ?></h2> + </div> + + <ul class="task-show-files"> + <?php foreach ($files as $file): ?> + <li> + <?= Helper\a(Helper\escape($file['name']), 'file', 'download', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?> + <span class="task-show-file-actions"> + <?php if ($file['is_image']): ?> + <?= Helper\a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'file_id' => $file['id']), false, 'file-popover') ?>, + <?php endif ?> + <?= Helper\a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?> + </span> + </li> + <?php endforeach ?> + </ul> + +</div> +<?php endif ?>
\ No newline at end of file |