Improve user interface
This commit is contained in:
17
app/Templates/comment_create.php
Normal file
17
app/Templates/comment_create.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Add a comment') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="?controller=comment&action=save&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&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
15
app/Templates/comment_edit.php
Normal file
15
app/Templates/comment_edit.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit a comment') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="?controller=comment&action=update&task_id=<?= $task['id'] ?>&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&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,18 +1,16 @@
|
||||
<section id="main">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Remove a comment') ?></h2>
|
||||
<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>
|
||||
|
||||
<?= Helper\template('comment_show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<a href="?controller=comment&action=remove&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
|
||||
<?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>#comment-<?= $comment['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
|
||||
<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)) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<a href="?controller=comment&action=remove&project_id=<?= $project_id ?>&comment_id=<?= $comment['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
|
||||
<?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $comment['task_id'] ?>#comment-<?= $comment['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -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&action=confirm&project_id=<?= $task['project_id'] ?>&comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?controller=comment&action=edit&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>#comment-<?= $comment['id'] ?>"><?= t('edit') ?></a>
|
||||
</li>
|
||||
|
||||
<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&action=confirm&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?controller=comment&action=edit&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>"><?= t('edit') ?></a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($display_edit_form) && $display_edit_form === true): ?>
|
||||
<form method="post" action="?controller=comment&action=update&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>" autocomplete="off">
|
||||
<div class="markdown">
|
||||
<?= Helper\parse($comment['comment']) ?>
|
||||
</div>
|
||||
|
||||
<?= 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 this comment') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<div class="markdown">
|
||||
<?= Helper\markdown($comment['comment']) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
@@ -2,9 +2,11 @@
|
||||
<h2><?= t('Attach a document') ?></h2>
|
||||
</div>
|
||||
|
||||
<form action="?controller=task&action=upload&task_id=<?= $task['id'] ?>" method="post" enctype="multipart/form-data">
|
||||
<form action="?controller=file&action=save&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&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,6 +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']) ?>"/>
|
||||
<img src="?controller=file&action=image&file_id=<?= $file['id'] ?>&task_id=<?= $file['task_id'] ?>" alt="<?= Helper\escape($file['name']) ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -8,7 +8,7 @@
|
||||
</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>
|
||||
<a href="?controller=file&action=remove&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>
|
||||
@@ -1,9 +1,12 @@
|
||||
<section id="main">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit a task') ?></h2>
|
||||
<ul>
|
||||
<li><a href="?controller=board&action=show&project_id=<?= $task['project_id'] ?>"><?= t('Back to the board') ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section>
|
||||
<form method="post" action="?controller=task&action=update" autocomplete="off">
|
||||
<form method="post" action="?controller=task&action=update&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&action=show&project_id=<?= $values['project_id'] ?>"><?= t('cancel') ?></a>
|
||||
<?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
16
app/Templates/task_edit_description.php
Normal file
16
app/Templates/task_edit_description.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit the description') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="?controller=task&action=saveDescription&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&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
@@ -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 if ($task['score']): ?>
|
||||
<span class="task-score"><?= Helper\escape($task['score']) ?></span>
|
||||
<?php endif ?>
|
||||
<?php if ($task['date_due']): ?>
|
||||
<li>
|
||||
<strong><?= dt('Must be done before %B %e, %G', $task['date_due']) ?></strong>
|
||||
</li>
|
||||
<?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&action=description&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&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
|
||||
<a href="?controller=file&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>,
|
||||
<a href="?controller=file&action=open&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>
|
||||
<a href="?controller=file&action=confirm&file_id=<?= $file['id'] ?>&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&action=save&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 ?>
|
||||
@@ -2,9 +2,11 @@
|
||||
<h2><?= t('Actions') ?></h2>
|
||||
<div class="task-show-actions">
|
||||
<ul>
|
||||
<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=show&task_id=<?= $task['id'] ?>"><?= t('Summary') ?></a></li>
|
||||
<li><a href="?controller=task&action=edit&task_id=<?= $task['id'] ?>"><?= t('Edit the task') ?></a></li>
|
||||
<li><a href="?controller=task&action=editDescription&task_id=<?= $task['id'] ?>"><?= t('Edit the description') ?></a></li>
|
||||
<li><a href="?controller=comment&action=create&task_id=<?= $task['id'] ?>"><?= t('Add a comment') ?></a></li>
|
||||
<li><a href="?controller=file&action=create&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): ?>
|
||||
|
||||
Reference in New Issue
Block a user