summaryrefslogtreecommitdiff
path: root/app/Templates
diff options
context:
space:
mode:
Diffstat (limited to 'app/Templates')
-rw-r--r--app/Templates/comment_create.php17
-rw-r--r--app/Templates/comment_edit.php15
-rw-r--r--app/Templates/comment_remove.php26
-rw-r--r--app/Templates/comment_show.php48
-rw-r--r--app/Templates/file_new.php12
-rw-r--r--app/Templates/file_open.php (renamed from app/Templates/task_open_file.php)2
-rw-r--r--app/Templates/file_remove.php (renamed from app/Templates/task_remove_file.php)2
-rw-r--r--app/Templates/task_edit.php7
-rw-r--r--app/Templates/task_edit_description.php16
-rw-r--r--app/Templates/task_show.php150
-rw-r--r--app/Templates/task_sidebar.php8
-rw-r--r--app/Templates/task_upload.php10
12 files changed, 173 insertions, 140 deletions
diff --git a/app/Templates/comment_create.php b/app/Templates/comment_create.php
new file mode 100644
index 00000000..a566d9c8
--- /dev/null
+++ b/app/Templates/comment_create.php
@@ -0,0 +1,17 @@
+<div class="page-header">
+ <h2><?= t('Add a comment') ?></h2>
+</div>
+
+<form method="post" action="?controller=comment&amp;action=save&amp;task_id=<?= $task['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_hidden('task_id', $values) ?>
+ <?= Helper\form_hidden('user_id', $values) ?>
+ <?= Helper\form_textarea('comment', $values, $errors, array('required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?><br/>
+ <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</form>
diff --git a/app/Templates/comment_edit.php b/app/Templates/comment_edit.php
new file mode 100644
index 00000000..0a17a95e
--- /dev/null
+++ b/app/Templates/comment_edit.php
@@ -0,0 +1,15 @@
+<div class="page-header">
+ <h2><?= t('Edit a comment') ?></h2>
+</div>
+
+<form method="post" action="?controller=comment&amp;action=update&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_hidden('id', $values) ?>
+ <?= Helper\form_textarea('comment', $values, $errors, array('required', 'placeholder="'.t('Leave a comment').'"')) ?><br/>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</form>
diff --git a/app/Templates/comment_remove.php b/app/Templates/comment_remove.php
index ad1b8e4a..02a23f93 100644
--- a/app/Templates/comment_remove.php
+++ b/app/Templates/comment_remove.php
@@ -1,18 +1,16 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Remove a comment') ?></h2>
- </div>
+<div class="page-header">
+ <h2><?= t('Add a comment') ?></h2>
+</div>
- <div class="confirm">
- <p class="alert alert-info">
- <?= t('Do you really want to remove this comment?') ?>
- </p>
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this comment?') ?>
+ </p>
- <?= Helper\template('comment_show', array('comment' => $comment)) ?>
+ <?= Helper\template('comment_show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?>
- <div class="form-actions">
- <a href="?controller=comment&amp;action=remove&amp;project_id=<?= $project_id ?>&amp;comment_id=<?= $comment['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $comment['task_id'] ?>#comment-<?= $comment['id'] ?>"><?= t('cancel') ?></a>
- </div>
+ <div class="form-actions">
+ <a href="?controller=comment&amp;action=remove&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>#comment-<?= $comment['id'] ?>"><?= t('cancel') ?></a>
</div>
-</section> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/app/Templates/comment_show.php b/app/Templates/comment_show.php
index 24bf9070..227c0fcc 100644
--- a/app/Templates/comment_show.php
+++ b/app/Templates/comment_show.php
@@ -1,36 +1,28 @@
-<div class="<?= isset($display_edit_form) && $display_edit_form === true ? 'comment-edit' : 'comment' ?>" id="comment-<?= $comment['id'] ?>">
+<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>">
+
<p class="comment-title">
<span class="comment-username"><?= Helper\escape($comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %G at %k:%M %p', $comment['date']) ?></span>
</p>
- <?php if (isset($task)): ?>
- <ul class="comment-actions">
- <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li>
- <?php if (Helper\is_admin() || Helper\is_current_user($comment['user_id'])): ?>
- <li>
- <a href="?controller=comment&amp;action=confirm&amp;project_id=<?= $task['project_id'] ?>&amp;comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a>
- </li>
- <li>
- <a href="?controller=comment&amp;action=edit&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>#comment-<?= $comment['id'] ?>"><?= t('edit') ?></a>
- </li>
- <?php endif ?>
- </ul>
- <?php endif ?>
- <?php if (isset($display_edit_form) && $display_edit_form === true): ?>
- <form method="post" action="?controller=comment&amp;action=update&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>" autocomplete="off">
+ <div class="comment-inner">
+
+ <?php if (! isset($preview)): ?>
+ <ul class="comment-actions">
+ <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li>
+ <?php if (Helper\is_admin() || Helper\is_current_user($comment['user_id'])): ?>
+ <li>
+ <a href="?controller=comment&amp;action=confirm&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a>
+ </li>
+ <li>
+ <a href="?controller=comment&amp;action=edit&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>"><?= t('edit') ?></a>
+ </li>
+ <?php endif ?>
+ </ul>
+ <?php endif ?>
- <?= Helper\form_hidden('id', $values) ?>
- <?= Helper\form_textarea('comment', $values, $errors, array('required', 'placeholder="'.t('Leave a comment').'"')) ?><br/>
+ <div class="markdown">
+ <?= Helper\parse($comment['comment']) ?>
+ </div>
- <div class="form-actions">
- <input type="submit" value="<?= t('Update this comment') ?>" class="btn btn-blue"/>
- <?= t('or') ?>
- <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
- </div>
- </form>
- <?php else: ?>
- <div class="markdown">
- <?= Helper\markdown($comment['comment']) ?>
</div>
- <?php endif ?>
</div> \ No newline at end of file
diff --git a/app/Templates/file_new.php b/app/Templates/file_new.php
new file mode 100644
index 00000000..43223d0c
--- /dev/null
+++ b/app/Templates/file_new.php
@@ -0,0 +1,12 @@
+<div class="page-header">
+ <h2><?= t('Attach a document') ?></h2>
+</div>
+
+<form action="?controller=file&amp;action=save&amp;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"/>
+ <?= t('or') ?>
+ <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/task_open_file.php b/app/Templates/file_open.php
index e0817f01..aa181d64 100644
--- a/app/Templates/task_open_file.php
+++ b/app/Templates/file_open.php
@@ -1,6 +1,6 @@
<div class="page-header">
<h2><?= Helper\escape($file['name']) ?></h2>
<div class="task-file-viewer">
- <img src="?controller=task&amp;action=image&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $file['task_id'] ?>" alt="<?= Helper\escape($file['name']) ?>"/>
+ <img src="?controller=file&amp;action=image&amp;file_id=<?= $file['id'] ?>&amp;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_file.php b/app/Templates/file_remove.php
index 9687b602..1d26c15e 100644
--- a/app/Templates/task_remove_file.php
+++ b/app/Templates/file_remove.php
@@ -8,7 +8,7 @@
</p>
<div class="form-actions">
- <a href="?controller=task&amp;action=removeFile&amp;task_id=<?= $task['id'] ?>&amp;file_id=<?= $file['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <a href="?controller=file&amp;action=remove&amp;task_id=<?= $task['id'] ?>&amp;file_id=<?= $file['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
</div>
</div> \ No newline at end of file
diff --git a/app/Templates/task_edit.php b/app/Templates/task_edit.php
index 8c8bc107..d698c21d 100644
--- a/app/Templates/task_edit.php
+++ b/app/Templates/task_edit.php
@@ -1,9 +1,12 @@
<section id="main">
<div class="page-header">
<h2><?= t('Edit a task') ?></h2>
+ <ul>
+ <li><a href="?controller=board&amp;action=show&amp;project_id=<?= $task['project_id'] ?>"><?= t('Back to the board') ?></a></li>
+ </ul>
</div>
<section>
- <form method="post" action="?controller=task&amp;action=update" autocomplete="off">
+ <form method="post" action="?controller=task&amp;action=update&amp;task_id=<?= $task['id'] ?>" autocomplete="off">
<div class="form-column">
@@ -44,7 +47,7 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=board&amp;action=show&amp;project_id=<?= $values['project_id'] ?>"><?= t('cancel') ?></a>
+ <?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
</div>
</form>
</section>
diff --git a/app/Templates/task_edit_description.php b/app/Templates/task_edit_description.php
new file mode 100644
index 00000000..0bdc40a2
--- /dev/null
+++ b/app/Templates/task_edit_description.php
@@ -0,0 +1,16 @@
+<div class="page-header">
+ <h2><?= t('Edit the description') ?></h2>
+</div>
+
+<form method="post" action="?controller=task&amp;action=saveDescription&amp;task_id=<?= $task['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_hidden('id', $values) ?>
+ <?= Helper\form_textarea('description', $values, $errors, array('required', 'placeholder="'.t('Leave a description').'"'), 'description-textarea') ?><br/>
+ <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</form>
diff --git a/app/Templates/task_show.php b/app/Templates/task_show.php
index 56f6cba5..53cdbae8 100644
--- a/app/Templates/task_show.php
+++ b/app/Templates/task_show.php
@@ -1,111 +1,99 @@
-<article class="task task-<?= $task['color_id'] ?> task-show-details">
+<div class="task-<?= $task['color_id'] ?> task-show-details">
<h2><?= Helper\escape($task['title']) ?></h2>
-<?php if ($task['score']): ?>
- <span class="task-score"><?= Helper\escape($task['score']) ?></span>
-<?php endif ?>
-<ul>
- <li>
- <?= dt('Created on %B %e, %G at %k:%M %p', $task['date_creation']) ?>
- </li>
- <?php if ($task['date_completed']): ?>
- <li>
- <?= dt('Completed on %B %e, %G at %k:%M %p', $task['date_completed']) ?>
- </li>
- <?php endif ?>
- <?php if ($task['date_due']): ?>
- <li>
- <strong><?= dt('Must be done before %B %e, %G', $task['date_due']) ?></strong>
- </li>
+ <?php if ($task['score']): ?>
+ <span class="task-score"><?= Helper\escape($task['score']) ?></span>
<?php endif ?>
- <li>
- <strong>
- <?php if ($task['username']): ?>
- <?= t('Assigned to %s', $task['username']) ?>
- <?php else: ?>
- <?= t('There is nobody assigned') ?>
+ <ul>
+ <li>
+ <?= dt('Created on %B %e, %G at %k:%M %p', $task['date_creation']) ?>
+ </li>
+ <?php if ($task['date_completed']): ?>
+ <li>
+ <?= dt('Completed on %B %e, %G at %k:%M %p', $task['date_completed']) ?>
+ </li>
<?php endif ?>
- </strong>
- </li>
- <li>
- <?= t('Column on the board:') ?>
- <strong><?= Helper\escape($task['column_title']) ?></strong>
- (<?= Helper\escape($task['project_name']) ?>)
- </li>
- <?php if ($task['category_name']): ?>
- <li>
- <?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
- </li>
- <?php endif ?>
- <li>
- <?php if ($task['is_active'] == 1): ?>
- <?= t('Status is open') ?>
- <?php else: ?>
- <?= t('Status is closed') ?>
+ <?php if ($task['date_due']): ?>
+ <li>
+ <strong><?= dt('Must be done before %B %e, %G', $task['date_due']) ?></strong>
+ </li>
<?php endif ?>
- </li>
-</ul>
-</article>
+ <li>
+ <strong>
+ <?php if ($task['username']): ?>
+ <?= t('Assigned to %s', $task['username']) ?>
+ <?php else: ?>
+ <?= t('There is nobody assigned') ?>
+ <?php endif ?>
+ </strong>
+ </li>
+ <li>
+ <?= t('Column on the board:') ?>
+ <strong><?= Helper\escape($task['column_title']) ?></strong>
+ (<?= Helper\escape($task['project_name']) ?>)
+ </li>
+ <?php if ($task['category_name']): ?>
+ <li>
+ <?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
+ </li>
+ <?php endif ?>
+ <li>
+ <?php if ($task['is_active'] == 1): ?>
+ <?= t('Status is open') ?>
+ <?php else: ?>
+ <?= t('Status is closed') ?>
+ <?php endif ?>
+ </li>
+ </ul>
+</div>
+
+
+<?php if (! empty($task['description'])): ?>
+<div id="description" class="task-show-section">
+ <div class="page-header">
+ <h2><?= t('Description') ?></h2>
+ </div>
-<h2><?= t('Description') ?></h2>
-<?php if ($task['description']): ?>
<article class="markdown task-show-description">
<?= Helper\parse($task['description']) ?: t('There is no description.') ?>
</article>
-<?php else: ?>
- <form method="post" action="?controller=task&amp;action=description&amp;task_id=<?= $task['id'] ?>" autocomplete="off">
-
- <?= Helper\form_hidden('id', $description_form['values']) ?>
- <?= Helper\form_textarea('description', $description_form['values'], $description_form['errors'], array('required', 'placeholder="'.t('Leave a description').'"')) ?><br/>
- <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
-
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- </div>
- </form>
+</div>
<?php endif ?>
+
<?php if (! empty($files)): ?>
- <h2 id="attachments"><?= t('Attachments') ?></h2>
+<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>
- <a href="?controller=task&amp;action=download&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
+ <a href="?controller=file&amp;action=download&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
<span class="task-show-file-actions">
<?php if ($file['is_image']): ?>
- <a href="?controller=task&amp;action=openFile&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>,
+ <a href="?controller=file&amp;action=open&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>,
<?php endif ?>
- <a href="?controller=task&amp;action=confirmRemoveFile&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('remove') ?></a>
+ <a href="?controller=file&amp;action=confirm&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('remove') ?></a>
</span>
</li>
<?php endforeach ?>
</ul>
+</div>
<?php endif ?>
-<h2><?= t('Comments') ?></h2>
-<?php if ($comments): ?>
- <ul id="comments">
+
+<?php if (! empty($comments)): ?>
+<div id="comments" class="task-show-section">
+ <div class="page-header">
+ <h2><?= t('Comments') ?></h2>
+ </div>
+
<?php foreach ($comments as $comment): ?>
<?= Helper\template('comment_show', array(
'comment' => $comment,
'task' => $task,
- 'display_edit_form' => $comment['id'] == $comment_edit_form['values']['id'],
- 'values' => $comment_edit_form['values'] + array('comment' => $comment['comment']),
- 'errors' => $comment_edit_form['errors']
)) ?>
<?php endforeach ?>
- </ul>
+</div>
<?php endif ?>
-
-<?php if (! isset($hide_comment_form) || $hide_comment_form === false): ?>
-<form method="post" action="?controller=comment&amp;action=save&amp;task_id=<?= $task['id'] ?>" autocomplete="off">
-
- <?= Helper\form_hidden('task_id', $comment_form['values']) ?>
- <?= Helper\form_hidden('user_id', $comment_form['values']) ?>
- <?= Helper\form_textarea('comment', $comment_form['values'], $comment_form['errors'], array('required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?><br/>
- <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
-
- <div class="form-actions">
- <input type="submit" value="<?= t('Post comment') ?>" class="btn btn-blue"/>
- </div>
-</form>
-<?php endif ?> \ No newline at end of file
diff --git a/app/Templates/task_sidebar.php b/app/Templates/task_sidebar.php
index 9dbc1a8c..8a3939b8 100644
--- a/app/Templates/task_sidebar.php
+++ b/app/Templates/task_sidebar.php
@@ -2,9 +2,11 @@
<h2><?= t('Actions') ?></h2>
<div class="task-show-actions">
<ul>
- <li><a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('Description') ?></a></li>
- <li><a href="?controller=task&amp;action=edit&amp;task_id=<?= $task['id'] ?>"><?= t('Edit') ?></a></li>
- <li><a href="?controller=task&amp;action=file&amp;task_id=<?= $task['id'] ?>"><?= t('Attach a document') ?></a></li>
+ <li><a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('Summary') ?></a></li>
+ <li><a href="?controller=task&amp;action=edit&amp;task_id=<?= $task['id'] ?>"><?= t('Edit the task') ?></a></li>
+ <li><a href="?controller=task&amp;action=editDescription&amp;task_id=<?= $task['id'] ?>"><?= t('Edit the description') ?></a></li>
+ <li><a href="?controller=comment&amp;action=create&amp;task_id=<?= $task['id'] ?>"><?= t('Add a comment') ?></a></li>
+ <li><a href="?controller=file&amp;action=create&amp;task_id=<?= $task['id'] ?>"><?= t('Attach a document') ?></a></li>
<li><a href="?controller=task&amp;action=duplicate&amp;project_id=<?= $task['project_id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li>
<li>
<?php if ($task['is_active'] == 1): ?>
diff --git a/app/Templates/task_upload.php b/app/Templates/task_upload.php
deleted file mode 100644
index 7100ab31..00000000
--- a/app/Templates/task_upload.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="page-header">
- <h2><?= t('Attach a document') ?></h2>
-</div>
-
-<form action="?controller=task&amp;action=upload&amp;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