From 67b836164997527b91452b19adbcb8aa3c5decf1 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 15 May 2016 18:31:47 -0400 Subject: Refactoring: added controlled middleware and changed response class --- app/Template/dashboard/activity.php | 4 +++ app/Template/dashboard/calendar.php | 5 +++ app/Template/dashboard/layout.php | 32 +++++++++++++++++ app/Template/dashboard/notifications.php | 61 ++++++++++++++++++++++++++++++++ app/Template/dashboard/projects.php | 50 ++++++++++++++++++++++++++ app/Template/dashboard/show.php | 12 +++++++ app/Template/dashboard/sidebar.php | 27 ++++++++++++++ app/Template/dashboard/subtasks.php | 43 ++++++++++++++++++++++ app/Template/dashboard/tasks.php | 49 +++++++++++++++++++++++++ 9 files changed, 283 insertions(+) create mode 100644 app/Template/dashboard/activity.php create mode 100644 app/Template/dashboard/calendar.php create mode 100644 app/Template/dashboard/layout.php create mode 100644 app/Template/dashboard/notifications.php create mode 100644 app/Template/dashboard/projects.php create mode 100644 app/Template/dashboard/show.php create mode 100644 app/Template/dashboard/sidebar.php create mode 100644 app/Template/dashboard/subtasks.php create mode 100644 app/Template/dashboard/tasks.php (limited to 'app/Template/dashboard') diff --git a/app/Template/dashboard/activity.php b/app/Template/dashboard/activity.php new file mode 100644 index 00000000..71a67fb2 --- /dev/null +++ b/app/Template/dashboard/activity.php @@ -0,0 +1,4 @@ + +render('event/events', array('events' => $events)) ?> \ No newline at end of file diff --git a/app/Template/dashboard/calendar.php b/app/Template/dashboard/calendar.php new file mode 100644 index 00000000..a154203b --- /dev/null +++ b/app/Template/dashboard/calendar.php @@ -0,0 +1,5 @@ +
+
diff --git a/app/Template/dashboard/layout.php b/app/Template/dashboard/layout.php new file mode 100644 index 00000000..2a32ac02 --- /dev/null +++ b/app/Template/dashboard/layout.php @@ -0,0 +1,32 @@ +
+ + +
\ No newline at end of file diff --git a/app/Template/dashboard/notifications.php b/app/Template/dashboard/notifications.php new file mode 100644 index 00000000..b64eb0b7 --- /dev/null +++ b/app/Template/dashboard/notifications.php @@ -0,0 +1,61 @@ + +

+ + + + + + + + + + + + + + + + + +
+ text->contains($notification['event_name'], 'subtask')): ?> + + text->contains($notification['event_name'], 'task.move')): ?> + + text->contains($notification['event_name'], 'task.overdue')): ?> + + text->contains($notification['event_name'], 'task')): ?> + + text->contains($notification['event_name'], 'comment')): ?> + + text->contains($notification['event_name'], 'file')): ?> + + + + text->contains($notification['event_name'], 'comment')): ?> + url->link($notification['title'], 'task', 'show', array('task_id' => $notification['event_data']['task']['id'], 'project_id' => $notification['event_data']['task']['project_id']), false, '', '', false, 'comment-'.$notification['event_data']['comment']['id']) ?> + text->contains($notification['event_name'], 'task.overdue')): ?> + 1): ?> + + + url->link($notification['title'], 'task', 'show', array('task_id' => $notification['event_data']['tasks'][0]['id'], 'project_id' => $notification['event_data']['tasks'][0]['project_id'])) ?> + + + url->link($notification['title'], 'task', 'show', array('task_id' => $notification['event_data']['task']['id'], 'project_id' => $notification['event_data']['task']['project_id'])) ?> + + + dt->datetime($notification['date_creation']) ?> + + + url->link(t('Mark as read'), 'webNotification', 'remove', array('user_id' => $user['id'], 'notification_id' => $notification['id'])) ?> +
+ \ No newline at end of file diff --git a/app/Template/dashboard/projects.php b/app/Template/dashboard/projects.php new file mode 100644 index 00000000..cdf19bdf --- /dev/null +++ b/app/Template/dashboard/projects.php @@ -0,0 +1,50 @@ + +isEmpty()): ?> +

+ + + + + + + + + getCollection() as $project): ?> + + + + + + + +
order('Id', 'id') ?>order('', 'is_private') ?>order(t('Project'), \Kanboard\Model\Project::TABLE.'.name') ?>
+ render('project/dropdown', array('project' => $project)) ?> + + + + + + user->hasProjectAccess('gantt', 'project', $project['id'])): ?> + url->link('', 'gantt', 'project', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?> + + + url->link('', 'listing', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?>  + url->link('', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>  + + url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?> + + + + + + + + + text->e($column['title']) ?> + +
+ + + diff --git a/app/Template/dashboard/show.php b/app/Template/dashboard/show.php new file mode 100644 index 00000000..bc4e2952 --- /dev/null +++ b/app/Template/dashboard/show.php @@ -0,0 +1,12 @@ +
+ +
+ +render('dashboard/projects', array('paginator' => $project_paginator, 'user' => $user)) ?> +render('dashboard/tasks', array('paginator' => $task_paginator, 'user' => $user)) ?> +render('dashboard/subtasks', array('paginator' => $subtask_paginator, 'user' => $user)) ?> diff --git a/app/Template/dashboard/sidebar.php b/app/Template/dashboard/sidebar.php new file mode 100644 index 00000000..86cc20f8 --- /dev/null +++ b/app/Template/dashboard/sidebar.php @@ -0,0 +1,27 @@ + diff --git a/app/Template/dashboard/subtasks.php b/app/Template/dashboard/subtasks.php new file mode 100644 index 00000000..ee6caf02 --- /dev/null +++ b/app/Template/dashboard/subtasks.php @@ -0,0 +1,43 @@ + +isEmpty()): ?> +

+ + + + + + + + + + getCollection() as $subtask): ?> + + + + + + + + +
order('Id', 'tasks.id') ?>order(t('Project'), 'project_name') ?>order(t('Task'), 'task_name') ?>order(t('Subtask'), 'title') ?>
+ render('task/dropdown', array('task' => array('id' => $subtask['task_id'], 'project_id' => $subtask['project_id']))) ?> + + url->link($this->text->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?> + + url->link($this->text->e($subtask['task_name']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?> + + subtask->toggleStatus($subtask, $subtask['project_id']) ?> + + + text->e($subtask['time_spent']).'h' ?> + + + + text->e($subtask['time_estimated']).'h' ?> + +
+ + + diff --git a/app/Template/dashboard/tasks.php b/app/Template/dashboard/tasks.php new file mode 100644 index 00000000..71b62572 --- /dev/null +++ b/app/Template/dashboard/tasks.php @@ -0,0 +1,49 @@ + +isEmpty()): ?> +

+ + + + + + + + + + + getCollection() as $task): ?> + + + + + + + + + +
order('Id', 'tasks.id') ?>order(t('Project'), 'project_name') ?>order(t('Task'), 'title') ?>order('Priority', 'tasks.priority') ?>order(t('Due date'), 'date_due') ?>
+ render('task/dropdown', array('task' => $task)) ?> + + url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + + url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + + = 0): ?> + Ptext->e($task['priority'])?> + + + + text->e($task['time_spent']).'h' ?> + + + + text->e($task['time_estimated']).'h' ?> + + + dt->date($task['date_due']) ?> +
+ + + -- cgit v1.2.3