diff --git a/public/assets/js/app.js b/public/assets/js/app.js index a8494272..6755ff40 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -3,17 +3,7 @@ var PHPCensor = { intervals: {}, init: function () { - // Setup the date locale - moment.locale(LANGUAGE); - $(document).ready(function () { - // Format datetimes - $('time[datetime]').each(function() { - var thisDate = $(this).attr('datetime'); - var formattedDate = moment(thisDate).format($(this).data('format') || 'lll'); - $(this).text(formattedDate); - }); - // Update latest builds every 5 seconds: PHPCensor.getBuilds(); PHPCensor.intervals.getBuilds = setInterval(PHPCensor.getBuilds, 5000); @@ -27,8 +17,6 @@ var PHPCensor = { PHPCensor.intervals.getDashboard = setInterval(PHPCensor.getDashboard, 10000); PHPCensor.intervals.getTimeline = setInterval(PHPCensor.getTimeline, 10000); } - - PHPCensor.uiUpdated(); }); $(window).on('builds-updated', function (e, data) { @@ -123,7 +111,6 @@ var PHPCensor = { success: function (data) { success(); - PHPCensor.uiUpdated(); }, error: PHPCensor.handleFailedAjax @@ -134,28 +121,6 @@ var PHPCensor = { if (xhr.status == 401) { window.location.href = window.APP_URL + 'session/login'; } - }, - - uiUpdated: function () { - $('.duration').each(function () { - var seconds = $(this).data('duration'); - - if (seconds == 0) { - return; - } - - $(this).text(moment.duration(seconds, 'seconds').humanize()); - }); - - $('.datetime').each(function () { - var dateString = $(this).data('date'); - - if (!dateString) { - return; - } - - $(this).text(moment(dateString).format('lll')); - }); } }; @@ -506,5 +471,3 @@ var Lang = { return string; } }; - -moment.locale(LANGUAGE); diff --git a/public/assets/js/build-plugins/codeception.js b/public/assets/js/build-plugins/codeception.js index 01343f2b..67ec8846 100644 --- a/public/assets/js/build-plugins/codeception.js +++ b/public/assets/js/build-plugins/codeception.js @@ -1,6 +1,6 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({ id: 'build-codeception-errors', - css: 'col-lg-12 col-md-12 col-sm-12 col-xs-12', + css: 'col-xs-12', title: Lang.get('codeception'), lastData: null, lastMeta: null, diff --git a/public/assets/js/build-plugins/phpspec.js b/public/assets/js/build-plugins/phpspec.js index da1f494b..e694d280 100644 --- a/public/assets/js/build-plugins/phpspec.js +++ b/public/assets/js/build-plugins/phpspec.js @@ -1,6 +1,6 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({ id: 'build-phpspec-errors', - css: 'col-lg-12 col-md-12 col-sm-12 col-xs-12', + css: 'col-xs-12', title: Lang.get('phpspec'), lastData: null, displayOnUpdate: false, diff --git a/public/assets/js/build-plugins/phptallint.js b/public/assets/js/build-plugins/phptallint.js index fe549b99..891f84fc 100644 --- a/public/assets/js/build-plugins/phptallint.js +++ b/public/assets/js/build-plugins/phptallint.js @@ -1,6 +1,6 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({ id: 'build-phptal', - css: 'col-lg-6 col-md-12 col-sm-12 col-xs-12', + css: 'col-xs-12', title: 'PHPTAL Lint', lastData: null, box: true, @@ -25,9 +25,9 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({ return $('
' + '' + '' + - ' ' + - ' ' + - ' ' + + ' ' + + ' ' + + ' ' + '' + '
FileLineMessage' + Lang.get('file') + '' + Lang.get('line') + '' + Lang.get('message') + '
'); }, diff --git a/public/assets/js/build.js b/public/assets/js/build.js index bb8a96ac..74d84da1 100644 --- a/public/assets/js/build.js +++ b/public/assets/js/build.js @@ -65,8 +65,6 @@ var Build = Class.extend({ } } - - PHPCensor.uiUpdated(); }); }, @@ -179,7 +177,7 @@ var Build = Class.extend({ UiPlugin: Class.extend({ id: null, - css: 'col-lg-4 col-md-6 col-sm-12 col-xs-12', + css: 'col-xs-12', box: false, init: function(){ diff --git a/src/PHPCensor/Controller/BuildController.php b/src/PHPCensor/Controller/BuildController.php index 714e60c7..4ab541b9 100644 --- a/src/PHPCensor/Controller/BuildController.php +++ b/src/PHPCensor/Controller/BuildController.php @@ -237,10 +237,12 @@ class BuildController extends Controller if (!$build) { $response->setResponseCode(404); $response->setContent([]); + return $response; } $response->setContent($this->getBuildData($build)); + return $response; } @@ -257,6 +259,7 @@ class BuildController extends Controller $response = new JsonResponse(); $response->setContent($data); + return $response; } diff --git a/src/PHPCensor/Helper/Lang.php b/src/PHPCensor/Helper/Lang.php index edbbe156..d5fdedeb 100644 --- a/src/PHPCensor/Helper/Lang.php +++ b/src/PHPCensor/Helper/Lang.php @@ -194,24 +194,4 @@ class Lang } } } - - /** - * Create a time tag for localization. - * - * See http://momentjs.com/docs/#/displaying/format/ for a list of supported formats. - * - * @param \DateTime $dateTime The dateTime to represent. - * @param string $format The moment.js format to use. - * - * @return string The formatted tag. - */ - public static function formatDateTime(\DateTime $dateTime, $format = 'lll') - { - return sprintf( - '', - $dateTime->format(\DateTime::ISO8601), - $format, - $dateTime->format(\DateTime::RFC2822) - ); - } } diff --git a/src/PHPCensor/Languages/lang.en.php b/src/PHPCensor/Languages/lang.en.php index 37593991..1f9a6f0c 100644 --- a/src/PHPCensor/Languages/lang.en.php +++ b/src/PHPCensor/Languages/lang.en.php @@ -213,7 +213,8 @@ PHP Censor', 'codeception_time' => 'Time', 'codeception_synopsis' => '%1$d tests carried out in %2$f seconds. %3$d failures.', - + 'suite' => 'Suite', + 'test' => 'Test', 'file' => 'File', 'line' => 'Line', 'class' => 'Class', diff --git a/src/PHPCensor/Languages/lang.ru.php b/src/PHPCensor/Languages/lang.ru.php index e124b3bd..0c7c7417 100644 --- a/src/PHPCensor/Languages/lang.ru.php +++ b/src/PHPCensor/Languages/lang.ru.php @@ -204,6 +204,8 @@ PHP Censor', 'codeception_time' => 'Время', 'codeception_synopsis' => 'Тестов выполнено: %1$d (за %2$f сек.). Провалов: %3$d.', + 'suite' => 'Набор', + 'test' => 'Тест', 'file' => 'Файл', 'line' => 'Строка', 'class' => 'Класс', diff --git a/src/PHPCensor/View/Build/view.phtml b/src/PHPCensor/View/Build/view.phtml index ae311f2f..8f048f3b 100644 --- a/src/PHPCensor/View/Build/view.phtml +++ b/src/PHPCensor/View/Build/view.phtml @@ -32,8 +32,8 @@ - - + + getDuration(); ?> @@ -89,20 +89,22 @@ - - -
+ + getCreated() ? $build->getCreated()->format('Y-m-d H:i:s') : ''; ?>
+ + getStarted() ? $build->getStarted()->format('Y-m-d H:i:s') : ''; ?>
- + + getFinished() ? $build->getFinished()->format('Y-m-d H:i:s') : ''; ?>
@@ -170,7 +172,7 @@ ' . PHP_EOL; + print '' . PHP_EOL; } ?> diff --git a/src/PHPCensor/View/BuildStatus/view.phtml b/src/PHPCensor/View/BuildStatus/view.phtml index ce06395a..c1f670c4 100644 --- a/src/PHPCensor/View/BuildStatus/view.phtml +++ b/src/PHPCensor/View/BuildStatus/view.phtml @@ -18,7 +18,6 @@ - diff --git a/src/PHPCensor/View/Home/ajax-dashboard-project.phtml b/src/PHPCensor/View/Home/ajax-dashboard-project.phtml index 61bf3416..cc33aedc 100644 --- a/src/PHPCensor/View/Home/ajax-dashboard-project.phtml +++ b/src/PHPCensor/View/Home/ajax-dashboard-project.phtml @@ -39,12 +39,12 @@ if (count($builds)) { break; case 2: $statuses[] = 'ok'; - $success = is_null($success) && !is_null($build->getFinished()) ? Lang::formatDateTime($build->getFinished()) : $success; + $success = is_null($success) && !is_null($build->getFinished()) ? $build->getFinished()->format('Y-m-d H:i:s') : $success; break; case 3: $failures++; $statuses[] = 'failed'; - $failure = is_null($failure) && !is_null($build->getFinished()) ? Lang::formatDateTime($build->getFinished()) : $failure; + $failure = is_null($failure) && !is_null($build->getFinished()) ? $build->getFinished()->format('Y-m-d H:i:s') : $failure; break; } } @@ -62,7 +62,7 @@ if ($buildCount > 0) { $message = Lang::get('x_of_x_failed', $failures, $buildCount); if (!is_null($lastSuccess) && !is_null($lastSuccess->getFinished())) { - $message .= Lang::get('last_successful_build', Lang::formatDateTime($lastSuccess->getFinished())); + $message .= Lang::get('last_successful_build', $lastSuccess->getFinished()->format('Y-m-d H:i:s')); } else { $message .= Lang::get('never_built_successfully'); } @@ -71,7 +71,7 @@ if ($buildCount > 0) { $shortMessage = Lang::get('all_builds_passed_short', $buildCount, $buildCount); if (!is_null($lastFailure) && !is_null($lastFailure->getFinished())) { - $message .= Lang::get('last_failed_build', Lang::formatDateTime($lastFailure->getFinished())); + $message .= Lang::get('last_failed_build', $lastFailure->getFinished()->format('Y-m-d H:i:s')); } else { $message .= Lang::get('never_failed_build'); } diff --git a/src/PHPCensor/View/Home/ajax-timeline.phtml b/src/PHPCensor/View/Home/ajax-timeline.phtml index 94dce271..4d6f9a03 100644 --- a/src/PHPCensor/View/Home/ajax-timeline.phtml +++ b/src/PHPCensor/View/Home/ajax-timeline.phtml @@ -38,7 +38,7 @@ ?>
  • - + format('Y-m-d'); ?>
  • @@ -48,7 +48,7 @@
  • - + format('H:i:s'); ?>

    getProject()->getTitle(); ?> diff --git a/src/PHPCensor/View/Home/dashboard-projects.phtml b/src/PHPCensor/View/Home/dashboard-projects.phtml index ac4c792c..25373b38 100644 --- a/src/PHPCensor/View/Home/dashboard-projects.phtml +++ b/src/PHPCensor/View/Home/dashboard-projects.phtml @@ -40,12 +40,12 @@ foreach($projects as $project): break; case 2: $statuses[] = 'ok'; - $success = is_null($success) && !is_null($build->getFinished()) ? Lang::formatDateTime($build->getFinished()) : $success; + $success = is_null($success) && !is_null($build->getFinished()) ? $build->getFinished()->format('Y-m-d H:i:s') : $success; break; case 3: $failures++; $statuses[] = 'failed'; - $failure = is_null($failure) && !is_null($build->getFinished()) ? Lang::formatDateTime($build->getFinished()) : $failure; + $failure = is_null($failure) && !is_null($build->getFinished()) ? $build->getFinished()->format('Y-m-d H:i:s') : $failure; break; } } @@ -63,7 +63,7 @@ foreach($projects as $project): $message = Lang::get('x_of_x_failed', $failures, $buildCount); if (!is_null($lastSuccess) && !is_null($lastSuccess->getFinished())) { - $message .= Lang::get('last_successful_build', Lang::formatDateTime($lastSuccess->getFinished())); + $message .= Lang::get('last_successful_build', $lastSuccess->getFinished()->format('Y-m-d H:i:s')); } else { $message .= Lang::get('never_built_successfully'); } @@ -72,7 +72,7 @@ foreach($projects as $project): $shortMessage = Lang::get('all_builds_passed_short', $buildCount, $buildCount); if (!is_null($lastFailure) && !is_null($lastFailure->getFinished())) { - $message .= Lang::get('last_failed_build', Lang::formatDateTime($lastFailure->getFinished())); + $message .= Lang::get('last_failed_build', $lastFailure->getFinished()->format('Y-m-d H:i:s')); } else { $message .= Lang::get('never_failed_build'); } diff --git a/src/PHPCensor/View/Home/index.phtml b/src/PHPCensor/View/Home/index.phtml index 98c75ea4..fe5ad109 100644 --- a/src/PHPCensor/View/Home/index.phtml +++ b/src/PHPCensor/View/Home/index.phtml @@ -64,7 +64,7 @@ ?>
  • - + format('Y-m-d'); ?>
  • @@ -74,7 +74,7 @@