summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-25 17:41:41 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-25 17:41:41 -0400
commit354e37971d43d3b62d8f4e2a23eff09e88525627 (patch)
treeab7ded1870bbdec219909cf5f5c9d50549d2c9a1 /app/Template
parent13d5bd8e48bd6c0109d1272da58a8879bf9a6737 (diff)
Unification of project header
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/activity/project.php40
-rw-r--r--app/Template/analytic/layout.php33
-rw-r--r--app/Template/app/layout.php2
-rw-r--r--app/Template/board/view_private.php17
-rw-r--r--app/Template/calendar/show.php6
-rw-r--r--app/Template/gantt/project.php7
-rw-r--r--app/Template/listing/show.php8
-rw-r--r--app/Template/project/layout.php27
-rw-r--r--app/Template/project_header/dropdown.php4
-rw-r--r--app/Template/project_header/header.php2
-rw-r--r--app/Template/project_header/views.php2
-rw-r--r--app/Template/project_overview/show.php6
-rw-r--r--app/Template/task/details.php7
-rw-r--r--app/Template/task/layout.php22
-rw-r--r--app/Template/task/menu.php78
-rw-r--r--app/Template/task/show.php1
16 files changed, 31 insertions, 231 deletions
diff --git a/app/Template/activity/project.php b/app/Template/activity/project.php
index ba6d6629..176d9b99 100644
--- a/app/Template/activity/project.php
+++ b/app/Template/activity/project.php
@@ -1,40 +1,14 @@
<section id="main">
- <div class="page-header">
+ <?= $this->projectHeader->render($project, 'Analytic', $this->app->getRouterAction()) ?>
+
+ <?php if ($project['is_public']): ?>
+ <div class="menu-inline pull-right">
<ul>
- <li>
- <span class="dropdown">
- <span>
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </ul>
- </span>
- </span>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
- <li>
- <i class="fa fa-cog fa-fw"></i>
- <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php endif ?>
- <li>
- <i class="fa fa-folder fa-fw"></i>
- <?= $this->url->link(t('All projects'), 'project', 'index') ?>
- </li>
- <?php if ($project['is_public']): ?>
- <li><i class="fa fa-rss-square fa-fw"></i><?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
- <li><i class="fa fa-calendar fa-fw"></i><?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li>
- <?php endif ?>
+ <li><i class="fa fa-rss-square fa-fw"></i><?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
+ <li><i class="fa fa-calendar fa-fw"></i><?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li>
</ul>
</div>
+ <?php endif ?>
<?= $this->render('event/events', array('events' => $events)) ?>
</section> \ No newline at end of file
diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php
index f1dba552..35793cbb 100644
--- a/app/Template/analytic/layout.php
+++ b/app/Template/analytic/layout.php
@@ -1,36 +1,5 @@
<section id="main">
- <div class="page-header">
- <ul>
- <li>
- <span class="dropdown">
- <span>
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </ul>
- </span>
- </span>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
- <li>
- <i class="fa fa-cog fa-fw"></i>
- <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php endif ?>
- <li>
- <i class="fa fa-folder fa-fw"></i>
- <?= $this->url->link(t('All projects'), 'project', 'index') ?>
- </li>
- </ul>
- </div>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<section class="sidebar-container">
<?= $this->render($sidebar_template, array('project' => $project)) ?>
diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php
index 200cb0d7..2a32ac02 100644
--- a/app/Template/app/layout.php
+++ b/app/Template/app/layout.php
@@ -1,5 +1,5 @@
<section id="main">
- <div class="page-header page-header-mobile">
+ <div class="page-header">
<ul>
<?php if ($this->user->hasAccess('ProjectCreation', 'create')): ?>
<li>
diff --git a/app/Template/board/view_private.php b/app/Template/board/view_private.php
index b5e38c66..13702273 100644
--- a/app/Template/board/view_private.php
+++ b/app/Template/board/view_private.php
@@ -1,19 +1,12 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- 'categories_list' => $categories_list,
- 'users_list' => $users_list,
- 'custom_filters_list' => $custom_filters_list,
- 'is_board' => true,
- )) ?>
+ <?= $this->projectHeader->render($project, 'Board', 'show', true) ?>
<?= $this->render('board/table_container', array(
- 'project' => $project,
- 'swimlanes' => $swimlanes,
- 'board_private_refresh_interval' => $board_private_refresh_interval,
- 'board_highlight_period' => $board_highlight_period,
+ 'project' => $project,
+ 'swimlanes' => $swimlanes,
+ 'board_private_refresh_interval' => $board_private_refresh_interval,
+ 'board_highlight_period' => $board_highlight_period,
)) ?>
</section>
diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php
index 7085b51e..f00e810b 100644
--- a/app/Template/calendar/show.php
+++ b/app/Template/calendar/show.php
@@ -1,9 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- )) ?>
-
+ <?= $this->projectHeader->render($project, 'Calendar', 'show') ?>
<div id="calendar"
data-save-url="<?= $this->url->href('calendar', 'save', array('project_id' => $project['id'])) ?>"
data-check-url="<?= $this->url->href('calendar', 'project', array('project_id' => $project['id'])) ?>"
diff --git a/app/Template/gantt/project.php b/app/Template/gantt/project.php
index fe193c2b..e6c8592f 100644
--- a/app/Template/gantt/project.php
+++ b/app/Template/gantt/project.php
@@ -1,10 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- 'users_list' => $users_list,
- )) ?>
-
+ <?= $this->projectHeader->render($project, 'Gantt', 'project') ?>
<div class="menu-inline">
<ul>
<li <?= $sorting === 'board' ? 'class="active"' : '' ?>>
diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php
index 10dcedcc..c7887ebd 100644
--- a/app/Template/listing/show.php
+++ b/app/Template/listing/show.php
@@ -1,11 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- 'custom_filters_list' => $custom_filters_list,
- 'users_list' => $users_list,
- 'categories_list' => $categories_list,
- )) ?>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<?php if ($paginator->isEmpty()): ?>
<p class="alert"><?= t('No tasks found.') ?></p>
diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php
index eb391ae5..fcb3e5f3 100644
--- a/app/Template/project/layout.php
+++ b/app/Template/project/layout.php
@@ -1,30 +1,5 @@
<section id="main">
- <div class="page-header">
- <ul>
- <li>
- <span class="dropdown">
- <span>
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </ul>
- </span>
- </span>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-folder fa-fw"></i>
- <?= $this->url->link(t('All projects'), 'project', 'index') ?>
- </li>
- </ul>
- </div>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<section class="sidebar-container">
<?= $this->render($sidebar_template, array('project' => $project)) ?>
diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php
index bbc033bf..759a5135 100644
--- a/app/Template/project_header/dropdown.php
+++ b/app/Template/project_header/dropdown.php
@@ -1,7 +1,7 @@
<div class="dropdown">
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
+ <a href="#" class="dropdown-menu action-menu"><?= t('Menu') ?> <i class="fa fa-caret-down"></i></a>
<ul>
- <?php if ($is_board): ?>
+ <?php if ($board_view): ?>
<li>
<span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>>
<i class="fa fa-expand fa-fw"></i>
diff --git a/app/Template/project_header/header.php b/app/Template/project_header/header.php
index f6e5af9e..aaa8137b 100644
--- a/app/Template/project_header/header.php
+++ b/app/Template/project_header/header.php
@@ -1,7 +1,7 @@
<div class="project-header">
<?= $this->hook->render('template:project:header:before', array('project' => $project)) ?>
- <?= $this->render('project_header/dropdown', array('project' => $project, 'is_board' => isset($is_board))) ?>
+ <?= $this->render('project_header/dropdown', array('project' => $project, 'board_view' => $board_view)) ?>
<?= $this->render('project_header/views', array('project' => $project, 'filters' => $filters)) ?>
<?= $this->render('project_header/search', array(
'project' => $project,
diff --git a/app/Template/project_header/views.php b/app/Template/project_header/views.php
index f8fdbb02..353e4b62 100644
--- a/app/Template/project_header/views.php
+++ b/app/Template/project_header/views.php
@@ -1,7 +1,7 @@
<ul class="views">
<li <?= $this->app->getRouterController() === 'ProjectOverview' ? 'class="active"' : '' ?>>
<i class="fa fa-eye fa-fw"></i>
- <?= $this->url->link(t('Overview'), 'ProjectOverview', 'show', array('project_id' => $project['id']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
+ <?= $this->url->link(t('Overview'), 'ProjectOverview', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
</li>
<li <?= $this->app->getRouterController() === 'Board' ? 'class="active"' : '' ?>>
<i class="fa fa-th fa-fw"></i>
diff --git a/app/Template/project_overview/show.php b/app/Template/project_overview/show.php
index 9a9786e8..6fe815b3 100644
--- a/app/Template/project_overview/show.php
+++ b/app/Template/project_overview/show.php
@@ -1,9 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- )) ?>
-
+ <?= $this->projectHeader->render($project, 'ProjectOverview', 'show') ?>
<?= $this->render('project_overview/columns', array('project' => $project)) ?>
<?= $this->render('project_overview/description', array('project' => $project)) ?>
<?= $this->render('project_overview/attachments', array('project' => $project, 'images' => $images, 'files' => $files)) ?>
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index a7c4ad01..6093c157 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -1,5 +1,6 @@
<section id="task-summary">
<h2><?= $this->text->e($task['title']) ?></h2>
+
<div class="task-summary-container color-<?= $task['color_id'] ?>">
<div class="task-summary-column">
<ul class="no-bullet">
@@ -134,4 +135,10 @@
</ul>
</div>
</div>
+
+ <?php if ($editable && empty($task['date_started'])): ?>
+ <div class="task-summary-buttons">
+ <?= $this->url->button('fa-play', t('Set start date'), 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ </div>
+ <?php endif ?>
</section>
diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php
index ca27fd4f..52db5d1b 100644
--- a/app/Template/task/layout.php
+++ b/app/Template/task/layout.php
@@ -1,25 +1,5 @@
<section id="main">
- <div class="page-header">
- <ul>
- <li>
- <?= $this->render('task/menu', array('task' => $task)) ?>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id']), false, '', '', false, $task['swimlane_id'] != 0 ? 'swimlane-'.$task['swimlane_id'] : '') ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
- </li>
- <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $task['project_id'])): ?>
- <li>
- <i class="fa fa-cog fa-fw"></i>
- <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $task['project_id'])) ?>
- </li>
- <?php endif ?>
- </ul>
- </div>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<section
class="sidebar-container" id="task-view"
data-edit-url="<?= $this->url->href('taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"
diff --git a/app/Template/task/menu.php b/app/Template/task/menu.php
deleted file mode 100644
index fe30d06e..00000000
--- a/app/Template/task/menu.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
-<div class="dropdown">
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?php if (empty($task['date_started'])): ?>
- <li>
- <i class="fa fa-play fa-fw"></i>
- <?= $this->url->link(t('Set automatically the start date'), 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- </li>
- <?php endif ?>
- <li>
- <i class="fa fa-pencil-square-o fa-fw"></i>
- <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-align-left 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>
- <li>
- <i class="fa fa-refresh fa-rotate-90 fa-fw"></i>
- <?= $this->url->link(t('Edit recurrence'), 'TaskRecurrence', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <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>
- <li>
- <i class="fa fa-code-fork fa-fw"></i>
- <?= $this->url->link(t('Add internal link'), 'TaskInternalLink', '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') ?>
- </li>
- <li>
- <i class="fa fa-file fa-fw"></i>
- <?= $this->url->link(t('Attach a document'), 'TaskFile', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-camera fa-fw"></i>
- <?= $this->url->link(t('Add a screenshot'), 'TaskFile', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-files-o fa-fw"></i>
- <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-clipboard fa-fw"></i>
- <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-clone fa-fw"></i>
- <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <?php if ($task['is_active'] == 1): ?>
- <i class="fa fa-times fa-fw"></i>
- <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- <?php else: ?>
- <i class="fa fa-check-square-o fa-fw"></i>
- <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- <?php endif ?>
- </li>
- <?php if ($this->task->canRemove($task)): ?>
- <li>
- <i class="fa fa-trash-o fa-fw"></i>
- <?= $this->url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <?php endif ?>
-
- <?= $this->hook->render('template:task:menu') ?>
- </ul>
-</div>
-<?php endif ?>
diff --git a/app/Template/task/show.php b/app/Template/task/show.php
index d68f6c48..86422941 100644
--- a/app/Template/task/show.php
+++ b/app/Template/task/show.php
@@ -14,7 +14,6 @@
'task' => $task,
'subtasks' => $subtasks,
'project' => $project,
- 'users_list' => isset($users_list) ? $users_list : array(),
'editable' => true,
)) ?>