Improve task summary sections

This commit is contained in:
Frederic Guillot 2016-03-18 21:00:14 -04:00
parent 68fba8fb64
commit 854457baf0
34 changed files with 355 additions and 396 deletions

View File

@ -3,6 +3,7 @@ Version 1.0.27 (unreleased)
Improvements:
* Improve task summary sections
* Put back the action sidebar in task view
* Added support for multiple placeholders for LDAP_USER_FILTER
* Added local file link provider

View File

@ -1,10 +1,10 @@
BUILD_DIR = /tmp
CSS_APP = $(addprefix assets/css/src/, $(addsuffix .css, base links title table form button alert tooltip header board task comment subtask tasklink markdown listing activity dashboard pagination popover confirm sidebar responsive dropdown upload filters gantt project files views))
CSS_APP = $(addprefix assets/css/src/, $(addsuffix .css, base links title table form button alert tooltip header board task comment subtask tasklink markdown listing activity dashboard pagination popover confirm sidebar responsive dropdown upload filters gantt project files views accordion))
CSS_PRINT = $(addprefix assets/css/src/, $(addsuffix .css, print links table board task comment subtask tasklink markdown))
CSS_VENDOR = $(addprefix assets/css/vendor/, $(addsuffix .css, jquery-ui.min jquery-ui-timepicker-addon.min chosen.min fullcalendar.min font-awesome.min c3.min))
JS_APP = $(addprefix assets/js/src/, $(addsuffix .js, Popover Dropdown Tooltip Markdown Search App Screenshot FileUpload Calendar Board Column Swimlane Gantt Task Project Subtask TaskRepartitionChart UserRepartitionChart CumulativeFlowDiagram BurndownChart AvgTimeColumnChart TaskTimeColumnChart LeadCycleTimeChart CompareHoursColumnChart Router))
JS_APP = $(addprefix assets/js/src/, $(addsuffix .js, Popover Dropdown Tooltip Markdown Search App Screenshot FileUpload Calendar Board Column Swimlane Gantt Task Project Subtask TaskRepartitionChart UserRepartitionChart CumulativeFlowDiagram BurndownChart AvgTimeColumnChart TaskTimeColumnChart LeadCycleTimeChart CompareHoursColumnChart Accordion Router))
JS_VENDOR = $(addprefix assets/js/vendor/, $(addsuffix .js, jquery-1.11.3.min jquery-ui.min jquery-ui-timepicker-addon.min jquery.ui.touch-punch.min chosen.jquery.min moment.min fullcalendar.min mousetrap.min mousetrap-global-bind.min jquery.textcomplete))
JS_LANG = $(addprefix assets/js/vendor/lang/, $(addsuffix .js, cs da de es el fi fr hu id it ja nl nb pl pt pt-br ru sv sr th tr zh-cn))

View File

@ -10,23 +10,6 @@ namespace Kanboard\Controller;
*/
class Subtask extends Base
{
/**
* Show list of subtasks
*/
public function show()
{
$task = $this->getTask();
$this->response->html($this->helper->layout->task('subtask/show', array(
'users_list' => $this->projectUserRole->getAssignableUsersList($task['project_id']),
'task' => $task,
'project' => $this->getProject(),
'subtasks' => $this->subtask->getAll($task['id']),
'editable' => true,
'show_title' => true,
)));
}
/**
* Creation form
*

View File

@ -76,7 +76,8 @@ class Task extends Base
'images' => $this->taskFile->getAllImages($task['id']),
'comments' => $this->comment->getAll($task['id'], $this->userSession->getCommentSorting()),
'subtasks' => $subtasks,
'links' => $this->taskLink->getAllGroupedByLabel($task['id']),
'internal_links' => $this->taskLink->getAllGroupedByLabel($task['id']),
'external_links' => $this->taskExternalLink->getAll($task['id']),
'task' => $task,
'values' => $values,
'link_label_list' => $this->link->getList(0, false),

View File

@ -12,22 +12,6 @@ use Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound;
*/
class TaskExternalLink extends Base
{
/**
* Creation form
*
* @access public
*/
public function show()
{
$task = $this->getTask();
$this->response->html($this->helper->layout->task('task_external_link/show', array(
'links' => $this->taskExternalLink->getAll($task['id']),
'task' => $task,
'title' => t('List of external links'),
)));
}
/**
* First creation form
*
@ -90,7 +74,7 @@ class TaskExternalLink extends Base
if ($valid && $this->taskExternalLink->create($values)) {
$this->flash->success(t('Link added successfully.'));
return $this->response->redirect($this->helper->url->to('TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
return $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
}
$this->edit($values, $errors);
@ -137,7 +121,7 @@ class TaskExternalLink extends Base
if ($valid && $this->taskExternalLink->update($values)) {
$this->flash->success(t('Link updated successfully.'));
return $this->response->redirect($this->helper->url->to('TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
return $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
}
$this->edit($values, $errors);
@ -180,6 +164,6 @@ class TaskExternalLink extends Base
$this->flash->failure(t('Unable to remove this link.'));
}
$this->response->redirect($this->helper->url->to('TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
$this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
}

View File

@ -28,27 +28,6 @@ class Tasklink extends Base
return $link;
}
/**
* Show links
*
* @access public
*/
public function show()
{
$task = $this->getTask();
$project = $this->project->getById($task['project_id']);
$this->response->html($this->helper->layout->task('tasklink/show', array(
'links' => $this->taskLink->getAllGroupedByLabel($task['id']),
'task' => $task,
'project' => $project,
'link_label_list' => $this->link->getList(0, false),
'editable' => true,
'is_public' => false,
'show_title' => true,
)));
}
/**
* Creation form
*

View File

@ -1,7 +1,7 @@
<div class="page-header">
<h2><?= t('Add a comment') ?></h2>
</div>
<form class="popover-form" method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off" class="form-comment">
<form class="popover-form" method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('task_id', $values) ?>
<?= $this->form->hidden('user_id', $values) ?>
@ -21,7 +21,7 @@
$values,
$errors,
array(
! isset($skip_cancel) ? 'autofocus' : '',
'autofocus',
'required',
'placeholder="'.t('Leave a comment').'"',
'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"',
@ -38,9 +38,7 @@
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
<?php if (! isset($skip_cancel)): ?>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
<?php endif ?>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
</div>
</form>

View File

@ -0,0 +1,36 @@
<form method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('task_id', $values) ?>
<?= $this->form->hidden('user_id', $values) ?>
<div class="form-tabs">
<ul class="form-tabs-nav">
<li class="form-tab form-tab-selected">
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
</li>
<li class="form-tab">
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
</li>
</ul>
<div class="write-area">
<?= $this->form->textarea(
'comment',
$values,
$errors,
array(
'required',
'placeholder="'.t('Leave a comment').'"',
'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"',
),
'comment-textarea'
) ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
</div>
</form>

View File

@ -0,0 +1,31 @@
<section class="accordion-section <?= empty($comments) ? 'accordion-collapsed' : '' ?>">
<div class="accordion-title">
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Comments') ?></h3>
</div>
<div class="accordion-content" id="comments">
<div class="comment-sorting">
<i class="fa fa-sort"></i>
<?= $this->url->link(t('change sorting'), 'comment', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</div>
<?php foreach ($comments as $comment): ?>
<?= $this->render('comment/show', array(
'comment' => $comment,
'task' => $task,
'project' => $project,
'editable' => $editable,
'is_public' => isset($is_public) && $is_public,
)) ?>
<?php endforeach ?>
<?php if ($editable): ?>
<?= $this->render('comments/create', array(
'values' => array(
'user_id' => $this->user->getId(),
'task_id' => $task['id'],
),
'errors' => array(),
'task' => $task,
)) ?>
<?php endif ?>
</div>
</section>

View File

@ -1,32 +1,12 @@
<?php if (isset($show_title)): ?>
<div class="task-show-title color-<?= $task['color_id'] ?>">
<h2><?= $this->text->e($task['title']) ?></h2>
</div>
<?php endif ?>
<div class="page-header">
<h2><?= t('Sub-Tasks') ?></h2>
<ul>
<li>
<i class="fa fa-plus fa-fw"></i>
<?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
</ul>
</div>
<div id="subtasks">
<?= $this->render('subtask/table', array('subtasks' => $subtasks, 'task' => $task, 'editable' => $editable)) ?>
<?php if ($editable && $this->user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?>
<form method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?>
<?= $this->form->text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?>
<?= $this->form->numeric('time_estimated', array(), array(), array('placeholder="'.t('Original estimate').'"')) ?>
<?= $this->form->select('user_id', $users_list, array(), array(), array('placeholder="'.t('Assignee').'"')) ?>
<button type="submit" class="btn btn-blue"><?= t('Add') ?></button>
</form>
<?php endif ?>
</div>
<section class="accordion-section <?= empty($subtasks) ? 'accordion-collapsed' : '' ?>">
<div class="accordion-title">
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Sub-Tasks') ?></h3>
</div>
<div class="accordion-content">
<?= $this->render('subtask/table', array(
'subtasks' => $subtasks,
'task' => $task,
'editable' => $editable
)) ?>
</div>
</section>

View File

@ -66,6 +66,4 @@
<?php endforeach ?>
</tbody>
</table>
<?php else: ?>
<p class="alert"><?= t('There is no subtask at the moment.') ?></p>
<?php endif ?>

View File

@ -1,35 +0,0 @@
<?php if (! empty($comments)): ?>
<div id="comments" class="task-show-section">
<div class="page-header">
<h2>
<?= t('Comments') ?>
<span class="comment-sorting">
<i class="fa fa-sort"></i>
<?= $this->url->link(t('change sorting'), 'comment', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</span>
</h2>
</div>
<?php foreach ($comments as $comment): ?>
<?= $this->render('comment/show', array(
'comment' => $comment,
'task' => $task,
'project' => $project,
'editable' => $editable,
'is_public' => isset($is_public) && $is_public,
)) ?>
<?php endforeach ?>
<?php if ($editable): ?>
<?= $this->render('comment/create', array(
'skip_cancel' => true,
'values' => array(
'user_id' => $this->user->getId(),
'task_id' => $task['id'],
),
'errors' => array(),
'task' => $task,
)) ?>
<?php endif ?>
</div>
<?php endif ?>

View File

@ -1,16 +1,9 @@
<?php if (! empty($task['description'])): ?>
<div id="description" class="task-show-section">
<div class="page-header">
<h2><?= t('Description') ?></h2>
<ul>
<li>
<i class="fa fa-edit fa-fw"></i>
<?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
</ul>
</div>
<article class="markdown task-show-description">
<section class="accordion-section <?= empty($task['description']) ? 'accordion-collapsed' : '' ?>">
<div class="accordion-title">
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Description') ?></h3>
</div>
<div class="accordion-content">
<article class="markdown">
<?php if (! isset($is_public)): ?>
<?= $this->text->markdown(
$task['description'],
@ -36,4 +29,4 @@
<?php endif ?>
</article>
</div>
<?php endif ?>
</section>

View File

@ -32,6 +32,13 @@
<?= $this->url->link(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?>
</li>
<?php endif ?>
<?php if ($project['is_public'] && !$editable): ?>
<li class="smaller">
<i class="fa fa-th fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?>
</li>
<?php endif ?>
<li class="smaller">
</ul>
</div>
<div class="task-summary-column">

View File

@ -1,9 +1,6 @@
<section id="main" class="public-task">
<?= $this->render('task/details', array('task' => $task, 'project' => $project, 'editable' => false)) ?>
<p class="pull-right"><?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p>
<?= $this->render('task/description', array(
'task' => $task,
'project' => $project,
@ -24,12 +21,11 @@
'is_public' => true,
)) ?>
<?= $this->render('task/comments', array(
<?= $this->render('comments/show', array(
'task' => $task,
'comments' => $comments,
'project' => $project,
'editable' => false,
'is_public' => true,
)) ?>
</section>
</section>

View File

@ -7,11 +7,9 @@
)) ?>
<?= $this->hook->render('template:task:show:before-description', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('task/description', array('task' => $task)) ?>
<?= $this->hook->render('template:task:show:before-subtasks', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('subtask/show', array(
'task' => $task,
'subtasks' => $subtasks,
@ -20,23 +18,24 @@
'editable' => true,
)) ?>
<?= $this->hook->render('template:task:show:before-tasklinks', array('task' => $task, 'project' => $project)) ?>
<?= $this->hook->render('template:task:show:before-internal-links', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('tasklink/show', array(
'task' => $task,
'links' => $links,
'links' => $internal_links,
'project' => $project,
'link_label_list' => $link_label_list,
'editable' => true,
'is_public' => false,
)) ?>
<?= $this->hook->render('template:task:show:before-timetracking', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('task/time_tracking_summary', array('task' => $task)) ?>
<?= $this->hook->render('template:task:show:before-external-links', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('task_external_link/show', array(
'task' => $task,
'links' => $external_links,
'project' => $project,
)) ?>
<?= $this->hook->render('template:task:show:before-attachements', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('task_file/show', array(
'task' => $task,
'files' => $files,
@ -44,8 +43,7 @@
)) ?>
<?= $this->hook->render('template:task:show:before-comments', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('task/comments', array(
<?= $this->render('comments/show', array(
'task' => $task,
'comments' => $comments,
'project' => $project,

View File

@ -23,18 +23,6 @@
<?= $this->url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
<li <?= $this->app->checkMenuSelection('subtask', 'show') ?>>
<i class="fa fa-tasks fa-fw"></i>
<?= $this->url->link(t('Sub-tasks'), 'subtask', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li <?= $this->app->checkMenuSelection('tasklink', 'show') ?>>
<i class="fa fa-code-fork fa-fw"></i>
<?= $this->url->link(t('Internal links'), 'tasklink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<li <?= $this->app->checkMenuSelection('TaskExternalLink', 'show') ?>>
<i class="fa fa-external-link fa-fw"></i>
<?= $this->url->link(t('External links'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
</ul>
<h2><?= t('Actions') ?></h2>
<ul>
@ -54,6 +42,14 @@
<i class="fa fa-plus fa-fw"></i>
<?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
<li>
<i class="fa fa-code-fork fa-fw"></i>
<?= $this->url->link(t('Add internal link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
<li>
<i class="fa fa-external-link fa-fw"></i>
<?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
<li>
<i class="fa fa-comment-o fa-fw"></i>
<?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>

View File

@ -1,60 +1,12 @@
<div class="task-show-title color-<?= $task['color_id'] ?>">
<h2><?= $this->text->e($task['title']) ?></h2>
</div>
<div class="page-header">
<h2><?= t('External links') ?></h2>
<ul>
<li>
<i class="fa fa-external-link fa-fw"></i>
<?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
</ul>
</div>
<?php if (empty($links)): ?>
<p class="alert"><?= t('There is no external link for the moment.') ?></p>
<?php else: ?>
<table class="table-stripped table-small">
<tr>
<th class="column-10"><?= t('Type') ?></th>
<th><?= t('Title') ?></th>
<th class="column-10"><?= t('Dependency') ?></th>
<th class="column-15"><?= t('Creator') ?></th>
<th class="column-15"><?= t('Date') ?></th>
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
<th class="column-5"><?= t('Action') ?></th>
<?php endif ?>
</tr>
<?php foreach ($links as $link): ?>
<tr>
<td>
<?= $link['type'] ?>
</td>
<td>
<a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
</td>
<td>
<?= $this->text->e($link['dependency_label']) ?>
</td>
<td>
<?= $this->text->e($link['creator_name'] ?: $link['creator_username']) ?>
</td>
<td>
<?= $this->dt->date($link['date_creation']) ?>
</td>
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
<td>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
<ul>
<li><?= $this->url->link(t('Edit'), 'TaskExternalLink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
<li><?= $this->url->link(t('Remove'), 'TaskExternalLink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
</ul>
</div>
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<section class="accordion-section <?= empty($links) ? 'accordion-collapsed' : '' ?>">
<div class="accordion-title">
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('External links') ?></h3>
</div>
<div class="accordion-content">
<?= $this->render('task_external_link/table', array(
'links' => $links,
'task' => $task,
'project' => $project,
)) ?>
</div>
</section>

View File

@ -0,0 +1,42 @@
<table class="table-stripped table-small">
<tr>
<th class="column-10"><?= t('Type') ?></th>
<th><?= t('Title') ?></th>
<th class="column-10"><?= t('Dependency') ?></th>
<th class="column-15"><?= t('Creator') ?></th>
<th class="column-15"><?= t('Date') ?></th>
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
<th class="column-5"><?= t('Action') ?></th>
<?php endif ?>
</tr>
<?php foreach ($links as $link): ?>
<tr>
<td>
<?= $link['type'] ?>
</td>
<td>
<a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
</td>
<td>
<?= $this->text->e($link['dependency_label']) ?>
</td>
<td>
<?= $this->text->e($link['creator_name'] ?: $link['creator_username']) ?>
</td>
<td>
<?= $this->dt->date($link['date_creation']) ?>
</td>
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
<td>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
<ul>
<li><?= $this->url->link(t('Edit'), 'TaskExternalLink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
<li><?= $this->url->link(t('Remove'), 'TaskExternalLink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
</ul>
</div>
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</table>

View File

@ -0,0 +1,47 @@
<?php if (! empty($files)): ?>
<table class="table-stripped table-small">
<tr>
<th><?= t('Filename') ?></th>
<th><?= t('Creator') ?></th>
<th><?= t('Date') ?></th>
<th><?= t('Size') ?></th>
</tr>
<?php foreach ($files as $file): ?>
<tr>
<td>
<i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
<?php if ($this->file->getPreviewType($file['name']) !== null): ?>
<li>
<i class="fa fa-eye fa-fw"></i>
<?= $this->url->link(t('View file'), 'FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
<li>
<i class="fa fa-download fa-fw"></i>
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
</li>
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
<li>
<i class="fa fa-trash fa-fw"></i>
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
</ul>
</div>
</td>
<td>
<?= $this->text->e($file['user_name'] ?: $file['username']) ?>
</td>
<td>
<?= $this->dt->date($file['date']) ?>
</td>
<td>
<?= $this->text->bytes($file['size']) ?>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>

View File

@ -0,0 +1,34 @@
<?php if (! empty($images)): ?>
<div class="file-thumbnails">
<?php foreach ($images as $file): ?>
<div class="file-thumbnail">
<a href="<?= $this->url->href('FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>"></a>
<div class="file-thumbnail-content">
<div class="file-thumbnail-title">
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
<li>
<i class="fa fa-download fa-fw"></i>
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
</li>
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
<li>
<i class="fa fa-trash fa-fw"></i>
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
</ul>
</div>
</div>
<div class="file-thumbnail-description">
<span class="tooltip" title='<?= t('Uploaded: %s', $this->dt->datetime($file['date'])).'<br>'.t('Size: %s', $this->text->bytes($file['size'])) ?>'>
<i class="fa fa-info-circle"></i>
</span>
<?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?>
</div>
</div>
</div>
<?php endforeach ?>
</div>
<?php endif ?>

View File

@ -1,90 +1,9 @@
<?php if (! empty($files) || ! empty($images)): ?>
<div id="attachments" class="task-show-section">
<div class="page-header">
<h2><?= t('Attachments') ?></h2>
<section class="accordion-section <?= empty($files) && empty($images) ? 'accordion-collapsed' : '' ?>">
<div class="accordion-title">
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Attachments') ?></h3>
</div>
<?php if (! empty($images)): ?>
<div class="file-thumbnails">
<?php foreach ($images as $file): ?>
<div class="file-thumbnail">
<a href="<?= $this->url->href('FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>"></a>
<div class="file-thumbnail-content">
<div class="file-thumbnail-title">
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
<li>
<i class="fa fa-download fa-fw"></i>
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
</li>
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
<li>
<i class="fa fa-trash fa-fw"></i>
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
</ul>
</div>
</div>
<div class="file-thumbnail-description">
<span class="tooltip" title='<?= t('Uploaded: %s', $this->dt->datetime($file['date'])).'<br>'.t('Size: %s', $this->text->bytes($file['size'])) ?>'>
<i class="fa fa-info-circle"></i>
</span>
<?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?>
</div>
</div>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
<?php if (! empty($files)): ?>
<table class="table-stripped">
<tr>
<th><?= t('Filename') ?></th>
<th><?= t('Creator') ?></th>
<th><?= t('Date') ?></th>
<th><?= t('Size') ?></th>
</tr>
<?php foreach ($files as $file): ?>
<tr>
<td>
<i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i>
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
<?php if ($this->file->getPreviewType($file['name']) !== null): ?>
<li>
<i class="fa fa-eye fa-fw"></i>
<?= $this->url->link(t('View file'), 'FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
<li>
<i class="fa fa-download fa-fw"></i>
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
</li>
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
<li>
<i class="fa fa-trash fa-fw"></i>
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
</li>
<?php endif ?>
</ul>
</div>
</td>
<td>
<?= $this->text->e($file['user_name'] ?: $file['username']) ?>
</td>
<td>
<?= $this->dt->date($file['date']) ?>
</td>
<td>
<?= $this->text->bytes($file['size']) ?>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
</div>
<?php endif ?>
<div class="accordion-content">
<?= $this->render('task_file/images', array('task' => $task, 'images' => $images)) ?>
<?= $this->render('task_file/files', array('task' => $task, 'files' => $files)) ?>
</div>
</section>

View File

@ -1,43 +1,14 @@
<?php if (isset($show_title)): ?>
<div class="task-show-title color-<?= $task['color_id'] ?>">
<h2><?= $this->text->e($task['title']) ?></h2>
<section class="accordion-section <?= empty($links) ? 'accordion-collapsed' : '' ?>">
<div class="accordion-title">
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Internal links') ?></h3>
</div>
<?php endif ?>
<div class="page-header">
<h2><?= t('Internal links') ?></h2>
<ul>
<li>
<i class="fa fa-code-fork fa-fw"></i>
<?= $this->url->link(t('Add internal link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
</li>
</ul>
</div>
<div id="link">
<?= $this->render('tasklink/table', array('links' => $links, 'task' => $task, 'project' => $project, 'editable' => $editable, 'is_public' => $is_public)) ?>
<?php if ($editable && isset($link_label_list)): ?>
<form action="<?= $this->url->href('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?>
<?= $this->form->hidden('opposite_task_id', array()) ?>
<?= $this->form->select('link_id', $link_label_list, array(), array()) ?>
<?= $this->form->text(
'title',
array(),
array(),
array(
'required',
'placeholder="'.t('Start to type task title...').'"',
'title="'.t('Start to type task title...').'"',
'data-dst-field="opposite_task_id"',
'data-search-url="'.$this->url->href('TaskHelper', 'autocomplete', array('exclude_task_id' => $task['id'])).'"',
),
'autocomplete') ?>
<input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
</form>
<?php endif ?>
</div>
<div class="accordion-content">
<?= $this->render('tasklink/table', array(
'links' => $links,
'task' => $task,
'project' => $project,
'editable' => $editable,
'is_public' => $is_public,
)) ?>
</div>
</section>

View File

@ -1,6 +1,4 @@
<?php if (empty($links)): ?>
<p class="alert"><?= t('There is no internal link for the moment.') ?></p>
<?php else: ?>
<?php if (! empty($links)): ?>
<table class="task-links-table table-stripped">
<?php foreach ($links as $label => $grouped_links): ?>
<?php $hide_td = false ?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,40 @@
.accordion-title {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEQ5RDgxQzc2RjQ5MTFFMjhEMUNENzFGRUMwRjhBRTciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEQ5RDgxQzg2RjQ5MTFFMjhEMUNENzFGRUMwRjhBRTciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0RDlEODFDNTZGNDkxMUUyOEQxQ0Q3MUZFQzBGOEFFNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0RDlEODFDNjZGNDkxMUUyOEQxQ0Q3MUZFQzBGOEFFNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvXFWFAAAAAYSURBVHjaYvj//z8D0/Pnz/8zgFgAAQYAS5UJscReGMIAAAAASUVORK5CYII=) repeat-x scroll 0 10px;
}
.accordion-title h3 {
display: inline;
padding-right: 5px;
background: #fff;
}
.accordion-content {
margin-top: 15px;
margin-bottom: 25px;
}
.accordion-toggle {
color: #333;
text-decoration: none;
}
.accordion-toggle:focus,
.accordion-toggle:hover {
color: #999;
}
.accordion-toggle:before {
content: "\f0d7";
}
.accordion-collapsed .accordion-toggle:before {
content: "\f0da";
}
.accordion-collapsed {
margin-bottom: 25px;
}
.accordion-collapsed .accordion-content {
display: none;
}

View File

@ -69,21 +69,22 @@
max-width: 800px;
}
#comments .comment-textarea {
height: 80px;
width: 500px;
}
.comment-sorting {
text-align: right;
font-size: 0.5em;
}
span.comment-sorting a {
.comment-sorting a {
color: #555;
font-weight: normal;
text-decoration: none;
}
span.comment-sorting a:hover {
.comment-sorting a:hover {
color: #aaa;
}
#comments .comment-textarea {
height: 80px;
width: 500px;
}

View File

@ -1,6 +1,6 @@
header,
.sidebar,
.form-comment,
#comments form,
.page-header {
display: none;
}

View File

@ -43,8 +43,8 @@
.sidebar a {
text-decoration: none;
color: #aaa;
font-weight: 200;
color: #999;
font-weight: 300;
}
.sidebar a:hover {

View File

@ -207,17 +207,6 @@ span.task-board-date-overdue {
padding: 8px;
}
.task-show-description {
border-left: 4px solid #333;
padding-left: 20px;
}
.task-show-description-textarea {
width: 99%;
max-width: 99%;
height: 300px;
}
.task-link-closed {
text-decoration: line-through;
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
function Accordion(app) {
this.app = app;
}
Accordion.prototype.listen = function() {
$(document).on("click", ".accordion-toggle", function(e) {
e.preventDefault();
var section = $(this).parents(".accordion-section");
if (section.hasClass("accordion-collapsed")) {
section.find(".accordion-content").show();
section.removeClass("accordion-collapsed");
} else {
section.find(".accordion-content").hide();
section.addClass("accordion-collapsed");
}
});
};

View File

@ -11,6 +11,7 @@ function App() {
this.subtask = new Subtask(this);
this.column = new Column(this);
this.file = new FileUpload(this);
this.accordion = new Accordion(this);
this.keyboardShortcuts();
this.task.keyboardShortcuts();
this.chosen();
@ -34,6 +35,7 @@ App.prototype.listen = function() {
this.subtask.listen();
this.column.listen();
this.file.listen();
this.accordion.listen();
this.search.focus();
this.autoComplete();
this.datePicker();