From f49d2b14bcd9f3dcb3b4735460533e8d2dd67e22 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 9 Apr 2017 08:44:30 +0700 Subject: [PATCH 1/4] Added collapse for boxes --- public/assets/js/build-plugins/codeception.js | 1 - public/assets/js/build-plugins/phpspec.js | 1 - public/assets/js/build-plugins/phptallint.js | 1 - public/assets/js/build-plugins/phpunit.js | 1 - public/assets/js/build-plugins/summary.js | 1 - public/assets/js/build.js | 17 +++++++---------- src/PHPCensor/View/Home/index.phtml | 5 +++++ src/PHPCensor/View/Project/view.phtml | 19 ++++++++++++++++++- 8 files changed, 30 insertions(+), 16 deletions(-) diff --git a/public/assets/js/build-plugins/codeception.js b/public/assets/js/build-plugins/codeception.js index 71ed55a7..8c517cca 100644 --- a/public/assets/js/build-plugins/codeception.js +++ b/public/assets/js/build-plugins/codeception.js @@ -5,7 +5,6 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({ lastData: null, lastMeta: null, displayOnUpdate: false, - box: true, rendered: false, register: function() { diff --git a/public/assets/js/build-plugins/phpspec.js b/public/assets/js/build-plugins/phpspec.js index 8ddecf78..68c089ee 100644 --- a/public/assets/js/build-plugins/phpspec.js +++ b/public/assets/js/build-plugins/phpspec.js @@ -4,7 +4,6 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({ title: Lang.get('phpspec'), lastData: null, displayOnUpdate: false, - box: true, rendered: false, register: function() { diff --git a/public/assets/js/build-plugins/phptallint.js b/public/assets/js/build-plugins/phptallint.js index 3381af69..99c55120 100644 --- a/public/assets/js/build-plugins/phptallint.js +++ b/public/assets/js/build-plugins/phptallint.js @@ -3,7 +3,6 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({ css: 'col-xs-12', title: 'PHPTAL Lint', lastData: null, - box: true, rendered: false, register: function() { diff --git a/public/assets/js/build-plugins/phpunit.js b/public/assets/js/build-plugins/phpunit.js index e345c4a0..d2885cf9 100644 --- a/public/assets/js/build-plugins/phpunit.js +++ b/public/assets/js/build-plugins/phpunit.js @@ -4,7 +4,6 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({ title: Lang.get('phpunit'), lastData: null, displayOnUpdate: false, - box: true, rendered: false, statusMap: { success : 'ok', diff --git a/public/assets/js/build-plugins/summary.js b/public/assets/js/build-plugins/summary.js index 7522c178..0d598d58 100644 --- a/public/assets/js/build-plugins/summary.js +++ b/public/assets/js/build-plugins/summary.js @@ -2,7 +2,6 @@ var SummaryPlugin = ActiveBuild.UiPlugin.extend({ id: 'build-summary', css: 'col-xs-12', title: Lang.get('build-summary'), - box: true, statusLabels: [Lang.get('pending'), Lang.get('running'), Lang.get('success'), Lang.get('failed'), Lang.get('failed_allowed')], statusClasses: ['info', 'warning', 'success', 'danger', 'danger'], diff --git a/public/assets/js/build.js b/public/assets/js/build.js index 8636070f..38498edd 100644 --- a/public/assets/js/build.js +++ b/public/assets/js/build.js @@ -146,28 +146,25 @@ var Build = Class.extend({ } } - $('#plugins').sortable({ - handle: '.box-title', - connectWith: '#plugins', - update: self.storePluginOrder - }); - $(window).trigger({type: 'build-updated', queryData: self.buildData}); }, renderPlugin: function(plugin) { var output = plugin.render(); - if (!plugin.box) { - output = $('
').append(output); - } + output = $('
').append(output); var container = $('
').addClass('ui-plugin ' + plugin.css).attr('id', plugin.id); var content = $('
').append(output); content.addClass('box'); if (plugin.title) { - content.prepend('

'+plugin.title+'

'); + content.prepend( + '

'+plugin.title+'

'+ + '
'+ + '
' + ); } container.append(content); diff --git a/src/PHPCensor/View/Home/index.phtml b/src/PHPCensor/View/Home/index.phtml index 381292ab..874414eb 100644 --- a/src/PHPCensor/View/Home/index.phtml +++ b/src/PHPCensor/View/Home/index.phtml @@ -14,6 +14,11 @@ use PHPCensor\Model\Build;

+
+ +
diff --git a/src/PHPCensor/View/Project/view.phtml b/src/PHPCensor/View/Project/view.phtml index b320cb8b..cfafe388 100644 --- a/src/PHPCensor/View/Project/view.phtml +++ b/src/PHPCensor/View/Project/view.phtml @@ -198,6 +198,11 @@

+
+ +
@@ -220,6 +225,11 @@

+
+ +
@@ -250,7 +260,14 @@ getSshPublicKey()): ?>
-

+
+

+
+ +
+
getSshPublicKey(); ?>
From 8a5f15ad789d403ba75ae915fa3bd94373def7cd Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 9 Apr 2017 21:57:41 +0700 Subject: [PATCH 2/4] Fixed localization for environment string 'all' --- src/PHPCensor/View/Project/view.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHPCensor/View/Project/view.phtml b/src/PHPCensor/View/Project/view.phtml index cfafe388..34cdd7e0 100644 --- a/src/PHPCensor/View/Project/view.phtml +++ b/src/PHPCensor/View/Project/view.phtml @@ -82,7 +82,7 @@ } elseif (!empty($branch)) { print Lang::get('branch_x', $branch); } else { - print Lang::get('All'); + print Lang::get('all'); } ?>   From 1b11ec18ace2e4dc8169f56d2e919e84f4e646ce Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 9 Apr 2017 22:39:20 +0700 Subject: [PATCH 3/4] Fixed build buttons block in project page --- .../Controller/ProjectController.php | 47 ++++--- src/PHPCensor/View/Project/view.phtml | 126 +++++++----------- 2 files changed, 80 insertions(+), 93 deletions(-) diff --git a/src/PHPCensor/Controller/ProjectController.php b/src/PHPCensor/Controller/ProjectController.php index 00372b24..f95954c9 100644 --- a/src/PHPCensor/Controller/ProjectController.php +++ b/src/PHPCensor/Controller/ProjectController.php @@ -53,13 +53,19 @@ class ProjectController extends PHPCensor\Controller } /** - * View a specific project. - */ + * View a specific project. + * + * @param integer $projectId + * + * @throws NotFoundException + * + * @return string + */ public function view($projectId) { - $branch = $this->getParam('branch', ''); + $branch = $this->getParam('branch', ''); $environment = $this->getParam('environment', ''); - $project = $this->projectStore->getById($projectId); + $project = $this->projectStore->getById($projectId); if (empty($project)) { throw new NotFoundException(Lang::get('project_x_not_found', $projectId)); @@ -76,18 +82,18 @@ class ProjectController extends PHPCensor\Controller return $response; } - $this->view->builds = $builds[0]; - $this->view->total = $builds[1]; - $this->view->project = $project; - $this->view->branch = urldecode($branch); - $this->view->branches = $this->projectStore->getKnownBranches($projectId); - $this->view->environment = urldecode($environment); + $this->view->builds = $builds[0]; + $this->view->total = $builds[1]; + $this->view->project = $project; + $this->view->branch = urldecode($branch); + $this->view->branches = $this->projectStore->getKnownBranches($projectId); + $this->view->environment = urldecode($environment); $this->view->environments = $project->getEnvironmentsNames(); - $this->view->page = $page; - $this->view->pages = $pages; - $this->view->perPage = $perPage; + $this->view->page = $page; + $this->view->pages = $pages; + $this->view->perPage = $perPage; - $this->layout->title = $project->getTitle(); + $this->layout->title = $project->getTitle(); if (!empty($this->view->environment)) { $this->layout->subtitle = $this->view->environment; } else { @@ -98,8 +104,17 @@ class ProjectController extends PHPCensor\Controller } /** - * Create a new pending build for a project. - */ + * Create a new pending build for a project. + * + * @param integer $projectId + * @param string $type Build type: 'environment'|'branch' + * @param string $id Build type id: environment name or branch name + * + * @throws NotFoundException + * + * @return b8\Http\Response\RedirectResponse + * + */ public function build($projectId, $type = null, $id = null) { /* @var \PHPCensor\Model\Project $project */ diff --git a/src/PHPCensor/View/Project/view.phtml b/src/PHPCensor/View/Project/view.phtml index 34cdd7e0..384e8144 100644 --- a/src/PHPCensor/View/Project/view.phtml +++ b/src/PHPCensor/View/Project/view.phtml @@ -1,13 +1,13 @@
- + @@ -17,85 +17,57 @@
getArchived()): ?> - User()->getIsAdmin()): ?> -
- - - -
+ User()->getIsAdmin()): ?> + + + + + + + + + + + + + -
- - - -
+ + + + + + + + + + + + + -
+
@@ -268,7 +240,7 @@
-
getSshPublicKey(); ?>
+
getSshPublicKey(); ?>
From 4f86a98b5e320fd8092393e92466e9d1f509a13a Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 9 Apr 2017 22:51:03 +0700 Subject: [PATCH 4/4] Build and Project pages UI fixes --- src/PHPCensor/Languages/lang.en.php | 3 ++- src/PHPCensor/Languages/lang.ru.php | 3 ++- src/PHPCensor/View/Build/view.phtml | 26 +++++++++++--------- src/PHPCensor/View/Project/ajax-builds.phtml | 8 +++--- src/PHPCensor/View/Project/view.phtml | 4 +-- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/PHPCensor/Languages/lang.en.php b/src/PHPCensor/Languages/lang.en.php index 86a85d74..31b229c3 100644 --- a/src/PHPCensor/Languages/lang.en.php +++ b/src/PHPCensor/Languages/lang.en.php @@ -331,7 +331,8 @@ PHP Censor', 'build_details' => 'Build Details', 'commit_details' => 'Commit Details', - 'committer' => 'Committer', + 'committer' => 'Committer', + 'commit_message' => 'Commit Message', 'timing' => 'Timing', 'created' => 'Created', 'started' => 'Started', diff --git a/src/PHPCensor/Languages/lang.ru.php b/src/PHPCensor/Languages/lang.ru.php index 9a113cdb..8a06099e 100644 --- a/src/PHPCensor/Languages/lang.ru.php +++ b/src/PHPCensor/Languages/lang.ru.php @@ -319,8 +319,9 @@ PHP Censor', 'severity' => 'Важность', 'build_details' => 'Информация о сборке', - 'commit_details' => 'Информация о коммита', + 'commit_details' => 'Информация о коммитe', 'committer' => 'Автор коммита', + 'commit_message' => 'Сообщение в коммите', 'timing' => 'Тайминг', 'created' => 'Создана', 'started' => 'Началась', diff --git a/src/PHPCensor/View/Build/view.phtml b/src/PHPCensor/View/Build/view.phtml index 2978398d..75600153 100644 --- a/src/PHPCensor/View/Build/view.phtml +++ b/src/PHPCensor/View/Build/view.phtml @@ -21,10 +21,22 @@ + + + + + getBranch(); ?> + + + + - getEnvironment(); ?> + getEnvironment(); + echo !empty($environment) ? ('' . $environment . '') : '—' ; + ?> @@ -59,15 +71,6 @@
- - - - - - + diff --git a/src/PHPCensor/View/Project/ajax-builds.phtml b/src/PHPCensor/View/Project/ajax-builds.phtml index 8e1f7639..4b800e49 100644 --- a/src/PHPCensor/View/Project/ajax-builds.phtml +++ b/src/PHPCensor/View/Project/ajax-builds.phtml @@ -41,6 +41,7 @@ $branches = $build->getExtra('branches'); ?> + - - + - - +
- - getBranch(); ?> - -
@@ -85,7 +88,8 @@
+ getCommitMessage(); ?>
#getId(), 6, '0', STR_PAD_LEFT); ?> getCreated()->format('Y-m-d H:i:s'); ?> getEnvironment(); ?> getBranch(); ?> - + getEnvironment(); + echo !empty($environment) ? $environment : '—' ; + ?> getDuration(); ?> diff --git a/src/PHPCensor/View/Project/view.phtml b/src/PHPCensor/View/Project/view.phtml index 384e8144..2f6a8419 100644 --- a/src/PHPCensor/View/Project/view.phtml +++ b/src/PHPCensor/View/Project/view.phtml @@ -97,11 +97,11 @@