From 9d6715ddc01586e524ef433732d649e17f1d88b5 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 24 Jul 2016 13:55:35 -0400 Subject: Improve project page titles --- ChangeLog | 2 ++ app/Controller/AnalyticController.php | 16 ++++++++-------- app/Helper/LayoutHelper.php | 4 ++++ app/Template/analytic/compare_hours.php | 2 +- app/Template/export/subtasks.php | 4 ++-- app/Template/export/summary.php | 4 ++-- app/Template/export/tasks.php | 4 ++-- app/Template/header.php | 2 +- app/Template/task/sidebar.php | 8 ++++++-- app/Template/user_view/sidebar.php | 8 ++++++++ 10 files changed, 36 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6da73200..de486987 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ New features: Improvements: +* Improve project page title +* Remove sidebar titles when not necessary * Internal events management refactoring * Handle header X-Real-IP to get IP address * Display project name for task auto-complete fields diff --git a/app/Controller/AnalyticController.php b/app/Controller/AnalyticController.php index cf3ba034..ab0646a2 100644 --- a/app/Controller/AnalyticController.php +++ b/app/Controller/AnalyticController.php @@ -33,7 +33,7 @@ class AnalyticController extends BaseController 'metrics' => $this->projectDailyStatsModel->getRawMetrics($project['id'], $from, $to), 'date_format' => $this->configModel->get('application_date_format'), 'date_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateFormats()), - 'title' => t('Lead and Cycle time for "%s"', $project['name']), + 'title' => t('Lead and cycle time'), ))); } @@ -60,7 +60,7 @@ class AnalyticController extends BaseController 'project' => $project, 'paginator' => $paginator, 'metrics' => $this->estimatedTimeComparisonAnalytic->build($project['id']), - 'title' => t('Compare hours for "%s"', $project['name']), + 'title' => t('Estimated vs actual time'), ))); } @@ -76,7 +76,7 @@ class AnalyticController extends BaseController $this->response->html($this->helper->layout->analytic('analytic/avg_time_columns', array( 'project' => $project, 'metrics' => $this->averageTimeSpentColumnAnalytic->build($project['id']), - 'title' => t('Average time spent into each column for "%s"', $project['name']), + 'title' => t('Average time into each column'), ))); } @@ -92,7 +92,7 @@ class AnalyticController extends BaseController $this->response->html($this->helper->layout->analytic('analytic/tasks', array( 'project' => $project, 'metrics' => $this->taskDistributionAnalytic->build($project['id']), - 'title' => t('Task repartition for "%s"', $project['name']), + 'title' => t('Task distribution'), ))); } @@ -108,7 +108,7 @@ class AnalyticController extends BaseController $this->response->html($this->helper->layout->analytic('analytic/users', array( 'project' => $project, 'metrics' => $this->userDistributionAnalytic->build($project['id']), - 'title' => t('User repartition for "%s"', $project['name']), + 'title' => t('User repartition'), ))); } @@ -119,7 +119,7 @@ class AnalyticController extends BaseController */ public function cfd() { - $this->commonAggregateMetrics('analytic/cfd', 'total', 'Cumulative flow diagram for "%s"'); + $this->commonAggregateMetrics('analytic/cfd', 'total', t('Cumulative flow diagram')); } /** @@ -129,7 +129,7 @@ class AnalyticController extends BaseController */ public function burndown() { - $this->commonAggregateMetrics('analytic/burndown', 'score', 'Burndown chart for "%s"'); + $this->commonAggregateMetrics('analytic/burndown', 'score', t('Burndown chart')); } /** @@ -157,7 +157,7 @@ class AnalyticController extends BaseController 'project' => $project, 'date_format' => $this->configModel->get('application_date_format'), 'date_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateFormats()), - 'title' => t($title, $project['name']), + 'title' => $title, ))); } diff --git a/app/Helper/LayoutHelper.php b/app/Helper/LayoutHelper.php index 8ebb05d4..8d2e7e00 100644 --- a/app/Helper/LayoutHelper.php +++ b/app/Helper/LayoutHelper.php @@ -156,6 +156,10 @@ class LayoutHelper extends Base */ public function analytic($template, array $params) { + if (isset($params['project']['name'])) { + $params['title'] = $params['project']['name'].' > '.$params['title']; + } + return $this->subLayout('analytic/layout', 'analytic/sidebar', $template, $params); } diff --git a/app/Template/analytic/compare_hours.php b/app/Template/analytic/compare_hours.php index 70d8d02b..e4a0b60e 100644 --- a/app/Template/analytic/compare_hours.php +++ b/app/Template/analytic/compare_hours.php @@ -1,5 +1,5 @@
diff --git a/app/Template/export/subtasks.php b/app/Template/export/subtasks.php index a82cb3d1..878a7132 100644 --- a/app/Template/export/subtasks.php +++ b/app/Template/export/subtasks.php @@ -1,5 +1,5 @@

@@ -21,4 +21,4 @@
- \ No newline at end of file + diff --git a/app/Template/export/summary.php b/app/Template/export/summary.php index 60aa306f..d9362a9b 100644 --- a/app/Template/export/summary.php +++ b/app/Template/export/summary.php @@ -1,5 +1,5 @@

@@ -21,4 +21,4 @@
- \ No newline at end of file + diff --git a/app/Template/export/tasks.php b/app/Template/export/tasks.php index bed8ab90..ae411326 100644 --- a/app/Template/export/tasks.php +++ b/app/Template/export/tasks.php @@ -1,5 +1,5 @@

@@ -21,4 +21,4 @@
- \ No newline at end of file + diff --git a/app/Template/header.php b/app/Template/header.php index f99f1031..a2b3fcb3 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -5,7 +5,7 @@ url->link('KB', 'DashboardController', 'show', array(), false, '', t('Dashboard')) ?> - + url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?> text->e($title) ?> diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index b44e6f0b..728741ba 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -1,5 +1,7 @@