diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-05-22 20:58:21 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-05-22 20:58:21 -0400 |
commit | 40917992e775bd21a280eb267241c452e04e5ade (patch) | |
tree | c1bf82ab83564bc9ca749f026f54342cbd35374f /app/Templates | |
parent | 2230dd4e6b148346c0ec596b9e3e12996a762ed8 (diff) |
Add files upload
Diffstat (limited to 'app/Templates')
-rw-r--r-- | app/Templates/board_show.php | 6 | ||||
-rw-r--r-- | app/Templates/task_close.php | 4 | ||||
-rw-r--r-- | app/Templates/task_layout.php | 3 | ||||
-rw-r--r-- | app/Templates/task_open.php | 24 | ||||
-rw-r--r-- | app/Templates/task_open_file.php | 6 | ||||
-rw-r--r-- | app/Templates/task_remove.php | 4 | ||||
-rw-r--r-- | app/Templates/task_remove_file.php | 14 | ||||
-rw-r--r-- | app/Templates/task_show.php | 17 | ||||
-rw-r--r-- | app/Templates/task_sidebar.php | 4 | ||||
-rw-r--r-- | app/Templates/task_upload.php | 10 |
10 files changed, 76 insertions, 16 deletions
diff --git a/app/Templates/board_show.php b/app/Templates/board_show.php index 719e3bdd..78f9dd50 100644 --- a/app/Templates/board_show.php +++ b/app/Templates/board_show.php @@ -59,7 +59,7 @@ </div> <?php endif ?> - <?php if (! empty($task['date_due']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?> + <?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?> <div class="task-footer"> <?php if (! empty($task['date_due'])): ?> @@ -69,6 +69,10 @@ <?php endif ?> <div class="task-icons"> + <?php if (! empty($task['nb_files'])): ?> + <?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i> + <?php endif ?> + <?php if (! empty($task['nb_comments'])): ?> <?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i> <?php endif ?> diff --git a/app/Templates/task_close.php b/app/Templates/task_close.php index 3531b37d..6843c2f6 100644 --- a/app/Templates/task_close.php +++ b/app/Templates/task_close.php @@ -1,3 +1,7 @@ +<div class="page-header"> + <h2><?= t('Close a task') ?></h2> +</div> + <div class="confirm"> <p class="alert alert-info"> <?= t('Do you really want to close this task: "%s"?', Helper\escape($task['title'])) ?> diff --git a/app/Templates/task_layout.php b/app/Templates/task_layout.php index 9a6bbd00..ce5f36c5 100644 --- a/app/Templates/task_layout.php +++ b/app/Templates/task_layout.php @@ -13,4 +13,5 @@ <?= $task_content_for_layout ?> </div> </section> -</section>
\ No newline at end of file +</section> +<script type="text/javascript" src="assets/js/task.js"></script>
\ No newline at end of file diff --git a/app/Templates/task_open.php b/app/Templates/task_open.php index 54cc11f0..59ea0b54 100644 --- a/app/Templates/task_open.php +++ b/app/Templates/task_open.php @@ -1,16 +1,14 @@ -<section id="main"> - <div class="page-header"> - <h2><?= t('Open a task') ?></h2> - </div> +<div class="page-header"> + <h2><?= t('Open a task') ?></h2> +</div> - <div class="confirm"> - <p class="alert alert-info"> - <?= t('Do you really want to open this task: "%s"?', Helper\escape($task['title'])) ?> - </p> +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to open this task: "%s"?', Helper\escape($task['title'])) ?> + </p> - <div class="form-actions"> - <a href="?controller=task&action=open&task_id=<?= $task['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a> - <?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> - </div> + <div class="form-actions"> + <a href="?controller=task&action=open&task_id=<?= $task['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a> + <?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> </div> -</section>
\ No newline at end of file +</div>
\ No newline at end of file diff --git a/app/Templates/task_open_file.php b/app/Templates/task_open_file.php new file mode 100644 index 00000000..e0817f01 --- /dev/null +++ b/app/Templates/task_open_file.php @@ -0,0 +1,6 @@ +<div class="page-header"> + <h2><?= Helper\escape($file['name']) ?></h2> + <div class="task-file-viewer"> + <img src="?controller=task&action=image&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/Templates/task_remove.php b/app/Templates/task_remove.php index 1aa9503b..60e4e8e7 100644 --- a/app/Templates/task_remove.php +++ b/app/Templates/task_remove.php @@ -1,3 +1,7 @@ +<div class="page-header"> + <h2><?= t('Remove a task') ?></h2> +</div> + <div class="confirm"> <p class="alert alert-info"> <?= t('Do you really want to remove this task: "%s"?', Helper\escape($task['title'])) ?> diff --git a/app/Templates/task_remove_file.php b/app/Templates/task_remove_file.php new file mode 100644 index 00000000..9687b602 --- /dev/null +++ b/app/Templates/task_remove_file.php @@ -0,0 +1,14 @@ +<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"> + <a href="?controller=task&action=removeFile&task_id=<?= $task['id'] ?>&file_id=<?= $file['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a> + <?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> + </div> +</div>
\ No newline at end of file diff --git a/app/Templates/task_show.php b/app/Templates/task_show.php index a5b79359..56f6cba5 100644 --- a/app/Templates/task_show.php +++ b/app/Templates/task_show.php @@ -64,6 +64,23 @@ </form> <?php endif ?> +<?php if (! empty($files)): ?> + <h2 id="attachments"><?= t('Attachments') ?></h2> + <ul class="task-show-files"> + <?php foreach ($files as $file): ?> + <li> + <a href="?controller=task&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a> + <span class="task-show-file-actions"> + <?php if ($file['is_image']): ?> + <a href="?controller=task&action=openFile&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>, + <?php endif ?> + <a href="?controller=task&action=confirmRemoveFile&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= t('remove') ?></a> + </span> + </li> + <?php endforeach ?> + </ul> +<?php endif ?> + <h2><?= t('Comments') ?></h2> <?php if ($comments): ?> <ul id="comments"> diff --git a/app/Templates/task_sidebar.php b/app/Templates/task_sidebar.php index 314d5214..9dbc1a8c 100644 --- a/app/Templates/task_sidebar.php +++ b/app/Templates/task_sidebar.php @@ -2,8 +2,10 @@ <h2><?= t('Actions') ?></h2> <div class="task-show-actions"> <ul> - <li><a href="?controller=task&action=duplicate&project_id=<?= $task['project_id'] ?>&task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li> + <li><a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('Description') ?></a></li> <li><a href="?controller=task&action=edit&task_id=<?= $task['id'] ?>"><?= t('Edit') ?></a></li> + <li><a href="?controller=task&action=file&task_id=<?= $task['id'] ?>"><?= t('Attach a document') ?></a></li> + <li><a href="?controller=task&action=duplicate&project_id=<?= $task['project_id'] ?>&task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li> <li> <?php if ($task['is_active'] == 1): ?> <a href="?controller=task&action=confirmClose&task_id=<?= $task['id'] ?>"><?= t('Close this task') ?></a> diff --git a/app/Templates/task_upload.php b/app/Templates/task_upload.php new file mode 100644 index 00000000..7100ab31 --- /dev/null +++ b/app/Templates/task_upload.php @@ -0,0 +1,10 @@ +<div class="page-header"> + <h2><?= t('Attach a document') ?></h2> +</div> + +<form action="?controller=task&action=upload&task_id=<?= $task['id'] ?>" method="post" enctype="multipart/form-data"> + <input type="file" name="files[]" multiple /> + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + </div> +</form>
\ No newline at end of file |