Improve user interface

This commit is contained in:
Frédéric Guillot
2014-05-23 09:49:26 -04:00
parent a7167f63c5
commit 7b53d47d46
25 changed files with 586 additions and 541 deletions

View File

@@ -2,7 +2,7 @@
namespace Controller; namespace Controller;
use Model\Project; use Model\Project as ProjectModel;
/** /**
* Application controller * Application controller
@@ -19,7 +19,7 @@ class App extends Base
*/ */
public function index() public function index()
{ {
if ($this->project->countByStatus(Project::ACTIVE)) { if ($this->project->countByStatus(ProjectModel::ACTIVE)) {
$this->response->redirect('?controller=board'); $this->response->redirect('?controller=board');
} }
else { else {

View File

@@ -11,6 +11,20 @@ use Model\LastLogin;
* *
* @package controller * @package controller
* @author Frederic Guillot * @author Frederic Guillot
* @property \Model\Acl $acl
* @property \Model\Action $action
* @property \Model\Board $board
* @property \Model\Category $category
* @property \Model\Comment $comment
* @property \Model\Config $config
* @property \Model\File $file
* @property \Model\Google $google
* @property \Model\LastLogin $lastlogin
* @property \Model\Ldap $ldap
* @property \Model\Project $project
* @property \Model\RememberMe $rememberme
* @property \Model\Task $task
* @property \Model\User $user
*/ */
abstract class Base abstract class Base
{ {
@@ -172,56 +186,6 @@ abstract class Base
$this->response->redirect('?controller=project&action=create'); $this->response->redirect('?controller=project&action=create');
} }
/**
* Display the template show task (common between different actions)
*
* @access protected
* @param array $task Task data
* @param array $comment_form Comment form data
* @param array $description_form Description form data
* @param array $comment_edit_form Comment edit form data
*/
protected function showTask(array $task, array $comment_form = array(), array $description_form = array(), array $comment_edit_form = array())
{
if (empty($comment_form)) {
$comment_form = array(
'values' => array('task_id' => $task['id'], 'user_id' => $this->acl->getUserId()),
'errors' => array()
);
}
if (empty($description_form)) {
$description_form = array(
'values' => array('id' => $task['id']),
'errors' => array()
);
}
if (empty($comment_edit_form)) {
$comment_edit_form = array(
'values' => array('id' => 0),
'errors' => array()
);
}
else {
$hide_comment_form = true;
}
$this->response->html($this->taskLayout('task_show', array(
'hide_comment_form' => isset($hide_comment_form),
'comment_edit_form' => $comment_edit_form,
'comment_form' => $comment_form,
'description_form' => $description_form,
'comments' => $this->comment->getAll($task['id']),
'task' => $task,
'columns_list' => $this->board->getColumnsList($task['project_id']),
'colors_list' => $this->task->getColors(),
'files' => $this->file->getAll($task['id']),
'menu' => 'tasks',
'title' => $task['title'],
)));
}
/** /**
* Common layout for task views * Common layout for task views
* *
@@ -236,4 +200,23 @@ abstract class Base
return $this->template->layout('task_layout', $params); return $this->template->layout('task_layout', $params);
} }
/**
* Common method to get a task for task views
*
* @access protected
* @return array
*/
protected function getTask()
{
$task = $this->task->getById($this->request->getIntegerParam('task_id'), true);
if (! $task) {
$this->notfound();
}
$this->checkProjectPermissions($task['project_id']);
return $task;
}
} }

View File

@@ -2,8 +2,8 @@
namespace Controller; namespace Controller;
use Model\Project; use Model\Project as ProjectModel;
use Model\User; use Model\User as UserModel;
/** /**
* Board controller * Board controller
@@ -52,7 +52,7 @@ class Board extends Base
{ {
$task = $this->task->getById($this->request->getIntegerParam('task_id')); $task = $this->task->getById($this->request->getIntegerParam('task_id'));
$project = $this->project->getById($task['project_id']); $project = $this->project->getById($task['project_id']);
$projects = $this->project->getListByStatus(Project::ACTIVE); $projects = $this->project->getListByStatus(ProjectModel::ACTIVE);
if ($this->acl->isRegularUser()) { if ($this->acl->isRegularUser()) {
$projects = $this->project->filterListByAccess($projects, $this->acl->getUserId()); $projects = $this->project->filterListByAccess($projects, $this->acl->getUserId());
@@ -143,7 +143,7 @@ class Board extends Base
*/ */
public function index() public function index()
{ {
$projects = $this->project->getListByStatus(Project::ACTIVE); $projects = $this->project->getListByStatus(ProjectModel::ACTIVE);
if ($this->acl->isRegularUser()) { if ($this->acl->isRegularUser()) {
$projects = $this->project->filterListByAccess($projects, $this->acl->getUserId()); $projects = $this->project->filterListByAccess($projects, $this->acl->getUserId());
@@ -177,10 +177,10 @@ class Board extends Base
public function show() public function show()
{ {
$project_id = $this->request->getIntegerParam('project_id'); $project_id = $this->request->getIntegerParam('project_id');
$user_id = $this->request->getIntegerParam('user_id', User::EVERYBODY_ID); $user_id = $this->request->getIntegerParam('user_id', UserModel::EVERYBODY_ID);
$this->checkProjectPermissions($project_id); $this->checkProjectPermissions($project_id);
$projects = $this->project->getListByStatus(Project::ACTIVE); $projects = $this->project->getListByStatus(ProjectModel::ACTIVE);
if ($this->acl->isRegularUser()) { if ($this->acl->isRegularUser()) {
$projects = $this->project->filterListByAccess($projects, $this->acl->getUserId()); $projects = $this->project->filterListByAccess($projects, $this->acl->getUserId());

View File

@@ -10,6 +10,27 @@ namespace Controller;
*/ */
class Comment extends Base class Comment extends Base
{ {
/**
* Get the current comment
*
* @access private
* @return array
*/
private function getComment()
{
$comment = $this->comment->getById($this->request->getIntegerParam('comment_id'));
if (! $comment) {
$this->notfound();
}
if (! $this->acl->isAdminUser() && $comment['user_id'] != $this->acl->getUserId()) {
$this->forbidden();
}
return $comment;
}
/** /**
* Forbidden page for comments * Forbidden page for comments
* *
@@ -23,6 +44,27 @@ class Comment extends Base
))); )));
} }
/**
* Add comment form
*
* @access public
*/
public function create()
{
$task = $this->getTask();
$this->response->html($this->taskLayout('comment_create', array(
'values' => array(
'user_id' => $this->acl->getUserId(),
'task_id' => $task['id'],
),
'errors' => array(),
'task' => $task,
'menu' => 'tasks',
'title' => t('Add a comment')
)));
}
/** /**
* Add a comment * Add a comment
* *
@@ -30,12 +72,9 @@ class Comment extends Base
*/ */
public function save() public function save()
{ {
$task = $this->task->getById($this->request->getIntegerParam('task_id'), true); $task = $this->getTask();
$values = $this->request->getValues(); $values = $this->request->getValues();
if (! $task) $this->notfound();
$this->checkProjectPermissions($task['project_id']);
list($valid, $errors) = $this->comment->validateCreation($values); list($valid, $errors) = $this->comment->validateCreation($values);
if ($valid) { if ($valid) {
@@ -47,13 +86,16 @@ class Comment extends Base
$this->session->flashError(t('Unable to create your comment.')); $this->session->flashError(t('Unable to create your comment.'));
} }
$this->response->redirect('?controller=task&action=show&task_id='.$task['id']); $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#comments');
} }
$this->showTask( $this->response->html($this->taskLayout('comment_create', array(
$task, 'values' => $values,
array('values' => $values, 'errors' => $errors) 'errors' => $errors,
); 'task' => $task,
'menu' => 'tasks',
'title' => t('Add a comment')
)));
} }
/** /**
@@ -63,26 +105,17 @@ class Comment extends Base
*/ */
public function edit() public function edit()
{ {
$task_id = $this->request->getIntegerParam('task_id'); $task = $this->getTask();
$comment_id = $this->request->getIntegerParam('comment_id'); $comment = $this->getComment();
$task = $this->task->getById($task_id, true); $this->response->html($this->taskLayout('comment_edit', array(
$comment = $this->comment->getById($comment_id); 'values' => $comment,
'errors' => array(),
if (! $task || ! $comment) $this->notfound(); 'comment' => $comment,
$this->checkProjectPermissions($task['project_id']); 'task' => $task,
'menu' => 'tasks',
if ($this->acl->isAdminUser() || $comment['user_id'] == $this->acl->getUserId()) { 'title' => t('Edit a comment')
)));
$this->showTask(
$task,
array(),
array(),
array('values' => array('id' => $comment['id']), 'errors' => array())
);
}
$this->forbidden();
} }
/** /**
@@ -92,42 +125,32 @@ class Comment extends Base
*/ */
public function update() public function update()
{ {
$task_id = $this->request->getIntegerParam('task_id'); $task = $this->getTask();
$comment_id = $this->request->getIntegerParam('comment_id'); $comment = $this->getComment();
$task = $this->task->getById($task_id, true);
$comment = $this->comment->getById($comment_id);
$values = $this->request->getValues(); $values = $this->request->getValues();
list($valid, $errors) = $this->comment->validateModification($values);
if (! $task || ! $comment) $this->notfound(); if ($valid) {
$this->checkProjectPermissions($task['project_id']);
if ($this->acl->isAdminUser() || $comment['user_id'] == $this->acl->getUserId()) { if ($this->comment->update($values)) {
$this->session->flash(t('Comment updated successfully.'));
list($valid, $errors) = $this->comment->validateModification($values); }
else {
if ($valid) { $this->session->flashError(t('Unable to update your comment.'));
if ($this->comment->update($values)) {
$this->session->flash(t('Comment updated successfully.'));
}
else {
$this->session->flashError(t('Unable to update your comment.'));
}
$this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#comment-'.$comment_id);
} }
$this->showTask( $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#comment-'.$comment['id']);
$task,
array(),
array(),
array('values' => $values, 'errors' => $errors)
);
} }
$this->forbidden(); $this->response->html($this->taskLayout('comment_edit', array(
'values' => $values,
'errors' => $errors,
'comment' => $comment,
'task' => $task,
'menu' => 'tasks',
'title' => t('Edit a comment')
)));
} }
/** /**
@@ -137,25 +160,15 @@ class Comment extends Base
*/ */
public function confirm() public function confirm()
{ {
$project_id = $this->request->getIntegerParam('project_id'); $task = $this->getTask();
$comment_id = $this->request->getIntegerParam('comment_id'); $comment = $this->getComment();
$this->checkProjectPermissions($project_id); $this->response->html($this->taskLayout('comment_remove', array(
'comment' => $comment,
$comment = $this->comment->getById($comment_id); 'task' => $task,
if (! $comment) $this->notfound(); 'menu' => 'tasks',
'title' => t('Remove a comment')
if ($this->acl->isAdminUser() || $comment['user_id'] == $this->acl->getUserId()) { )));
$this->response->html($this->template->layout('comment_remove', array(
'comment' => $comment,
'project_id' => $project_id,
'menu' => 'tasks',
'title' => t('Remove a comment')
)));
}
$this->forbidden();
} }
/** /**
@@ -165,25 +178,16 @@ class Comment extends Base
*/ */
public function remove() public function remove()
{ {
$project_id = $this->request->getIntegerParam('project_id'); $task = $this->getTask();
$comment_id = $this->request->getIntegerParam('comment_id'); $comment = $this->getComment();
$this->checkProjectPermissions($project_id); if ($this->comment->remove($comment['id'])) {
$this->session->flash(t('Comment removed successfully.'));
$comment = $this->comment->getById($comment_id); }
if (! $comment) $this->notfound(); else {
$this->session->flashError(t('Unable to remove this comment.'));
if ($this->acl->isAdminUser() || $comment['user_id'] == $this->acl->getUserId()) {
if ($this->comment->remove($comment['id'])) {
$this->session->flash(t('Comment removed successfully.'));
} else {
$this->session->flashError(t('Unable to remove this comment.'));
}
$this->response->redirect('?controller=task&action=show&task_id='.$comment['task_id']);
} }
$this->forbidden(); $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#comments');
} }
} }

136
app/Controller/File.php Normal file
View File

@@ -0,0 +1,136 @@
<?php
namespace Controller;
use Model\File as FileModel;
/**
* File controller
*
* @package controller
* @author Frederic Guillot
*/
class File extends Base
{
/**
* File upload form
*
* @access public
*/
public function create()
{
$task = $this->getTask();
$this->response->html($this->taskLayout('file_new', array(
'task' => $task,
'menu' => 'tasks',
'title' => t('Attach a document')
)));
}
/**
* File upload (save files)
*
* @access public
*/
public function save()
{
$task = $this->getTask();
$this->file->upload($task['project_id'], $task['id'], 'files');
$this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#attachments');
}
/**
* File download
*
* @access public
*/
public function download()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
$filename = FileModel::BASE_PATH.$file['path'];
if ($file['task_id'] == $task['id'] && file_exists($filename)) {
$this->response->forceDownload($file['name']);
$this->response->binary(file_get_contents($filename));
}
$this->response->redirect('?controller=task&action=show&task_id='.$task['id']);
}
/**
* Open a file (show the content in a popover)
*
* @access public
*/
public function open()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
if ($file['task_id'] == $task['id']) {
$this->response->html($this->template->load('file_open', array(
'file' => $file
)));
}
}
/**
* Return the file content (work only for images)
*
* @access public
*/
public function image()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
$filename = FileModel::BASE_PATH.$file['path'];
if ($file['task_id'] == $task['id'] && file_exists($filename)) {
$metadata = getimagesize($filename);
if (isset($metadata['mime'])) {
$this->response->contentType($metadata['mime']);
readfile($filename);
}
}
}
/**
* Remove a file
*
* @access public
*/
public function remove()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
if ($file['task_id'] == $task['id'] && $this->file->remove($file['id'])) {
$this->session->flash(t('File removed successfully.'));
} else {
$this->session->flashError(t('Unable to remove this file.'));
}
$this->response->redirect('?controller=task&action=show&task_id='.$task['id']);
}
/**
* Confirmation dialog before removing a file
*
* @access public
*/
public function confirm()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
$this->response->html($this->taskLayout('file_remove', array(
'task' => $task,
'file' => $file,
'menu' => 'tasks',
'title' => t('Remove a file')
)));
}
}

View File

@@ -2,7 +2,7 @@
namespace Controller; namespace Controller;
use Model\Task; use Model\Task as TaskModel;
/** /**
* Project controller * Project controller
@@ -96,7 +96,7 @@ class Project extends Base
$filters = array( $filters = array(
array('column' => 'project_id', 'operator' => 'eq', 'value' => $project_id), array('column' => 'project_id', 'operator' => 'eq', 'value' => $project_id),
array('column' => 'is_active', 'operator' => 'eq', 'value' => Task::STATUS_CLOSED), array('column' => 'is_active', 'operator' => 'eq', 'value' => TaskModel::STATUS_CLOSED),
); );
$tasks = $this->task->find($filters); $tasks = $this->task->find($filters);

View File

@@ -2,8 +2,7 @@
namespace Controller; namespace Controller;
use Model\Project; use Model\Project as ProjectModel;
use Model\File;
/** /**
* Task controller * Task controller
@@ -13,19 +12,6 @@ use Model\File;
*/ */
class Task extends Base class Task extends Base
{ {
private function getTask()
{
$task = $this->task->getById($this->request->getIntegerParam('task_id'), true);
if (! $task) {
$this->notfound();
}
$this->checkProjectPermissions($task['project_id']);
return $task;
}
/** /**
* Webhook to create a task (useful for external software) * Webhook to create a task (useful for external software)
* *
@@ -71,41 +57,17 @@ class Task extends Base
*/ */
public function show() public function show()
{ {
$this->showTask($this->getTask()); $task = $this->getTask();
}
/** $this->response->html($this->taskLayout('task_show', array(
* Add a description from the show task page 'files' => $this->file->getAll($task['id']),
* 'comments' => $this->comment->getAll($task['id']),
* @access public 'task' => $task,
*/ 'columns_list' => $this->board->getColumnsList($task['project_id']),
public function description() 'colors_list' => $this->task->getColors(),
{ 'menu' => 'tasks',
$task = $this->task->getById($this->request->getIntegerParam('task_id'), true); 'title' => $task['title'],
$values = $this->request->getValues(); )));
if (! $task) $this->notfound();
$this->checkProjectPermissions($task['project_id']);
list($valid, $errors) = $this->task->validateDescriptionCreation($values);
if ($valid) {
if ($this->task->update($values)) {
$this->session->flash(t('Task updated successfully.'));
}
else {
$this->session->flashError(t('Unable to update your task.'));
}
$this->response->redirect('?controller=task&action=show&task_id='.$task['id']);
}
$this->showTask(
$task,
array(),
array('values' => $values, 'errors' => $errors)
);
} }
/** /**
@@ -127,7 +89,7 @@ class Task extends Base
'owner_id' => $this->request->getIntegerParam('owner_id'), 'owner_id' => $this->request->getIntegerParam('owner_id'),
'another_task' => $this->request->getIntegerParam('another_task'), 'another_task' => $this->request->getIntegerParam('another_task'),
), ),
'projects_list' => $this->project->getListByStatus(\Model\Project::ACTIVE), 'projects_list' => $this->project->getListByStatus(ProjectModel::ACTIVE),
'columns_list' => $this->board->getColumnsList($project_id), 'columns_list' => $this->board->getColumnsList($project_id),
'users_list' => $this->project->getUsersList($project_id), 'users_list' => $this->project->getUsersList($project_id),
'colors_list' => $this->task->getColors(), 'colors_list' => $this->task->getColors(),
@@ -171,7 +133,7 @@ class Task extends Base
$this->response->html($this->template->layout('task_new', array( $this->response->html($this->template->layout('task_new', array(
'errors' => $errors, 'errors' => $errors,
'values' => $values, 'values' => $values,
'projects_list' => $this->project->getListByStatus(Project::ACTIVE), 'projects_list' => $this->project->getListByStatus(ProjectModel::ACTIVE),
'columns_list' => $this->board->getColumnsList($values['project_id']), 'columns_list' => $this->board->getColumnsList($values['project_id']),
'users_list' => $this->project->getUsersList($values['project_id']), 'users_list' => $this->project->getUsersList($values['project_id']),
'colors_list' => $this->task->getColors(), 'colors_list' => $this->task->getColors(),
@@ -188,10 +150,7 @@ class Task extends Base
*/ */
public function edit() public function edit()
{ {
$task = $this->task->getById($this->request->getIntegerParam('task_id')); $task = $this->getTask();
if (! $task) $this->notfound();
$this->checkProjectPermissions($task['project_id']);
if (! empty($task['date_due'])) { if (! empty($task['date_due'])) {
$task['date_due'] = date(t('m/d/Y'), $task['date_due']); $task['date_due'] = date(t('m/d/Y'), $task['date_due']);
@@ -203,8 +162,9 @@ class Task extends Base
$task['score'] = $task['score'] ?: ''; $task['score'] = $task['score'] ?: '';
$this->response->html($this->template->layout('task_edit', array( $this->response->html($this->template->layout('task_edit', array(
'errors' => array(),
'values' => $task, 'values' => $task,
'errors' => array(),
'task' => $task,
'columns_list' => $this->board->getColumnsList($task['project_id']), 'columns_list' => $this->board->getColumnsList($task['project_id']),
'users_list' => $this->project->getUsersList($task['project_id']), 'users_list' => $this->project->getUsersList($task['project_id']),
'colors_list' => $this->task->getColors(), 'colors_list' => $this->task->getColors(),
@@ -221,8 +181,8 @@ class Task extends Base
*/ */
public function update() public function update()
{ {
$task = $this->getTask();
$values = $this->request->getValues(); $values = $this->request->getValues();
$this->checkProjectPermissions($values['project_id']);
list($valid, $errors) = $this->task->validateModification($values); list($valid, $errors) = $this->task->validateModification($values);
@@ -238,8 +198,9 @@ class Task extends Base
} }
$this->response->html($this->template->layout('task_edit', array( $this->response->html($this->template->layout('task_edit', array(
'errors' => $errors,
'values' => $values, 'values' => $values,
'errors' => $errors,
'task' => $task,
'columns_list' => $this->board->getColumnsList($values['project_id']), 'columns_list' => $this->board->getColumnsList($values['project_id']),
'users_list' => $this->project->getUsersList($values['project_id']), 'users_list' => $this->project->getUsersList($values['project_id']),
'colors_list' => $this->task->getColors(), 'colors_list' => $this->task->getColors(),
@@ -372,7 +333,7 @@ class Task extends Base
$this->response->html($this->template->layout('task_new', array( $this->response->html($this->template->layout('task_new', array(
'errors' => array(), 'errors' => array(),
'values' => $task, 'values' => $task,
'projects_list' => $this->project->getListByStatus(Project::ACTIVE), 'projects_list' => $this->project->getListByStatus(ProjectModel::ACTIVE),
'columns_list' => $this->board->getColumnsList($task['project_id']), 'columns_list' => $this->board->getColumnsList($task['project_id']),
'users_list' => $this->project->getUsersList($task['project_id']), 'users_list' => $this->project->getUsersList($task['project_id']),
'colors_list' => $this->task->getColors(), 'colors_list' => $this->task->getColors(),
@@ -384,124 +345,53 @@ class Task extends Base
} }
/** /**
* File upload form * Edit description form
* *
* @access public * @access public
*/ */
public function file() public function editDescription()
{ {
$task = $this->getTask(); $task = $this->getTask();
$this->response->html($this->taskLayout('task_upload', array( $this->response->html($this->taskLayout('task_edit_description', array(
'values' => $task,
'errors' => array(),
'task' => $task, 'task' => $task,
'menu' => 'tasks', 'menu' => 'tasks',
'title' => t('Attach a document') 'title' => t('Edit the description')
))); )));
} }
/** /**
* File upload (save files) * Save and validation the description
* *
* @access public * @access public
*/ */
public function upload() public function saveDescription()
{ {
$task = $this->getTask(); $task = $this->getTask();
$this->file->upload($task['project_id'], $task['id'], 'files'); $values = $this->request->getValues();
$this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#attachments');
}
/** list($valid, $errors) = $this->task->validateDescriptionCreation($values);
* File download
*
* @access public
*/
public function download()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
$filename = File::BASE_PATH.$file['path'];
if ($file['task_id'] == $task['id'] && file_exists($filename)) { if ($valid) {
$this->response->forceDownload($file['name']);
$this->response->binary(file_get_contents($filename));
}
$this->response->redirect('?controller=task&action=show&task_id='.$task['id']); if ($this->task->update($values)) {
} $this->session->flash(t('Task updated successfully.'));
}
/** else {
* Open a file (show the content in a popover) $this->session->flashError(t('Unable to update your task.'));
*
* @access public
*/
public function openFile()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
if ($file['task_id'] == $task['id']) {
$this->response->html($this->template->load('task_open_file', array(
'file' => $file
)));
}
}
/**
* Return the file content (work only for images)
*
* @access public
*/
public function image()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
$filename = File::BASE_PATH.$file['path'];
if ($file['task_id'] == $task['id'] && file_exists($filename)) {
$metadata = getimagesize($filename);
if (isset($metadata['mime'])) {
$this->response->contentType($metadata['mime']);
readfile($filename);
} }
}
}
/** $this->response->redirect('?controller=task&action=show&task_id='.$task['id']);
* Remove a file
*
* @access public
*/
public function removeFile()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
if ($file['task_id'] == $task['id'] && $this->file->remove($file['id'])) {
$this->session->flash(t('File removed successfully.'));
} else {
$this->session->flashError(t('Unable to remove this file.'));
} }
$this->response->redirect('?controller=task&action=show&task_id='.$task['id']); $this->response->html($this->taskLayout('task_edit_description', array(
} 'values' => $values,
'errors' => $errors,
/**
* Confirmation dialog before removing a file
*
* @access public
*/
public function confirmRemoveFile()
{
$task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
$this->response->html($this->taskLayout('task_remove_file', array(
'task' => $task, 'task' => $task,
'file' => $file,
'menu' => 'tasks', 'menu' => 'tasks',
'title' => t('Remove a file') 'title' => t('Edit the description')
))); )));
} }
} }

View File

@@ -338,4 +338,9 @@ return array(
// 'Do you really want to remove this file: "%s"?' => '', // 'Do you really want to remove this file: "%s"?' => '',
// 'open' => '', // 'open' => '',
// 'Attachments' => '', // 'Attachments' => '',
// 'Edit the task' => '',
// 'Edit the description' => '',
// 'Add a comment' => '',
// 'Edit a comment' => '',
// 'Summary' => '',
); );

View File

@@ -338,4 +338,9 @@ return array(
'Do you really want to remove this file: "%s"?' => 'Voulez-vous vraiment supprimer ce fichier « %s » ?', 'Do you really want to remove this file: "%s"?' => 'Voulez-vous vraiment supprimer ce fichier « %s » ?',
'open' => 'ouvrir', 'open' => 'ouvrir',
'Attachments' => 'Pièces-jointes', 'Attachments' => 'Pièces-jointes',
'Edit the task' => 'Modifier la tâche',
'Edit the description' => 'Modifier la description',
'Add a comment' => 'Ajouter un commentaire',
'Edit a comment' => 'Modifier un commentaire',
'Summary' => 'Résumé',
); );

View File

@@ -343,4 +343,9 @@ return array(
// 'Do you really want to remove this file: "%s"?' => '', // 'Do you really want to remove this file: "%s"?' => '',
// 'open' => '', // 'open' => '',
// 'Attachments' => '', // 'Attachments' => '',
// 'Edit the task' => '',
// 'Edit the description' => '',
// 'Add a comment' => '',
// 'Edit a comment' => '',
// 'Summary' => '',
); );

View File

@@ -339,4 +339,9 @@ return array(
// 'Do you really want to remove this file: "%s"?' => '', // 'Do you really want to remove this file: "%s"?' => '',
// 'open' => '', // 'open' => '',
// 'Attachments' => '', // 'Attachments' => '',
// 'Edit the task' => '',
// 'Edit the description' => '',
// 'Add a comment' => '',
// 'Edit a comment' => '',
// 'Summary' => '',
); );

View File

@@ -32,9 +32,10 @@ class Acl extends Base
'app' => array('index'), 'app' => array('index'),
'board' => array('index', 'show', 'assign', 'assigntask', 'save', 'check'), 'board' => array('index', 'show', 'assign', 'assigntask', 'save', 'check'),
'project' => array('tasks', 'index', 'forbidden', 'search'), 'project' => array('tasks', 'index', 'forbidden', 'search'),
'comment' => array('save', 'confirm', 'remove', 'update', 'edit'),
'user' => array('index', 'edit', 'update', 'forbidden', 'logout', 'index', 'unlinkgoogle'), 'user' => array('index', 'edit', 'update', 'forbidden', 'logout', 'index', 'unlinkgoogle'),
'config' => array('index', 'removeremembermetoken'), 'config' => array('index', 'removeremembermetoken'),
'comment' => array('create', 'save', 'confirm', 'remove', 'update', 'edit', 'forbidden'),
'file' => array('create', 'save', 'download', 'confirm', 'remove', 'open', 'image'),
'task' => array( 'task' => array(
'show', 'show',
'create', 'create',
@@ -45,17 +46,11 @@ class Acl extends Base
'confirmclose', 'confirmclose',
'open', 'open',
'confirmopen', 'confirmopen',
'description',
'duplicate', 'duplicate',
'remove', 'remove',
'confirmremove', 'confirmremove',
'file', 'editdescription',
'upload', 'savedescription',
'download',
'openfile',
'image',
'removefile',
'confirmremovefile',
), ),
); );

View File

@@ -30,7 +30,7 @@ abstract class Base
* Database instance * Database instance
* *
* @access protected * @access protected
* @var PicoDb * @var \PicoDb\Database
*/ */
protected $db; protected $db;
@@ -38,7 +38,7 @@ abstract class Base
* Event dispatcher instance * Event dispatcher instance
* *
* @access protected * @access protected
* @var Core\Event * @var \Core\Event
*/ */
protected $event; protected $event;

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,18 +1,16 @@
<section id="main"> <div class="page-header">
<div class="page-header"> <h2><?= t('Add a comment') ?></h2>
<h2><?= t('Remove 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&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> </div>
</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&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>
</section>

View File

@@ -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"> <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> <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> </p>
<?php if (isset($task)): ?>
<ul class="comment-actions"> <div class="comment-inner">
<li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li>
<?php if (Helper\is_admin() || Helper\is_current_user($comment['user_id'])): ?> <?php if (! isset($preview)): ?>
<li> <ul class="comment-actions">
<a href="?controller=comment&amp;action=confirm&amp;project_id=<?= $task['project_id'] ?>&amp;comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a> <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li>
</li> <?php if (Helper\is_admin() || Helper\is_current_user($comment['user_id'])): ?>
<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> <a href="?controller=comment&amp;action=confirm&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a>
</li> </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 ?> <?php endif ?>
</ul>
<?php endif ?>
<?php if (isset($display_edit_form) && $display_edit_form === true): ?> <div class="markdown">
<form method="post" action="?controller=comment&amp;action=update&amp;task_id=<?= $task['id'] ?>&amp;comment_id=<?= $comment['id'] ?>" autocomplete="off"> <?= 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&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
</div>
</form>
<?php else: ?>
<div class="markdown">
<?= Helper\markdown($comment['comment']) ?>
</div> </div>
<?php endif ?>
</div> </div>

View File

@@ -2,9 +2,11 @@
<h2><?= t('Attach a document') ?></h2> <h2><?= t('Attach a document') ?></h2>
</div> </div>
<form action="?controller=task&amp;action=upload&amp;task_id=<?= $task['id'] ?>" method="post" enctype="multipart/form-data"> <form action="?controller=file&amp;action=save&amp;task_id=<?= $task['id'] ?>" method="post" enctype="multipart/form-data">
<input type="file" name="files[]" multiple /> <input type="file" name="files[]" multiple />
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <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> </div>
</form> </form>

View File

@@ -1,6 +1,6 @@
<div class="page-header"> <div class="page-header">
<h2><?= Helper\escape($file['name']) ?></h2> <h2><?= Helper\escape($file['name']) ?></h2>
<div class="task-file-viewer"> <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>
</div> </div>

View File

@@ -8,7 +8,7 @@
</p> </p>
<div class="form-actions"> <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> <?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
</div> </div>
</div> </div>

View File

@@ -1,9 +1,12 @@
<section id="main"> <section id="main">
<div class="page-header"> <div class="page-header">
<h2><?= t('Edit a task') ?></h2> <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> </div>
<section> <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"> <div class="form-column">
@@ -44,7 +47,7 @@
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <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> </div>
</form> </form>
</section> </section>

View File

@@ -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>

View File

@@ -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> <h2><?= Helper\escape($task['title']) ?></h2>
<?php if ($task['score']): ?> <?php if ($task['score']): ?>
<span class="task-score"><?= Helper\escape($task['score']) ?></span> <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 endif ?>
<?php if ($task['date_due']): ?> <ul>
<li> <li>
<strong><?= dt('Must be done before %B %e, %G', $task['date_due']) ?></strong> <?= dt('Created on %B %e, %G at %k:%M %p', $task['date_creation']) ?>
</li> </li>
<?php endif ?> <?php if ($task['date_completed']): ?>
<li> <li>
<strong> <?= dt('Completed on %B %e, %G at %k:%M %p', $task['date_completed']) ?>
<?php if ($task['username']): ?> </li>
<?= t('Assigned to %s', $task['username']) ?>
<?php else: ?>
<?= t('There is nobody assigned') ?>
<?php endif ?> <?php endif ?>
</strong> <?php if ($task['date_due']): ?>
</li> <li>
<li> <strong><?= dt('Must be done before %B %e, %G', $task['date_due']) ?></strong>
<?= t('Column on the board:') ?> </li>
<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 ?> <?php endif ?>
</li> <li>
</ul> <strong>
</article> <?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"> <article class="markdown task-show-description">
<?= Helper\parse($task['description']) ?: t('There is no description.') ?> <?= Helper\parse($task['description']) ?: t('There is no description.') ?>
</article> </article>
<?php else: ?> </div>
<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>
<?php endif ?> <?php endif ?>
<?php if (! empty($files)): ?> <?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"> <ul class="task-show-files">
<?php foreach ($files as $file): ?> <?php foreach ($files as $file): ?>
<li> <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"> <span class="task-show-file-actions">
<?php if ($file['is_image']): ?> <?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 ?> <?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> </span>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
</div>
<?php endif ?> <?php endif ?>
<h2><?= t('Comments') ?></h2>
<?php if ($comments): ?> <?php if (! empty($comments)): ?>
<ul id="comments"> <div id="comments" class="task-show-section">
<div class="page-header">
<h2><?= t('Comments') ?></h2>
</div>
<?php foreach ($comments as $comment): ?> <?php foreach ($comments as $comment): ?>
<?= Helper\template('comment_show', array( <?= Helper\template('comment_show', array(
'comment' => $comment, 'comment' => $comment,
'task' => $task, '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 ?> <?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 ?> <?php endif ?>

View File

@@ -2,9 +2,11 @@
<h2><?= t('Actions') ?></h2> <h2><?= t('Actions') ?></h2>
<div class="task-show-actions"> <div class="task-show-actions">
<ul> <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=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') ?></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=file&amp;task_id=<?= $task['id'] ?>"><?= t('Attach a document') ?></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><a href="?controller=task&amp;action=duplicate&amp;project_id=<?= $task['project_id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li>
<li> <li>
<?php if ($task['is_active'] == 1): ?> <?php if ($task['is_active'] == 1): ?>

View File

@@ -673,6 +673,7 @@ div.task .task-score {
.task-show-details { .task-show-details {
position: relative; position: relative;
border-radius: 5px; border-radius: 5px;
padding-bottom: 10px;
} }
.task-show-details h2 { .task-show-details h2 {
@@ -695,11 +696,9 @@ div.task .task-score {
bottom: 5px; bottom: 5px;
} }
.task-show-description { .task-show-section {
border: 1px solid #999; margin-top: 30px;
border-radius: 5px; margin-bottom: 20px;
background: #f0f0f0;
padding: 10px;
} }
.task-show-files a { .task-show-files a {
@@ -729,6 +728,12 @@ div.task .task-score {
color: #333; color: #333;
} }
.description-textarea {
width: 80%;
max-width: 800px;
height: 300px;
}
.task-file-viewer { .task-file-viewer {
position: relative; position: relative;
} }
@@ -739,6 +744,69 @@ div.task .task-score {
margin-top: 10px; margin-top: 10px;
} }
/* comments */
.comment {
margin-bottom: 20px;
}
.comment:hover {
background: #F7F8E0;
}
.comment-inner {
border-left: 4px solid #333;
padding-bottom: 10px;
padding-left: 20px;
margin-left: 20px;
margin-right: 10px;
}
.comment-preview {
border: 2px solid #000;
border-radius: 3px;
padding: 10px;
}
.comment-preview .comment-inner {
border: none;
padding: 0;
margin: 0;
}
.comment-title {
margin-bottom: 8px;
padding-bottom: 3px;
border-bottom: 1px dotted #aaa;
}
.comment-actions {
font-size: 0.8em;
padding: 0;
text-align: right;
}
.comment-actions li {
display: inline;
padding-left: 5px;
padding-right: 5px;
border-right: 1px dotted #000;
}
.comment-actions li:last-child {
padding-right: 0;
border: 0;
}
.comment-username {
font-weight: bold;
}
.comment-textarea {
height: 200px;
width: 80%;
max-width: 800px;
}
/* markdown content */ /* markdown content */
.markdown { .markdown {
line-height: 1.4em; line-height: 1.4em;
@@ -769,12 +837,12 @@ div.task .task-score {
} }
.markdown pre { .markdown pre {
background: #fff; background: #fafafa;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
border: 1px dashed #000; border: 1px solid #ccc;
overflow: auto; overflow: auto;
color: #000; color: brown;
} }
.markdown blockquote { .markdown blockquote {
@@ -783,92 +851,8 @@ div.task .task-score {
padding-left: 8px; padding-left: 8px;
} }
/* comments */ .markdown p {
.comment { margin-bottom: 10px;
margin-bottom: 25px;
padding: 0;
border: 1px solid #ddd;
border-radius: 5px;
}
.comment-edit {
margin-bottom: 25px;
padding: 0;
border: 2px solid #000;
border-radius: 5px;
}
.comment:hover {
border: 1px solid #888;
}
.comment-title {
font-size: 0.9em;
padding: 5px;
margin-bottom: 2px;
border-bottom: 1px solid #ddd;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
background: #f0f0f0;
}
.comment:nth-child(odd) .comment-title {
background: #f0f0f0;
}
.comment:nth-child(even) .comment-title {
background: #ddd;
}
.comment-actions a,
.comment-title a {
color: #000;
text-decoration: none;
}
.comment-actions a:hover,
.comment-actions a:focus,
.comment-title a:hover,
.comment-title a:focus {
text-decoration: underline;
}
.comment-actions {
font-size: 0.8em;
padding: 0;
text-align: right;
}
.comment-actions li {
display: inline;
padding-left: 5px;
padding-right: 5px;
border-right: 1px dotted #000;
}
.comment-actions li:last-child {
border: 0;
}
.comment-username {
font-weight: bold;
}
.comment-textarea {
height: 70px;
width: 500px;
}
.comment .markdown {
margin: 10px;
}
.comment .markdown pre {
background: #fdfdfd;
}
.comment-edit form {
border: none;
} }
/* task colors */ /* task colors */