diff --git a/Gemfile b/Gemfile index f231818ed..dc67bb74e 100644 --- a/Gemfile +++ b/Gemfile @@ -31,8 +31,6 @@ gem 'sprockets' gem 'will_paginate' gem 'meta-tags', require: 'meta_tags' gem 'haml-rails' -gem 'jquery-rails' -gem 'jquery-migrate-rails' gem 'ruby-haml-js' gem 'slim' gem 'simple_form', '3.1.0.rc2' @@ -45,27 +43,21 @@ gem 'ohm-expire', '~> 0.1.3' gem 'pygments.rb' -gem 'ffi' - gem 'attr_encrypted' # AngularJS related stuff +gem 'angular-rails-templates' gem 'underscore-rails' -gem 'angularjs-rails', '~> 1.3.14' gem 'ng-rails-csrf' -gem 'momentjs-rails' gem 'angular-i18n' gem 'js-routes' gem 'soundmanager-rails' -gem 'angular-ui-bootstrap-rails' -gem 'angular-rails-templates' gem 'ngmin-rails' gem 'time_diff' gem 'sass-rails' gem 'coffee-rails' -gem 'bootstrap-sass' gem 'font-awesome-rails' gem 'compass-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 34ab1c311..bf47c4507 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,16 +76,11 @@ GEM railties (>= 3.1) sprockets (~> 2) tilt - angular-ui-bootstrap-rails (0.13.0) - angularjs-rails (1.3.14) arbre (1.0.3) activesupport (>= 3.0.0) arel (6.0.0) attr_encrypted (1.3.4) encryptor (>= 1.3.0) - autoprefixer-rails (5.2.0) - execjs - json bcrypt (3.1.10) better_errors (2.1.1) coderay (>= 1.0.0) @@ -93,9 +88,6 @@ GEM rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-sass (3.3.4.1) - autoprefixer-rails (>= 5.0.0.1) - sass (>= 3.2.19) bourbon (4.2.3) sass (~> 3.4) thor @@ -208,7 +200,6 @@ GEM jbuilder (2.2.16) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) - jquery-migrate-rails (1.2.1) jquery-rails (4.0.4) rails-dom-testing (~> 1.0) railties (>= 4.2.0) @@ -257,8 +248,6 @@ GEM modware (0.1.2) its-it key_struct (~> 0.4) - momentjs-rails (2.10.2) - railties (>= 3.1) mono_logger (1.1.0) multi_json (1.11.1) multipart-post (2.0.0) @@ -581,12 +570,9 @@ DEPENDENCIES ancestry angular-i18n angular-rails-templates - angular-ui-bootstrap-rails - angularjs-rails (~> 1.3.14) attr_encrypted better_errors binding_of_caller - bootstrap-sass cape capistrano capistrano_colors @@ -596,22 +582,18 @@ DEPENDENCIES devise factory_girl_rails faraday-http-cache - ffi font-awesome-rails friendly_id haml-rails highline (~> 1.6.20) hirb jbuilder - jquery-migrate-rails - jquery-rails js-routes localeapp mailcatcher meta-tags meta_request mock_redis - momentjs-rails newrelic_rpm ng-rails-csrf ngmin-rails diff --git a/app/assets/images/logo-mini.png b/app/assets/images/logo-mini.png index 3175f3b21..17ad15904 100644 Binary files a/app/assets/images/logo-mini.png and b/app/assets/images/logo-mini.png differ diff --git a/app/assets/javascripts/angularjs/a_config.js.erb b/app/assets/javascripts/angularjs/a_config.js.erb index 19c3552a2..d6b6b3a5b 100644 --- a/app/assets/javascripts/angularjs/a_config.js.erb +++ b/app/assets/javascripts/angularjs/a_config.js.erb @@ -1,6 +1,5 @@ -var RosaABF = angular.module('RosaABF', ['ui.bootstrap', 'angular-i18n', 'angularMoment', - 'chieffancypants.loadingBar', 'ngSanitize', 'templates', - 'ngResource', 'ng-rails-csrf', 'ngCookies']); +var RosaABF = angular.module('RosaABF', ['ui.bootstrap', 'angular-i18n', 'angularMoment', 'templates', + 'ngResource', 'ng-rails-csrf', 'ngCookies', 'ngSanitize']); RosaABF.factory('LocalesHelper', ['$locale', function($locale) { var locales = { @@ -14,15 +13,14 @@ RosaABF.factory('LocalesHelper', ['$locale', function($locale) { } }]); -RosaABF.config(function(cfpLoadingBarProvider) { - cfpLoadingBarProvider.includeSpinner = false; -}); +RosaABF.config(['$compileProvider', function ($compileProvider) { + $compileProvider.debugInfoEnabled(false); +}]); var SoundNotificationsHelper = function() { var isOn = true; var statusChangedSound = null; soundManager.setup({ - // url: '/assets/swf/', preferFlash: false, onready: function() { statusChangedSound = soundManager.createSound({url: "<%=asset_path('garbage_shattering.wav')%>"}); diff --git a/app/assets/javascripts/angularjs/angular-templates.js b/app/assets/javascripts/angularjs/angular-templates.js new file mode 100644 index 000000000..03202fce1 --- /dev/null +++ b/app/assets/javascripts/angularjs/angular-templates.js @@ -0,0 +1,190 @@ +angular.module("u2i.bootstrap.tpls", ["uib/template/tabs/tab.html", "uib/template/tabs/tabset.html", "uib/template/typeahead/typeahead-match.html", + "uib/template/typeahead/typeahead-popup.html", "uib/template/pagination/pager.html", + "uib/template/pagination/pagination.html", "uib/template/datepicker/datepicker.html", + "uib/template/datepicker/popup.html", "uib/template/datepicker/year.html", + "uib/template/datepicker/month.html", "uib/template/datepicker/day.html"]); + +angular.module("uib/template/tabs/tab.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/tabs/tab.html", + "
  • \n" + + " {{heading}}\n" + + "
  • \n" + + ""); +}]); + +angular.module("uib/template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/tabs/tabset.html", + "
    \n" + + " \n" + + "
    \n" + + "
    \n" + + "
    \n" + + "
    \n" + + "
    \n" + + ""); +}]); + +angular.module("uib/template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/typeahead/typeahead-match.html", + "\n" + + ""); +}]); + +angular.module("uib/template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/typeahead/typeahead-popup.html", + "\n" + + ""); +}]); + +angular.module("uib/template/pagination/pager.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/pagination/pager.html", + "\n" + + ""); +}]); + +angular.module("uib/template/pagination/pagination.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/pagination/pagination.html", + "\n" + + ""); +}]); + +angular.module("uib/template/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/datepicker.html", + "
    \n" + + " \n" + + " \n" + + " \n" + + "
    \n" + + ""); +}]); + +angular.module("uib/template/datepicker/day.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/day.html", + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
    {{::label.abbr}}
    {{ weekNumbers[$index] }}\n" + + " \n" + + "
    \n" + + ""); +}]); + +angular.module("uib/template/datepicker/month.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/month.html", + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
    \n" + + " \n" + + "
    \n" + + ""); +}]); + +angular.module("uib/template/datepicker/popup.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/popup.html", + "
    \n" + + " \n" + + "
    \n" + + ""); +}]); + +angular.module("uib/template/datepicker/year.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/year.html", + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
    \n" + + " \n" + + "
    \n" + + ""); +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb index 6ce776bca..cc9ff3899 100644 --- a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb +++ b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb @@ -1,188 +1,126 @@ -RosaABF.controller('BuildListsController', - ['$scope', '$http', '$location', '$timeout', '$cookies', - function($scope, $http, $location, $timeout, $cookies) { +RosaABF.controller('BuildListsController', ['$scope', 'BuildListsService', '$location', '$interval', '$uibModal', 'ProjectSelectService', +function($scope, BuildListsService, $location, $interval, $uibModal, ProjectSelectService) { + $scope.params = null; + $scope.build_lists = []; + $scope.isRequest = false; // Disable 'Search' button + $scope.opened = {}; + $scope.ProjectSelectService = ProjectSelectService; - $scope.params = null; - $scope.first_run = true; - $scope.server_status = null; - $scope.build_lists = []; - $scope.isRequest = false; // Disable 'Search' button - $scope.pages = []; - $scope.opened = {}; + var refresh, is_autoreload_on; + var default_filters = {page: '1', per_page: '25', 'ownership': 'owned'}; - $scope.map_priorities = { - <%=BuildList::WAITING_FOR_RESPONSE%>: 13, - <%=BuildList::BUILD_PENDING%>: 12, - <%=BuildList::RERUN_TESTS%>: 11, - <%=BuildList::BUILD_CANCELING%>: 10, - <%=BuildList::BUILD_CANCELED%>: 9, - <%=BuildList::BUILD_STARTED%>: 8, - <%=BuildList::RERUNNING_TESTS%>: 7, - <%=BuildList::BUILD_PUBLISH%>: 6, - <%=BuildList::BUILD_PUBLISHED%>: 5, - <%=BuildList::BUILD_ERROR%>: 4, - <%=BuildList::SUCCESS%>: 3, - <%=BuildList::TESTS_FAILED%>: 2, - <%=BuildList::FAILED_PUBLISH%>: 1, - <%=BuildList::REJECTED_PUBLISH%>: 0 - }; - - $scope.clear = function () { - //$scope.dt = null; - $scope.params = { page: '1', - per_page: '25', - filter: { ownership: 'owned' } - }; - }; - - $scope.init = function init() { - $scope.name_with_owner = $('#name_with_owner').val(); - if ($scope.name_with_owner) { - $scope.build_lists_path = Routes.project_build_lists_path($scope.name_with_owner, {format: 'json'}); + $scope.setAutoreload = function(autoreload) { + is_autoreload_on = autoreload; + if(autoreload) { + if(refresh) { + $interval.cancel(refresh); + } + refresh = $interval($scope.getBuildLists, 60000); } - else { - $scope.build_lists_path = Routes.build_lists_path({format: 'json'}); + else if(!autoreload && refresh) { + $interval.cancel(refresh); + refresh = null; } - - //$scope.isOpenServerStatus = $cookies.isOpenServerStatus === 'true' ? true : false; - $scope.isOpenFilters = $cookies.isOpenFilters === 'true' ? true : false; - }; - - // $scope.$watch('isOpenServerStatus', function(){ - // $cookies.isOpenServerStatus = $scope.isOpenServerStatus.toString(); - // }, true); - - $scope.$watch('isOpenFilters', function(){ - $cookies.isOpenFilters = $scope.isOpenFilters.toString(); - }, true); - - $scope.getBuildLists = function() { - if ( $scope.isRequest) { - return; - } - // Disable 'Search' button - $scope.isRequest = true; - - - $http.get($scope.build_lists_path, {params: $location.search()}).success(function(results) { - // Render Server status - $scope.$parent.server_status = results.server_status; - - // TMP fields - var dictionary = results.dictionary; - var build_lists = []; - var groups = {}; - - var to_open = []; - // Grouping of build_lists - _.each(results.build_lists, function(r){ - var bl = new BuildList(r, dictionary); - var key = bl.project_id + '-'; - key += bl.group_id ? bl.group_id : (bl.commit_hash + '-' + bl.user_id); - if (groups[key]) { - groups[key].addRelated(bl); - } else { - groups[key] = bl; - build_lists.push(bl); - if ( bl.id in $scope.opened ) { to_open.push(bl); } - } - }); - - // Adds all build_lists into the table (group by group) - $scope.build_lists = []; - $scope.opened = {}; - _.each(build_lists, function(bl){ - if (bl.related.length > 1) { - var sorted_build_lists = _.sortBy(bl.related, function(b) { return $scope.map_priorities[b.status]; }); - bl.clearRelated(); - var first_in_group = sorted_build_lists[0]; - first_in_group.clearRelated(); - _.each(sorted_build_lists, function(b){ - if (b != first_in_group) { first_in_group.addRelated(b); } - $scope.build_lists.push(b); - }); - } else { - $scope.build_lists.push(bl); - } - }); - // Shows groups which have been opened before - _.each(to_open, function(bl){ $scope.showRelated(bl, true); }); - - // Render pagination - $scope.page = results.page; - $scope.total_items = results.total_items; - - // Enable 'Search' button - $scope.isRequest = false; - }).error(function(data, status, headers, config) { - // Enable 'Search' button - $scope.isRequest = false; - });; - $scope.first_run = false; } - $scope.showRelated = function(build_list, disable_effect) { + $scope.getBuildLists = function() { + if ($scope.isRequest) { + return; + } + + ProjectSelectService.disable_bl = true; + $scope.isRequest = true; + + if(ProjectSelectService.project) { + var project = ProjectSelectService.project; + } + + var filter = Object.assign(Object.create(null), default_filters, $location.search()); + var fixed_filter = Object.create(null); + _.map(filter, function(val, key) { + if(key != "page" && key != "per_page") { + fixed_filter['filter[' + key + ']'] = val; + } + else { + fixed_filter[key] = val; + } + }); + + BuildListsService.getBuildLists(fixed_filter, project).then(function(res) { + _.each(res.build_lists, function(item) { + if(item.hasRelated) { + var chevronHtml = ""; + _.each(item.related, function(rel) { + chevronHtml += "
     
    "; + }); + item.chevronHtml = chevronHtml; + } + if(item.id in $scope.opened) { + $scope.showRelated(item); + } + }); + + $scope.build_lists = res.build_lists; + $scope.page = res.page; + $scope.total_items = res.total_items; + $location.search(Object.assign(filter, res.filter)); + $scope.per_page = filter.per_page; + $scope.isRequest = false; + ProjectSelectService.disable_bl = false; + ProjectSelectService.load_project_info = ProjectSelectService.project; + }); + } + + $scope.clearProject = function() { + ProjectSelectService.project = ""; + } + + $scope.showRelated = function(build_list) { build_list.relatedHidden = false; + $scope.opened[build_list.id] = true; _.each(build_list.related, function(bl){ bl.show = true; - $scope.opened[bl.id] = true; - // Waits for render of build_lists - if (!disable_effect) - $timeout(function() { - var tmp = $('#build-list-' + bl.id + ' td'); - $('#build-list-' + bl.id + ' td').effect('highlight', {}, 1000); - }, 100); }); } $scope.hideRelated = function(build_list) { build_list.relatedHidden = true; + delete $scope.opened[build_list.id]; _.each(build_list.related, function(bl){ bl.show = false; - delete $scope.opened[bl.id]; }); build_list.show = true; } - $scope.cancelRefresh = null; - $scope.refresh = function(force) { - if ($('#autoreload').is(':checked') || force) { - var params = {}; + $scope.openFilters = function() { + var turn_back_on = is_autoreload_on; + $scope.setAutoreload(false); - _.each($("#monitoring_filter").serializeArray(), function(a){ - if (a.value) { params[a.name] = a.value; } - }); - $location.search(params); - $scope.getBuildLists(); - } - if (!force) - $scope.cancelRefresh = $timeout($scope.refresh, 60000); - } - - - $scope.$on('$locationChangeSuccess', function(event) { - $scope.updateParams(); - if (!$scope.first_run) { $scope.getBuildLists(); } - }); - - $scope.updateParams = function() { - var params = $location.search(); - - $scope.params = { - page: params.page || 1, - per_page: params.per_page || 25, - filter: { - ownership: params['filter[ownership]'] || 'owned', - status: params['filter[status]'], - save_to_platform_id: params['filter[save_to_platform_id]'], - arch_id: params['filter[arch_id]'], - mass_build_id: params['filter[mass_build_id]'], - updated_at_start: params['filter[updated_at_start]'], - updated_at_end: params['filter[updated_at_end]'], - project_name: params['filter[project_name]'], - id: params['filter[id]'] + var FilterModalInstance = $uibModal.open({ + animation: $scope.animationsEnabled, + templateUrl: 'build_list_filters.html', + controller: 'FiltersInstanceController', + size: 'lg', + resolve: { + params: function() { + return $location.search(); + } } - } + }); + + FilterModalInstance.result.then(function(ret) { + $location.search(ret); + + $scope.getBuildLists(); + }, function(reason) { + if(reason == 'reset') { + $location.search(default_filters); + + $scope.getBuildLists(); + } + }).finally(function() { + $scope.setAutoreload(turn_back_on); + }); } $scope.goToPage = function(number) { @@ -190,7 +128,41 @@ RosaABF.controller('BuildListsController', $scope.getBuildLists(); } - $scope.updateParams(); - // Waits for render of filters - $timeout($scope.refresh, 100); + $scope.setAutoreload(true); + + var project_hash = $location.search(); + if(project_hash['project']) { + ProjectSelectService.project = project_hash['project']; + $location.search('project', null); + } + + $scope.$watch(function() { + return ProjectSelectService.project; + }, function() { + var turn_back_on = is_autoreload_on; + if(ProjectSelectService.project) { + $scope.widget_title = " | " + ProjectSelectService.project; + } + else { + $scope.widget_title = ""; + } + $scope.setAutoreload(false); + $scope.getBuildLists(); + $scope.setAutoreload(turn_back_on); + }); + }]); + +RosaABF.controller('FiltersInstanceController', ['$scope', '$uibModalInstance', 'params', +function($scope, $uibModalInstance, params) { + console.log(params); + $scope.params = params; + + $scope.apply = function() { + $uibModalInstance.close($scope.params); + } + + $scope.reset = function() { + $uibModalInstance.dismiss('reset'); + } +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee b/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee index 7335c76ae..55219dbdf 100644 --- a/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee +++ b/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee @@ -1,4 +1,4 @@ -RosaABF.controller 'BuildLogController', ['$scope', '$http', '$timeout', ($scope, $http, $timeout) -> +RosaABF.controller 'BuildLogController', ['$scope', '$http', '$timeout', '$sanitize', ($scope, $http, $timeout, $sanitize) -> $scope.path = null $scope.log = null diff --git a/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee b/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee index bf2c88515..afa769379 100644 --- a/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee +++ b/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee @@ -144,33 +144,6 @@ NewBuildListController = (dataservice, $http) -> vm.selected_extra_build_list = null false - vm.updateFilterOwner = -> - vm.last_build_lists_filter.owner = !vm.last_build_lists_filter.owner; - updateLastBuilds() - - vm.updateFilterStatus = -> - vm.last_build_lists_filter.status = !vm.last_build_lists_filter.status; - updateLastBuilds() - - updateLastBuilds = -> - path = Routes.list_project_build_lists_path( - { - name_with_owner: vm.name_with_owner, - page: vm.last_build_lists_filter.page - owner_filter: vm.last_build_lists_filter.owner - status_filter: vm.last_build_lists_filter.status - } - ) - - $http.get(path).then (response) -> - vm.last_build_lists = response.data.build_lists - vm.total_items = response.data.total_items - false - - vm.goToPage = (page) -> - vm.last_build_lists_filter.page = page - updateLastBuilds() - vm.cloneBuildList = (id) -> path = Routes.new_project_build_list_path( { @@ -213,11 +186,6 @@ NewBuildListController = (dataservice, $http) -> vm.hidePlatform = (platform) -> vm.is_build_for_main_platform and platform.id isnt vm.build_for_platform_id - if !vm.last_build_lists - vm.last_build_lists = [] - vm.last_build_lists_filter = { owner: true, status: true, page: 1 } - updateLastBuilds() - init(dataservice) vm.selectSaveToRepository() if !dataservice.build_list_id return true diff --git a/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee b/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee deleted file mode 100644 index d35a4a102..000000000 --- a/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee +++ /dev/null @@ -1,132 +0,0 @@ -ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityFilter) -> - - calculateChangeDate = (feed)-> - prev_date = null - _.each(feed, (event)-> - cur_date = $filter('amDateFormat')(event.date, 'll') - event.is_date_changed = cur_date isnt prev_date - prev_date = cur_date - ) - - $scope.$watch (-> - vm.current_activity_tab.owner_uname_filter_tmp - ), () -> - vm.selectOwnerFilter({uname: null}, null, null) unless vm.current_activity_tab.owner_uname_filter_tmp - - $scope.$watch (-> - vm.current_activity_tab.project_name_filter_tmp - ), () -> - vm.selectProjectNameFilter({name: null}, null, null) unless vm.current_activity_tab.project_name_filter_tmp - - - vm = this - - vm.processing = false - vm.activity_tab = - filter: 'build' - build: {} - owner_filter: null - project_name_filter: null - owner_uname_filter_tmp: null - project_name_filter_tmp: null - - vm.own_activity_tab = $.extend({}, vm.activity_tab) - vm.current_activity_tab = vm.activity_tab - - vm.init = (active_tab)-> - switch active_tab - when 'activity' - vm.activity_tab.active = true - vm.current_activity_tab = vm.activity_tab - when 'own_activity' - vm.own_activity_tab.active = true - vm.current_activity_tab = vm.own_activity_tab - true - - vm.getContent = (tab)-> - switch tab - when 'activity' - vm.activity_tab.active = true - vm.own_activity_tab.active = false - vm.current_activity_tab = vm.activity_tab - vm.getActivityContent() - if $location.path() isnt '/' - $location.path('/').replace() - - when 'own_activity' - vm.activity_tab.active = false - vm.own_activity_tab.active = true - vm.current_activity_tab = vm.own_activity_tab - vm.getActivityContent() - if $location.path() isnt '/own_activity' - $location.path('/own_activity').replace() - - vm.getTimeLinefaClass = (content)-> - template = switch content.kind - when 'build_list_notification' then 'btn-success fa-gear' - else 'btn-warning fa-question' - template - - vm.getCurActivity = ()-> - vm.current_activity_tab[vm.current_activity_tab.filter] - - vm.getTemplate = (content)-> - content.kind + '.html' - - vm.load_more = ()-> - cur_tab = vm.getCurActivity() - path = cur_tab.next_page_link - return unless path - - $http.get(path).then (res)-> - cur_tab.feed.push.apply(cur_tab.feed, res.data.feed) - cur_tab.next_page_link = res.data.next_page_link - - vm.getActivityContent = ()-> - vm.processing = true - options = - owner_filter: vm.current_activity_tab.owner_filter - project_name_filter: vm.current_activity_tab.project_name_filter - format: 'json' - - if vm.activity_tab.active - path = Routes.root_path(options) - else - path = Routes.own_activity_path(options) - - $http.get(path).then (res)-> - feed = res.data.feed - vm.getCurActivity().feed = feed - vm.getCurActivity().next_page_link = res.data.next_page_link - calculateChangeDate(feed) - vm.processing = false - true - - vm.getOwnersList = (value)-> - return [] if value.length < 1 - ActivityFilter.get_owners(value) - - vm.selectOwnerFilter = (item, model, label)-> - return if vm.current_activity_tab.owner_filter is item.uname - - vm.current_activity_tab.owner_filter = item.uname - vm.current_activity_tab.project_name_filter = null - vm.current_activity_tab.project_name_filter_tmp = null - vm.getActivityContent() - true - - vm.getProjectNamesList = (value)-> - return [] if value.length < 1 - ActivityFilter.get_project_names(vm.current_activity_tab.owner_filter, value) - - vm.selectProjectNameFilter = (item, model, label)-> - return if vm.current_activity_tab.project_name_filter is item.name - vm.current_activity_tab.project_name_filter = item.name - vm.getActivityContent() - true - -angular - .module("RosaABF") - .controller "ActivityController", ActivityController - -ActivityController.$inject = ['$scope', '$http', '$timeout', '$q', '$filter', '$location', 'ActivityFilter'] diff --git a/app/assets/javascripts/angularjs/controllers/activity_feed.js b/app/assets/javascripts/angularjs/controllers/activity_feed.js new file mode 100644 index 000000000..7015a9a81 --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/activity_feed.js @@ -0,0 +1,39 @@ +RosaABF.controller('ActivityFeedController', ['$scope', 'ActivityService', 'ProjectSelectService', +function($scope, ActivityService, ProjectSelectService) { + $scope.feed = []; + $scope.next_link_present = false; + $scope.owner_tmp = ""; + $scope.project_tmp = ""; + $scope.no_loading = false; + + var owner_uname, project_name; + + $scope.getFeed = function(options, no_loading) { + if($scope.requesting) { + return; + } + $scope.no_loading = no_loading; + if(ProjectSelectService.project) { + if(!options) { + options = {}; + } + var split = ProjectSelectService.project.split('/'); + options.owner_uname = split[0]; + options.project_name = split[1]; + } + $scope.requesting = true; + ActivityService.getFeed(options).then(function(res) { + $scope.requesting = false; + $scope.next_link_present = res.next_link_present; + $scope.feed = res.feed; + }); + } + + $scope.$watch(function() { + return ProjectSelectService.project; + }, function() { + $scope.getFeed(); + }); + + $scope.getFeed(); +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb b/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb index f2c223a69..abfce6b2c 100644 --- a/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb +++ b/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb @@ -51,11 +51,12 @@ DatePickerController = ($scope, datepickerPopupConfig) -> <% end %> #datepickerPopupConfig.appendToBody = 'true' + return vm + angular .module("RosaABF") .controller "DatePickerController", DatePickerController DatePickerController.$inject = [ '$scope' - 'datepickerPopupConfig' ] diff --git a/app/assets/javascripts/angularjs/controllers/platforms.js b/app/assets/javascripts/angularjs/controllers/platforms.js new file mode 100644 index 000000000..e045c3bb2 --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/platforms.js @@ -0,0 +1,9 @@ +RosaABF.controller('PlatformsController', ['$scope', 'PlatformsService', function($scope, PlatformsService) { + $scope.platforms = null; + + $scope.requesting = true; + PlatformsService.getPlatforms().then(function(platforms) { + $scope.requesting = false; + $scope.platforms = platforms; + }); +}]); diff --git a/app/assets/javascripts/angularjs/controllers/platforms_controller.js b/app/assets/javascripts/angularjs/controllers/platforms_controller.js deleted file mode 100644 index e86a951a6..000000000 --- a/app/assets/javascripts/angularjs/controllers/platforms_controller.js +++ /dev/null @@ -1,20 +0,0 @@ -RosaABF.controller('PlatformsCtrl', ['$scope', '$http', function($scope, $http) { - $scope.total_items = null; - $scope.page = null; - $scope.platforms = null; - - $scope.getPlatforms = function() { - $http.get(Routes.platforms_path({format: 'json', page: $scope.page})).then(function(res) { - $scope.page = res.data.page; - $scope.total_items = res.data.platforms_count; - $scope.platforms = res.data.platforms; - }); - }; - - $scope.goToPage = function(page) { - $scope.page = page; - $scope.getPlatforms(); - }; - - $scope.getPlatforms(); -}]); diff --git a/app/assets/javascripts/angularjs/controllers/project_info_controller.js b/app/assets/javascripts/angularjs/controllers/project_info_controller.js new file mode 100644 index 000000000..34793b1cf --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/project_info_controller.js @@ -0,0 +1,25 @@ +RosaABF.controller('ProjectInfoController', ['$scope', 'ProjectInfoService', 'ProjectSelectService', +function($scope, ProjectInfoService, ProjectSelectService) { + $scope.widget_title = ""; + $scope.$watch(function() { + return ProjectSelectService.load_project_info; + }, function() { + var project = ProjectSelectService.load_project_info; + if(project) { + $scope.requesting = true; + ProjectSelectService.disable_pi = true; + ProjectInfoService.getProjectInfo(project).then(function(res) { + $scope.project = project; + $scope.project_info = res; + $scope.requesting = false; + $scope.widget_title = " | " + project; + ProjectSelectService.disable_pi = false; + }); + } + else { + $scope.project_info = null; + $scope.project = ""; + $scope.widget_title = ""; + } + }); +}]); diff --git a/app/assets/javascripts/angularjs/controllers/projects_controller.js b/app/assets/javascripts/angularjs/controllers/projects_controller.js index 2960f27bd..d6653713b 100644 --- a/app/assets/javascripts/angularjs/controllers/projects_controller.js +++ b/app/assets/javascripts/angularjs/controllers/projects_controller.js @@ -1,73 +1,24 @@ -RosaABF.controller('ProjectsCtrl', ['$scope', '$http', function($scope, $http) { - $scope.total_items = null; - $scope.page = null; - $scope.projects = null; - $scope.filter_users = []; - $scope.filter_groups = []; - // remove_user_project_path(project), method: :delete +RosaABF.controller('ProjectsController', ['$scope', 'ProjectsService', 'ProjectSelectService', +function($scope, ProjectsService, ProjectSelectService) { + $scope.projects = null; + $scope.ProjectSelectService = ProjectSelectService; + $scope.search = ""; - $scope.init = function(total_items, page) { - $scope.total_items = total_items; - $scope.page = page; - }; + var promiseResolve = function(projects) { + $scope.requesting = false; + $scope.projects = projects; + } - $scope.getProjects = function() { - var params = { format: 'json', page: $scope.page, search: $scope.search, - users: $scope.filter_users, groups: $scope.filter_groups }; - $http.get(Routes.projects_path(params)).then(function(res) { - $scope.page = res.data.page; - $scope.total_items = res.data.projects_count; - $scope.projects = res.data.projects; - }); - }; + $scope.searchProjects = function(search) { + $scope.requesting = true; + $scope.search = search; + ProjectsService.getProjects(search).then(promiseResolve); + } - $scope.goToPage = function(page) { - $scope.page = page; - $scope.getProjects(); - }; + $scope.selectProject = function(project) { + ProjectSelectService.project = project; + } - $scope.leave_project = function(project) { - project.can_leave_project = false; - var path = Routes.remove_user_project_path(project.name_with_owner, {format: 'json'}); - $http.delete(path).success(function(res){ - //$scope.getProjects(); - // Find and remove item from an array - var i = $scope.projects.indexOf(project); - if(i != -1) { - $scope.projects.splice(i, 1); - } - }).error(function() { - $scope.getProjects(); - }); - }; - - $scope.change_user_filter = function(user_id) { - var position = $.inArray(user_id, $scope.filter_users); - var filter = 'user_filter_'+user_id+'_class'; - if( ~position ) { - $scope.filter_users.splice(position, 1); - $scope[filter] = false; - } - else { - $scope.filter_users.push(user_id); - $scope[filter] = true; - } - $scope.getProjects(); - }; - - $scope.change_group_filter = function(group_id) { - var position = $.inArray(group_id, $scope.filter_groups); - var filter = 'group_filter_'+group_id+'_class'; - if( ~position ) { - $scope.filter_groups.splice(position, 1); - $scope[filter] = false; - } - else { - $scope.filter_groups.push(group_id); - $scope[filter] = true; - } - $scope.getProjects(); - }; - - $scope.getProjects(); -}]); + $scope.requesting = true; + ProjectsService.getProjects().then(promiseResolve); +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js index dd02af5ed..da2b844f1 100644 --- a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js +++ b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js @@ -1,8 +1,12 @@ -RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotificationsHelper', - function($scope, LocalesHelper, SoundNotificationsHelper) { +RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotificationsHelper', '$timeout', + function($scope, LocalesHelper, SoundNotificationsHelper, $timeout) { + + $scope.hideAlerts = false; $scope.init = function(locale, sound_notifications) { LocalesHelper.setLocale(locale); - moment.locale(locale); + //moment.locale(locale); SoundNotificationsHelper.enabled(sound_notifications); + $timeout(function() { $scope.hideAlerts = true; }, 5000); + console.log($scope); } }]); diff --git a/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee b/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee index a91d6bd23..83d4244fb 100644 --- a/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee +++ b/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee @@ -12,11 +12,7 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco '56, 132, 158', '77, 169, 68', '241, 128, 73', - '174, 199, 232', - # '255, 187, 120', - # '152, 223, 138', - # '214, 39, 40', - # '31, 119, 180' + '174, 199, 232' ] $scope.charts = {} @@ -25,12 +21,6 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco startingDay: 1 $scope.init = -> - $('#statistics-form .date_picker').datepicker - 'dateFormat': 'yy-mm-dd' - maxDate: 0 - minDate: -366 - showButtonPanel: true - $scope.update() true @@ -85,18 +75,6 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco if $scope.statistics.build_lists $scope.initBuildListsChart() - # PullRequests - if $scope.statistics.pull_requests - $scope.initPullRequestsChart() - - # Issues - if $scope.statistics.issues - $scope.initIssuesChart() - - # Commits - if $scope.statistics.commits - $scope.initCommitsChart() - .error (data, status, headers, config) -> console.log 'error:' $scope.loading = false @@ -157,23 +135,4 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco $scope.statistics.build_lists.build_published ] - $scope.initCommitsChart = -> - $scope.dateChart '#commits_chart', [ - $scope.statistics.commits.chart - ] - - $scope.initPullRequestsChart = -> - $scope.dateChart '#pull_requests_chart', [ - $scope.statistics.pull_requests.open, - $scope.statistics.pull_requests.merged - $scope.statistics.pull_requests.closed, - ] - - $scope.initIssuesChart = -> - $scope.dateChart '#issues_chart', [ - $scope.statistics.issues.open, - $scope.statistics.issues.reopen, - $scope.statistics.issues.closed - ] - ] \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/loading.js b/app/assets/javascripts/angularjs/directives/loading.js new file mode 100644 index 000000000..1199a8022 --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/loading.js @@ -0,0 +1,16 @@ +/** + * Loading Directive + * @see http://tobiasahlin.com/spinkit/ + */ + +angular + .module('RosaABF') + .directive('rdLoading', rdLoading); + +function rdLoading() { + var directive = { + restrict: 'AE', + template: '
    ' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget-body.js b/app/assets/javascripts/angularjs/directives/widget-body.js new file mode 100644 index 000000000..4fc1bff8d --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget-body.js @@ -0,0 +1,22 @@ +/** + * Widget Body Directive + */ + +angular + .module('RosaABF') + .directive('rdWidgetBody', rdWidgetBody); + +function rdWidgetBody() { + var directive = { + requires: '^rdWidget', + replace: true, + scope: { + loading: '&', + classes: '@' + }, + transclude: true, + template: '
    ', + restrict: 'E' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget-footer.js b/app/assets/javascripts/angularjs/directives/widget-footer.js new file mode 100644 index 000000000..a9878d589 --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget-footer.js @@ -0,0 +1,18 @@ +/** + * Widget Footer Directive + */ + +angular + .module('RosaABF') + .directive('rdWidgetFooter', rdWidgetFooter); + +function rdWidgetFooter() { + var directive = { + requires: '^rdWidget', + transclude: true, + replace: true, + template: '', + restrict: 'E' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget-header.js b/app/assets/javascripts/angularjs/directives/widget-header.js new file mode 100644 index 000000000..8083351ec --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget-header.js @@ -0,0 +1,22 @@ +/** + * Widget Header Directive + */ + +angular + .module('RosaABF') + .directive('rdWidgetHeader', rdWidgetTitle); + +function rdWidgetTitle() { + var directive = { + requires: '^rdWidget', + replace: true, + scope: { + title: '@', + icon: '@' + }, + transclude: true, + template: '
    {{title}}
    ', + restrict: 'E' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget.js b/app/assets/javascripts/angularjs/directives/widget.js new file mode 100644 index 000000000..12dc58ec0 --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget.js @@ -0,0 +1,21 @@ +/** + * Widget Directive + */ + +angular + .module('RosaABF') + .directive('rdWidget', rdWidget); + +function rdWidget() { + var directive = { + transclude: true, + template: '
    ', + replace: true, + restrict: 'EA' + }; + return directive; + + function link(scope, element, attrs) { + /* */ + } +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/models/build_list.js.erb b/app/assets/javascripts/angularjs/models/build_list.js.erb index c2aacc8c3..34a0e8dd5 100644 --- a/app/assets/javascripts/angularjs/models/build_list.js.erb +++ b/app/assets/javascripts/angularjs/models/build_list.js.erb @@ -36,7 +36,7 @@ var BuildList = function(atts, dictionary) { self.version_link_text = self.commit_hash || self.project_version; self.version_link_url = Routes.commit_path(self.project.name_with_owner, self.version_link_text); } - self.project.url = Routes.project_path(self.project.name_with_owner); + self.project.url = '';//Routes.project_path(self.project.name_with_owner); } if (self.user) diff --git a/app/assets/javascripts/angularjs/services/activity_filter.js.coffee b/app/assets/javascripts/angularjs/services/activity_filter.js.coffee deleted file mode 100644 index a8d82e6ca..000000000 --- a/app/assets/javascripts/angularjs/services/activity_filter.js.coffee +++ /dev/null @@ -1,27 +0,0 @@ -ActivityFilterService = ($http) -> - get_owners: (val) -> - path = Routes.get_owners_list_path( - { - term: val - } - ) - - $http.get(path).then (response) -> - response.data - get_project_names: (owner, val) -> - path = Routes.get_project_names_list_path( - { - owner_uname: owner - term: val - } - ) - - $http.get(path).then (response) -> - response.data - - -angular - .module("RosaABF") - .factory "ActivityFilter", ActivityFilterService - -ActivityFilterService.$inject = ['$http'] diff --git a/app/assets/javascripts/angularjs/services/activity_service.js b/app/assets/javascripts/angularjs/services/activity_service.js new file mode 100644 index 000000000..9506fb82f --- /dev/null +++ b/app/assets/javascripts/angularjs/services/activity_service.js @@ -0,0 +1,85 @@ +angular.module("RosaABF").factory('ActivityService', ["$http", "$filter", function($http, $filter) { + var ActivityService = {}; + + var feed; + var next_page_link = null; + + var last_date; + var last_is_own = false; + var processFeed = function(feed) { + var res = []; + + _.each(feed, function(item) { + var cur_date = $filter('amDateFormat')(item.date, 'll') + if(cur_date != last_date) { + res.push({kind: 'new_day', date: cur_date, class: 'timeline-day'}); + last_date = cur_date; + } + res.push(item); + }); + + return res; + } + + ActivityService.getFeed = function(options) { + if(Object.prototype.toString.apply(options) != '[object Object]') { + options = {is_own: last_is_own, load_next_page: false}; + } + + var url; + if(!options['load_next_page']) { + last_date = null; + feed = {}; + params = {format: 'json'}; + if(options['owner_uname']) { + params['owner_filter'] = options['owner_uname']; + } + if(options['project_name']) { + params['project_name_filter'] = options['project_name']; + } + last_is_own = options['is_own']; + url = options['is_own'] ? Routes.own_activity_path(params) : Routes.activity_feeds_path(params); + } + else { + if(!next_page_link) { + return false; + } + + url = next_page_link; + } + + return $http.get(url).then(function(res) { + next_page_link = res.data.next_page_link; + + var new_feed = processFeed(res.data.feed); + var ret; + if(options['load_next_page']) { + ret = feed; + ret.push.apply(ret, new_feed); + } + else { + feed = ret = new_feed; + } + + return {feed: ret, next_link_present: !!next_page_link}; + }); + } + + ActivityService.getOwnersList = function(val) { + var path = Routes.get_owners_list_path({term: val}); + + return $http.get(path).then(function(res) { + return res.data; + }); + } + + ActivityService.getProjectNamesList = function(owner_uname, val) { + var path = Routes.get_project_names_list_path({owner_uname: owner_uname, term: val}); + + return $http.get(path).then(function(res) { + return res.data; + }); + } + + return ActivityService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/build_lists_service.js.erb b/app/assets/javascripts/angularjs/services/build_lists_service.js.erb new file mode 100644 index 000000000..3594172ab --- /dev/null +++ b/app/assets/javascripts/angularjs/services/build_lists_service.js.erb @@ -0,0 +1,77 @@ +angular.module("RosaABF").factory('BuildListsService', ["$http", function($http) { + var BuildListsService = {}; + + var map_priorities = { + <%=BuildList::WAITING_FOR_RESPONSE%>: 13, + <%=BuildList::BUILD_PENDING%>: 12, + <%=BuildList::RERUN_TESTS%>: 11, + <%=BuildList::BUILD_CANCELING%>: 10, + <%=BuildList::BUILD_CANCELED%>: 9, + <%=BuildList::BUILD_STARTED%>: 8, + <%=BuildList::RERUNNING_TESTS%>: 7, + <%=BuildList::BUILD_PUBLISH%>: 6, + <%=BuildList::BUILD_PUBLISHED%>: 5, + <%=BuildList::BUILD_ERROR%>: 4, + <%=BuildList::SUCCESS%>: 3, + <%=BuildList::TESTS_FAILED%>: 2, + <%=BuildList::FAILED_PUBLISH%>: 1, + <%=BuildList::REJECTED_PUBLISH%>: 0 + }; + + BuildListsService.getBuildLists = function(params, project) { + var url; + if(project) { + url = Routes.project_build_lists_path(project, {format: 'json'}); + } + else { + url = Routes.build_lists_path({format: 'json'}); + } + + return $http.get(url, {params: params}).then(function(results) { + // TMP fields + var dictionary = results.data.dictionary; + var build_lists = []; + var groups = {}; + + // Grouping of build_lists + _.each(results.data.build_lists, function(r){ + var bl = new BuildList(r, dictionary); + var key = bl.project_id + '-'; + key += bl.group_id ? bl.group_id : (bl.commit_hash + '-' + bl.user_id); + if (groups[key]) { + groups[key].addRelated(bl); + } + else { + groups[key] = bl; + build_lists.push(bl); + } + }); + + // Adds all build_lists into the table (group by group) + var build_lists_final = []; + _.each(build_lists, function(bl){ + if (bl.related.length > 1) { + var sorted_build_lists = _.sortBy(bl.related, function(b) { return map_priorities[b.status]; }); + bl.clearRelated(); + var first_in_group = sorted_build_lists[0]; + first_in_group.clearRelated(); + _.each(sorted_build_lists, function(b){ + if (b != first_in_group) { first_in_group.addRelated(b); } + build_lists_final.push(b); + }); + } else { + build_lists_final.push(bl); + } + }); + + return { + build_lists: build_lists_final, + page: results.data.page, + total_items: results.data.total_items, + filter: results.data.filter + }; + }); + } + + return BuildListsService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/compile_html.js.coffee b/app/assets/javascripts/angularjs/services/compile_html.js.coffee deleted file mode 100644 index df0f03519..000000000 --- a/app/assets/javascripts/angularjs/services/compile_html.js.coffee +++ /dev/null @@ -1,11 +0,0 @@ -compileHTML = ($compile) -> - run: (scope, data) -> - template = angular.element(data) - linkFn = $compile(template) - linkFn(scope) - -angular - .module("RosaABF") - .service "compileHTML", compileHTML - -compileHTML.$inject = ['$compile'] diff --git a/app/assets/javascripts/angularjs/services/platforms_service.js b/app/assets/javascripts/angularjs/services/platforms_service.js new file mode 100644 index 000000000..937120a8f --- /dev/null +++ b/app/assets/javascripts/angularjs/services/platforms_service.js @@ -0,0 +1,11 @@ +angular.module("RosaABF").factory('PlatformsService', ["$http", function($http) { + var PlatformsService = {}; + + PlatformsService.getPlatforms = function() { + return $http.get(Routes.platforms_path({ format: 'json' })).then(function(res) { + return res.data.platforms; + }); + } + + return PlatformsService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/project_info_service.js b/app/assets/javascripts/angularjs/services/project_info_service.js new file mode 100644 index 000000000..7cef8a85f --- /dev/null +++ b/app/assets/javascripts/angularjs/services/project_info_service.js @@ -0,0 +1,11 @@ +angular.module("RosaABF").factory('ProjectInfoService', ["$http", function($http) { + var ProjectInfoService = {}; + + ProjectInfoService.getProjectInfo = function(name_with_owner) { + return $http.get(Routes.project_info_path(name_with_owner, { format: 'json' })).then(function(res) { + return res.data.project_info; + }); + } + + return ProjectInfoService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/project_select_service.js b/app/assets/javascripts/angularjs/services/project_select_service.js new file mode 100644 index 000000000..921ff1d4d --- /dev/null +++ b/app/assets/javascripts/angularjs/services/project_select_service.js @@ -0,0 +1,10 @@ +angular.module("RosaABF").factory('ProjectSelectService', function() { + return { + project: "", + disable_bl: false, + disable_pi: false, + disable: function() { + return this.disable_bl || this.disable_pi; + } + }; +}); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/projects_service.js b/app/assets/javascripts/angularjs/services/projects_service.js new file mode 100644 index 000000000..f8a5aa42c --- /dev/null +++ b/app/assets/javascripts/angularjs/services/projects_service.js @@ -0,0 +1,15 @@ +angular.module("RosaABF").factory('ProjectsService', ["$http", function($http) { + var ProjectsService = {}; + + ProjectsService.getProjects = function(search) { + var params = { format: 'json' }; + if(search) { + params.search = search; + } + return $http.get(Routes.projects_path(params)).then(function(res) { + return res.data.projects; + }); + } + + return ProjectsService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/templates/build_list_notification.html.haml b/app/assets/javascripts/angularjs/templates/build_list_notification.html.haml deleted file mode 100644 index 7a61cf295..000000000 --- a/app/assets/javascripts/angularjs/templates/build_list_notification.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%i.img-circle.btn-info.fa.fa-gears -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{'notification.build_list' | i18n}} - %a{ 'ng-href' => "{{item.build_list.link}}" } {{item.build_list.id}} - {{'notification.in_project' | i18n}} - %a{ 'ng-href' => "{{item.project_link}}" } {{item.project_name_with_owner}} - {{item.build_list.status_message}} diff --git a/app/assets/javascripts/angularjs/templates/build_list_notification.html.slim b/app/assets/javascripts/angularjs/templates/build_list_notification.html.slim new file mode 100644 index 000000000..80fa3866b --- /dev/null +++ b/app/assets/javascripts/angularjs/templates/build_list_notification.html.slim @@ -0,0 +1,15 @@ +.timeline-item + .row + a ng-href="{{item.user.link}}" + img src="{{item.user.image}}" + | {{item.user.uname}} + span.pull-right + | {{item.date | amDateFormat:'HH:mm'}} + .timeline-item-body + | {{'notification.build_list' | i18n}} + a ng-href="{{item.build_list.link}}" + | {{item.build_list.id}} + | {{'notification.in_project' | i18n}} + a ng-href="{{item.project_link}}" + | {{item.project_name_with_owner}} + | {{item.build_list.status_message}} \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/templates/get_owners.html.slim b/app/assets/javascripts/angularjs/templates/get_owners.html.slim index 7c6cadff6..af86c8efb 100644 --- a/app/assets/javascripts/angularjs/templates/get_owners.html.slim +++ b/app/assets/javascripts/angularjs/templates/get_owners.html.slim @@ -1,4 +1,4 @@ - size = Avatar::AVATAR_SIZES[:small] a img ng-src= "{{match.model.avatar_path}}" height= size width= size - span< bind-html-unsafe= "match.model.uname | typeaheadHighlight:query" + span< ng-bind-html= "match.model.uname | uibTypeaheadHighlight:query" diff --git a/app/assets/javascripts/angularjs/templates/new_day.html.slim b/app/assets/javascripts/angularjs/templates/new_day.html.slim new file mode 100644 index 000000000..cd22e134c --- /dev/null +++ b/app/assets/javascripts/angularjs/templates/new_day.html.slim @@ -0,0 +1,2 @@ +span + | {{item.date}} \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/templates/search_collaborators.html.slim b/app/assets/javascripts/angularjs/templates/search_collaborators.html.slim deleted file mode 100644 index 28fa91046..000000000 --- a/app/assets/javascripts/angularjs/templates/search_collaborators.html.slim +++ /dev/null @@ -1,3 +0,0 @@ -a - img ng-src = "{{match.model.avatar_path}}" - span< bind-html-unsafe = "match.model.fullname | typeaheadHighlight:query" diff --git a/app/assets/javascripts/jquery.rails.js b/app/assets/javascripts/jquery.rails.js new file mode 100644 index 000000000..bc9fceb37 --- /dev/null +++ b/app/assets/javascripts/jquery.rails.js @@ -0,0 +1,555 @@ +(function($, undefined) { + +/** + * Unobtrusive scripting adapter for jQuery + * https://github.com/rails/jquery-ujs + * + * Requires jQuery 1.8.0 or later. + * + * Released under the MIT license + * + */ + + // Cut down on the number of issues from people inadvertently including jquery_ujs twice + // by detecting and raising an error when it happens. + 'use strict'; + + if ( $.rails !== undefined ) { + $.error('jquery-ujs has already been loaded!'); + } + + // Shorthand to make it a little easier to call public rails functions from within rails.js + var rails; + var $document = $(document); + + $.rails = rails = { + // Link elements bound by jquery-ujs + linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]', + + // Button elements bound by jquery-ujs + buttonClickSelector: 'button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)', + + // Select elements bound by jquery-ujs + inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', + + // Form elements bound by jquery-ujs + formSubmitSelector: 'form', + + // Form input elements bound by jquery-ujs + formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])', + + // Form input elements disabled during form submission + disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled', + + // Form input elements re-enabled after form submission + enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled', + + // Form required input elements + requiredInputSelector: 'input[name][required]:not([disabled]), textarea[name][required]:not([disabled])', + + // Form file input elements + fileInputSelector: 'input[type=file]:not([disabled])', + + // Link onClick disable selector with possible reenable after remote submission + linkDisableSelector: 'a[data-disable-with], a[data-disable]', + + // Button onClick disable selector with possible reenable after remote submission + buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]', + + // Up-to-date Cross-Site Request Forgery token + csrfToken: function() { + return $('meta[name=csrf-token]').attr('content'); + }, + + // URL param that must contain the CSRF token + csrfParam: function() { + return $('meta[name=csrf-param]').attr('content'); + }, + + // Make sure that every Ajax request sends the CSRF token + CSRFProtection: function(xhr) { + var token = rails.csrfToken(); + if (token) xhr.setRequestHeader('X-CSRF-Token', token); + }, + + // Make sure that all forms have actual up-to-date tokens (cached forms contain old ones) + refreshCSRFTokens: function(){ + $('form input[name="' + rails.csrfParam() + '"]').val(rails.csrfToken()); + }, + + // Triggers an event on an element and returns false if the event result is false + fire: function(obj, name, data) { + var event = $.Event(name); + obj.trigger(event, data); + return event.result !== false; + }, + + // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm + confirm: function(message) { + return confirm(message); + }, + + // Default ajax function, may be overridden with custom function in $.rails.ajax + ajax: function(options) { + return $.ajax(options); + }, + + // Default way to get an element's href. May be overridden at $.rails.href. + href: function(element) { + return element[0].href; + }, + + // Checks "data-remote" if true to handle the request through a XHR request. + isRemote: function(element) { + return element.data('remote') !== undefined && element.data('remote') !== false; + }, + + // Submits "remote" forms and links with ajax + handleRemote: function(element) { + var method, url, data, withCredentials, dataType, options; + + if (rails.fire(element, 'ajax:before')) { + withCredentials = element.data('with-credentials') || null; + dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType); + + if (element.is('form')) { + method = element.data('ujs:submit-button-formmethod') || element.attr('method'); + url = element.data('ujs:submit-button-formaction') || element.attr('action'); + data = $(element[0]).serializeArray(); + // memoized value from clicked submit button + var button = element.data('ujs:submit-button'); + if (button) { + data.push(button); + element.data('ujs:submit-button', null); + } + element.data('ujs:submit-button-formmethod', null); + element.data('ujs:submit-button-formaction', null); + } else if (element.is(rails.inputChangeSelector)) { + method = element.data('method'); + url = element.data('url'); + data = element.serialize(); + if (element.data('params')) data = data + '&' + element.data('params'); + } else if (element.is(rails.buttonClickSelector)) { + method = element.data('method') || 'get'; + url = element.data('url'); + data = element.serialize(); + if (element.data('params')) data = data + '&' + element.data('params'); + } else { + method = element.data('method'); + url = rails.href(element); + data = element.data('params') || null; + } + + options = { + type: method || 'GET', data: data, dataType: dataType, + // stopping the "ajax:beforeSend" event will cancel the ajax request + beforeSend: function(xhr, settings) { + if (settings.dataType === undefined) { + xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script); + } + if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) { + element.trigger('ajax:send', xhr); + } else { + return false; + } + }, + success: function(data, status, xhr) { + element.trigger('ajax:success', [data, status, xhr]); + }, + complete: function(xhr, status) { + element.trigger('ajax:complete', [xhr, status]); + }, + error: function(xhr, status, error) { + element.trigger('ajax:error', [xhr, status, error]); + }, + crossDomain: rails.isCrossDomain(url) + }; + + // There is no withCredentials for IE6-8 when + // "Enable native XMLHTTP support" is disabled + if (withCredentials) { + options.xhrFields = { + withCredentials: withCredentials + }; + } + + // Only pass url to `ajax` options if not blank + if (url) { options.url = url; } + + return rails.ajax(options); + } else { + return false; + } + }, + + // Determines if the request is a cross domain request. + isCrossDomain: function(url) { + var originAnchor = document.createElement('a'); + originAnchor.href = location.href; + var urlAnchor = document.createElement('a'); + + try { + urlAnchor.href = url; + // This is a workaround to a IE bug. + urlAnchor.href = urlAnchor.href; + + // If URL protocol is false or is a string containing a single colon + // *and* host are false, assume it is not a cross-domain request + // (should only be the case for IE7 and IE compatibility mode). + // Otherwise, evaluate protocol and host of the URL against the origin + // protocol and host. + return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || + (originAnchor.protocol + '//' + originAnchor.host === + urlAnchor.protocol + '//' + urlAnchor.host)); + } catch (e) { + // If there is an error parsing the URL, assume it is crossDomain. + return true; + } + }, + + // Handles "data-method" on links such as: + // Delete + handleMethod: function(link) { + var href = rails.href(link), + method = link.data('method'), + target = link.attr('target'), + csrfToken = rails.csrfToken(), + csrfParam = rails.csrfParam(), + form = $('
    '), + metadataInput = ''; + + if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) { + metadataInput += ''; + } + + if (target) { form.attr('target', target); } + + form.hide().append(metadataInput).appendTo('body'); + form.submit(); + }, + + // Helper function that returns form elements that match the specified CSS selector + // If form is actually a "form" element this will return associated elements outside the from that have + // the html form attribute set + formElements: function(form, selector) { + return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector); + }, + + /* Disables form elements: + - Caches element value in 'ujs:enable-with' data store + - Replaces element text with value of 'data-disable-with' attribute + - Sets disabled property to true + */ + disableFormElements: function(form) { + rails.formElements(form, rails.disableSelector).each(function() { + rails.disableFormElement($(this)); + }); + }, + + disableFormElement: function(element) { + var method, replacement; + + method = element.is('button') ? 'html' : 'val'; + replacement = element.data('disable-with'); + + if (replacement !== undefined) { + element.data('ujs:enable-with', element[method]()); + element[method](replacement); + } + + element.prop('disabled', true); + element.data('ujs:disabled', true); + }, + + /* Re-enables disabled form elements: + - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`) + - Sets disabled property to false + */ + enableFormElements: function(form) { + rails.formElements(form, rails.enableSelector).each(function() { + rails.enableFormElement($(this)); + }); + }, + + enableFormElement: function(element) { + var method = element.is('button') ? 'html' : 'val'; + if (element.data('ujs:enable-with') !== undefined) { + element[method](element.data('ujs:enable-with')); + element.removeData('ujs:enable-with'); // clean up cache + } + element.prop('disabled', false); + element.removeData('ujs:disabled'); + }, + + /* For 'data-confirm' attribute: + - Fires `confirm` event + - Shows the confirmation dialog + - Fires the `confirm:complete` event + + Returns `true` if no function stops the chain and user chose yes; `false` otherwise. + Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog. + Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function + return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog. + */ + allowAction: function(element) { + var message = element.data('confirm'), + answer = false, callback; + if (!message) { return true; } + + if (rails.fire(element, 'confirm')) { + try { + answer = rails.confirm(message); + } catch (e) { + (console.error || console.log).call(console, e.stack || e); + } + callback = rails.fire(element, 'confirm:complete', [answer]); + } + return answer && callback; + }, + + // Helper function which checks for blank inputs in a form that match the specified CSS selector + blankInputs: function(form, specifiedSelector, nonBlank) { + var foundInputs = $(), + input, + valueToCheck, + radiosForNameWithNoneSelected, + radioName, + selector = specifiedSelector || 'input,textarea', + requiredInputs = form.find(selector), + checkedRadioButtonNames = {}; + + requiredInputs.each(function() { + input = $(this); + if (input.is('input[type=radio]')) { + + // Don't count unchecked required radio as blank if other radio with same name is checked, + // regardless of whether same-name radio input has required attribute or not. The spec + // states https://www.w3.org/TR/html5/forms.html#the-required-attribute + radioName = input.attr('name'); + + // Skip if we've already seen the radio with this name. + if (!checkedRadioButtonNames[radioName]) { + + // If none checked + if (form.find('input[type=radio]:checked[name="' + radioName + '"]').length === 0) { + radiosForNameWithNoneSelected = form.find( + 'input[type=radio][name="' + radioName + '"]'); + foundInputs = foundInputs.add(radiosForNameWithNoneSelected); + } + + // We only need to check each name once. + checkedRadioButtonNames[radioName] = radioName; + } + } else { + valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : !!input.val(); + if (valueToCheck === nonBlank) { + foundInputs = foundInputs.add(input); + } + } + }); + return foundInputs.length ? foundInputs : false; + }, + + // Helper function which checks for non-blank inputs in a form that match the specified CSS selector + nonBlankInputs: function(form, specifiedSelector) { + return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank + }, + + // Helper function, needed to provide consistent behavior in IE + stopEverything: function(e) { + $(e.target).trigger('ujs:everythingStopped'); + e.stopImmediatePropagation(); + return false; + }, + + // Replace element's html with the 'data-disable-with' after storing original html + // and prevent clicking on it + disableElement: function(element) { + var replacement = element.data('disable-with'); + + if (replacement !== undefined) { + element.data('ujs:enable-with', element.html()); // store enabled state + element.html(replacement); + } + + element.bind('click.railsDisable', function(e) { // prevent further clicking + return rails.stopEverything(e); + }); + element.data('ujs:disabled', true); + }, + + // Restore element to its original state which was disabled by 'disableElement' above + enableElement: function(element) { + if (element.data('ujs:enable-with') !== undefined) { + element.html(element.data('ujs:enable-with')); // set to old enabled state + element.removeData('ujs:enable-with'); // clean up cache + } + element.unbind('click.railsDisable'); // enable element + element.removeData('ujs:disabled'); + } + }; + + if (rails.fire($document, 'rails:attachBindings')) { + + $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }}); + + // This event works the same as the load event, except that it fires every + // time the page is loaded. + // + // See https://github.com/rails/jquery-ujs/issues/357 + // See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching + $(window).on('pageshow.rails', function () { + $($.rails.enableSelector).each(function () { + var element = $(this); + + if (element.data('ujs:disabled')) { + $.rails.enableFormElement(element); + } + }); + + $($.rails.linkDisableSelector).each(function () { + var element = $(this); + + if (element.data('ujs:disabled')) { + $.rails.enableElement(element); + } + }); + }); + + $document.delegate(rails.linkDisableSelector, 'ajax:complete', function() { + rails.enableElement($(this)); + }); + + $document.delegate(rails.buttonDisableSelector, 'ajax:complete', function() { + rails.enableFormElement($(this)); + }); + + $document.delegate(rails.linkClickSelector, 'click.rails', function(e) { + var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey; + if (!rails.allowAction(link)) return rails.stopEverything(e); + + if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link); + + if (rails.isRemote(link)) { + if (metaClick && (!method || method === 'GET') && !data) { return true; } + + var handleRemote = rails.handleRemote(link); + // Response from rails.handleRemote() will either be false or a deferred object promise. + if (handleRemote === false) { + rails.enableElement(link); + } else { + handleRemote.fail( function() { rails.enableElement(link); } ); + } + return false; + + } else if (method) { + rails.handleMethod(link); + return false; + } + }); + + $document.delegate(rails.buttonClickSelector, 'click.rails', function(e) { + var button = $(this); + + if (!rails.allowAction(button) || !rails.isRemote(button)) return rails.stopEverything(e); + + if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button); + + var handleRemote = rails.handleRemote(button); + // Response from rails.handleRemote() will either be false or a deferred object promise. + if (handleRemote === false) { + rails.enableFormElement(button); + } else { + handleRemote.fail( function() { rails.enableFormElement(button); } ); + } + return false; + }); + + $document.delegate(rails.inputChangeSelector, 'change.rails', function(e) { + var link = $(this); + if (!rails.allowAction(link) || !rails.isRemote(link)) return rails.stopEverything(e); + + rails.handleRemote(link); + return false; + }); + + $document.delegate(rails.formSubmitSelector, 'submit.rails', function(e) { + var form = $(this), + remote = rails.isRemote(form), + blankRequiredInputs, + nonBlankFileInputs; + + if (!rails.allowAction(form)) return rails.stopEverything(e); + + // Skip other logic when required values are missing or file upload is present + if (form.attr('novalidate') === undefined) { + if (form.data('ujs:formnovalidate-button') === undefined) { + blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false); + if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) { + return rails.stopEverything(e); + } + } else { + // Clear the formnovalidate in case the next button click is not on a formnovalidate button + // Not strictly necessary to do here, since it is also reset on each button click, but just to be certain + form.data('ujs:formnovalidate-button', undefined); + } + } + + if (remote) { + nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector); + if (nonBlankFileInputs) { + // Slight timeout so that the submit button gets properly serialized + // (make it easy for event handler to serialize form without disabled values) + setTimeout(function(){ rails.disableFormElements(form); }, 13); + var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]); + + // Re-enable form elements if event bindings return false (canceling normal form submission) + if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); } + + return aborted; + } + + rails.handleRemote(form); + return false; + + } else { + // Slight timeout so that the submit button gets properly serialized + setTimeout(function(){ rails.disableFormElements(form); }, 13); + } + }); + + $document.delegate(rails.formInputClickSelector, 'click.rails', function(event) { + var button = $(this); + + if (!rails.allowAction(button)) return rails.stopEverything(event); + + // Register the pressed submit button + var name = button.attr('name'), + data = name ? {name:name, value:button.val()} : null; + + var form = button.closest('form'); + if (form.length === 0) { + form = $('#' + button.attr('form')); + } + form.data('ujs:submit-button', data); + + // Save attributes from button + form.data('ujs:formnovalidate-button', button.attr('formnovalidate')); + form.data('ujs:submit-button-formaction', button.attr('formaction')); + form.data('ujs:submit-button-formmethod', button.attr('formmethod')); + }); + + $document.delegate(rails.formSubmitSelector, 'ajax:send.rails', function(event) { + if (this === event.target) rails.disableFormElements($(this)); + }); + + $document.delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) { + if (this === event.target) rails.enableFormElements($(this)); + }); + + $(function(){ + rails.refreshCSRFTokens(); + }); + } + +})( jQuery ); diff --git a/app/assets/javascripts/new_application.js b/app/assets/javascripts/new_application.js index d54dffa86..ea716a30f 100644 --- a/app/assets/javascripts/new_application.js +++ b/app/assets/javascripts/new_application.js @@ -1,54 +1,15 @@ -//= require jquery -//= require jquery_ujs -//= require jquery-ui +//= require jquery.rails //= require js-routes -//= require bootstrap-sprockets - -//= require angular -//= require angular-sanitize -//= require angular-ui-bootstrap-tpls //= require angular-i18n -//= require angular-resource //= require ng-rails-csrf -//= require angular-cookies //= require soundmanager2-nodebug-jsmin //= require angular-rails-templates -//= require moment - //= require_tree ./angularjs -//= require loading-bar //= require underscore -//= require notifyjs -//= require notifyjs/styles/bootstrap/notify-bootstrap - -//= require lib/Chart -//= require lib/bootstrap-typeahead -//= require lib/custom-bootstrap-typeahead - -//= require extra/scroller - -//= require_self - -$(document).ready(function() { - $('.datetime_moment').each(function() { - var mtime = moment($(this).attr('origin_datetime'), 'YYYY-MM-DD HH:mm Z'); - $(this).attr('title', mtime.utc().format('YYYY-MM-DD HH:mm:ss UTC')); - }); - - window.updateTime = function () { - $('.datetime_moment').each(function() { - var time = moment($(this).attr('origin_datetime'), 'YYYY-MM-DD HH:mm Z'); - $(this).html(time.format('D MMM YYYY, HH:mm') + ' (' + time.fromNow() + ')'); - }); - }; - - updateTime(); - setInterval( updateTime, 15000 ); - -}); +//= require lib/Chart \ No newline at end of file diff --git a/app/assets/stylesheets/BootstrapXL.css b/app/assets/stylesheets/BootstrapXL.css deleted file mode 100644 index 91a6bfb3a..000000000 --- a/app/assets/stylesheets/BootstrapXL.css +++ /dev/null @@ -1,680 +0,0 @@ -/* -* https://github.com/lu4/BootstrapXL/blob/7c64e2ea5ee1f72ed3db9892c091d5a0380c4518/BootstrapXL.css -* -* CSS file with Bootstrap grid classes for screens bigger than 1600px. Just add this file after the Bootstrap CSS file and you will be able to use col-xl, col-xl-push, hidden-xl, etc. -* -* Author: Marc van Nieuwenhuijzen -* Company: WebVakman -* Site: WebVakman.nl -* -*/ -.visible-xs, -.visible-xs-block, -.visible-xs-inline, -.visible-xs-inline-block, -.visible-sm, -.visible-sm-block, -.visible-sm-inline, -.visible-sm-inline-block, -.visible-md, -.visible-md-block, -.visible-md-inline, -.visible-md-inline-block, -.visible-lg, -.visible-lg-block, -.visible-lg-inline, -.visible-lg-inline-block, -.visible-xl, -.visible-xl-block, -.visible-xl-inline, -.visible-xl-inline-block, -.visible-xx, -.visible-xx-block, -.visible-xx-inline, -.visible-xx-inline-block { - display: none !important; -} - -@media (max-width: 768px) { - .visible-xs { - display: block !important; - } - - table.visible-xs { - display: table; - } - - tr.visible-xs { - display: table-row !important; - } - - th.visible-xs, td.visible-xs { - display: table-cell !important; - } - - .visible-xs-block { - display: block !important; - } - - .visible-xs-inline { - display: inline !important; - } - - .visible-xs-inline-block { - display: inline-block !important; - } - - .hidden-xs { - display: none !important; - } -} - -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm { - display: block !important; - } - - table.visible-sm { - display: table; - } - - tr.visible-sm { - display: table-row !important; - } - - th.visible-sm, td.visible-sm { - display: table-cell !important; - } - - .visible-sm-block { - display: block !important; - } - - .visible-sm-inline { - display: inline !important; - } - - .visible-sm-inline-block { - display: inline-block !important; - } - - .hidden-sm { - display: none !important; - } -} - -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md { - display: block !important; - } - - table.visible-md { - display: table; - } - - tr.visible-md { - display: table-row !important; - } - - th.visible-md, td.visible-md { - display: table-cell !important; - } - - .visible-md-block { - display: block !important; - } - - .visible-md-inline { - display: inline !important; - } - - .visible-md-inline-block { - display: inline-block !important; - } - - .hidden-md { - display: none !important; - } -} - -@media (min-width: 1200px) { - .col-lg-3 { - width: 25%; - } - - .visible-lg { - display: block !important; - } - - table.visible-lg { - display: table; - } - - tr.visible-lg { - display: table-row !important; - } - - th.visible-lg, td.visible-lg { - display: table-cell !important; - } - - .visible-lg-block { - display: block !important; - } - - .visible-lg-inline { - display: inline !important; - } - - .visible-lg-inline-block { - display: inline-block !important; - } - - .hidden-lg { - display: none !important; - } -} - -@media (min-width: 1600px) { - .visible-lg { - display: none !important; - } -} - -@media (min-width: 1600px) { - .container { - width: 1570px; - } - - .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 { - float: left; - } - - .col-xl-12 { - width: 100%; - } - - .col-xl-11 { - width: 91.66666667%; - } - - .col-xl-10 { - width: 83.33333333%; - } - - .col-xl-9 { - width: 75%; - } - - .col-xl-8 { - width: 66.66666667%; - } - - .col-xl-7 { - width: 58.33333333%; - } - - .col-xl-6 { - width: 50%; - } - - .col-xl-5 { - width: 41.66666667%; - } - - .col-xl-4 { - width: 33.33333333%; - } - - .col-xl-3 { - width: 25%; - } - - .col-xl-2 { - width: 16.66666667%; - } - - .col-xl-1 { - width: 8.33333333%; - } - - .col-xl-pull-12 { - right: 100%; - } - - .col-xl-pull-11 { - right: 91.66666667%; - } - - .col-xl-pull-10 { - right: 83.33333333%; - } - - .col-xl-pull-9 { - right: 75%; - } - - .col-xl-pull-8 { - right: 66.66666667%; - } - - .col-xl-pull-7 { - right: 58.33333333%; - } - - .col-xl-pull-6 { - right: 50%; - } - - .col-xl-pull-5 { - right: 41.66666667%; - } - - .col-xl-pull-4 { - right: 33.33333333%; - } - - .col-xl-pull-3 { - right: 25%; - } - - .col-xl-pull-2 { - right: 16.66666667%; - } - - .col-xl-pull-1 { - right: 8.33333333%; - } - - .col-xl-pull-0 { - right: auto; - } - - .col-xl-push-12 { - left: 100%; - } - - .col-xl-push-11 { - left: 91.66666667%; - } - - .col-xl-push-10 { - left: 83.33333333%; - } - - .col-xl-push-9 { - left: 75%; - } - - .col-xl-push-8 { - left: 66.66666667%; - } - - .col-xl-push-7 { - left: 58.33333333%; - } - - .col-xl-push-6 { - left: 50%; - } - - .col-xl-push-5 { - left: 41.66666667%; - } - - .col-xl-push-4 { - left: 33.33333333%; - } - - .col-xl-push-3 { - left: 25%; - } - - .col-xl-push-2 { - left: 16.66666667%; - } - - .col-xl-push-1 { - left: 8.33333333%; - } - - .col-xl-push-0 { - left: auto; - } - - .col-xl-offset-12 { - margin-left: 100%; - } - - .col-xl-offset-11 { - margin-left: 91.66666667%; - } - - .col-xl-offset-10 { - margin-left: 83.33333333%; - } - - .col-xl-offset-9 { - margin-left: 75%; - } - - .col-xl-offset-8 { - margin-left: 66.66666667%; - } - - .col-xl-offset-7 { - margin-left: 58.33333333%; - } - - .col-xl-offset-6 { - margin-left: 50%; - } - - .col-xl-offset-5 { - margin-left: 41.66666667%; - } - - .col-xl-offset-4 { - margin-left: 33.33333333%; - } - - .col-xl-offset-3 { - margin-left: 25%; - } - - .col-xl-offset-2 { - margin-left: 16.66666667%; - } - - .col-xl-offset-1 { - margin-left: 8.33333333%; - } - - .col-xl-offset-0 { - margin-left: 0; - } - - .visible-xl { - display: block !important; - } - - table.visible-xl { - display: table; - } - - tr.visible-xl { - display: table-row !important; - } - - th.visible-xl, td.visible-xl { - display: table-cell !important; - } - - .visible-xl-block { - display: block !important; - } - - .visible-xl-inline { - display: inline !important; - } - - .visible-xl-inline-block { - display: inline-block !important; - } - - .hidden-xl { - display: none !important; - } -} - -@media (min-width: 2048px) { - .visible-xl { - display: none !important; - } -} - -@media (min-width: 2048px) { - .container { - width: 1570px; - } - - .col-xx-1, .col-xx-2, .col-xx-3, .col-xx-4, .col-xx-5, .col-xx-6, .col-xx-7, .col-xx-8, .col-xx-9, .col-xx-10, .col-xx-11, .col-xx-12 { - float: left; - } - - .col-xx-12 { - width: 100%; - } - - .col-xx-11 { - width: 91.66666667%; - } - - .col-xx-10 { - width: 83.33333333%; - } - - .col-xx-9 { - width: 75%; - } - - .col-xx-8 { - width: 66.66666667%; - } - - .col-xx-7 { - width: 58.33333333%; - } - - .col-xx-6 { - width: 50%; - } - - .col-xx-5 { - width: 41.66666667%; - } - - .col-xx-4 { - width: 33.33333333%; - } - - .col-xx-3 { - width: 25%; - } - - .col-xx-2 { - width: 16.66666667%; - } - - .col-xx-1 { - width: 8.33333333%; - } - - .col-xx-pull-12 { - right: 100%; - } - - .col-xx-pull-11 { - right: 91.66666667%; - } - - .col-xx-pull-10 { - right: 83.33333333%; - } - - .col-xx-pull-9 { - right: 75%; - } - - .col-xx-pull-8 { - right: 66.66666667%; - } - - .col-xx-pull-7 { - right: 58.33333333%; - } - - .col-xx-pull-6 { - right: 50%; - } - - .col-xx-pull-5 { - right: 41.66666667%; - } - - .col-xx-pull-4 { - right: 33.33333333%; - } - - .col-xx-pull-3 { - right: 25%; - } - - .col-xx-pull-2 { - right: 16.66666667%; - } - - .col-xx-pull-1 { - right: 8.33333333%; - } - - .col-xx-pull-0 { - right: auto; - } - - .col-xx-push-12 { - left: 100%; - } - - .col-xx-push-11 { - left: 91.66666667%; - } - - .col-xx-push-10 { - left: 83.33333333%; - } - - .col-xx-push-9 { - left: 75%; - } - - .col-xx-push-8 { - left: 66.66666667%; - } - - .col-xx-push-7 { - left: 58.33333333%; - } - - .col-xx-push-6 { - left: 50%; - } - - .col-xx-push-5 { - left: 41.66666667%; - } - - .col-xx-push-4 { - left: 33.33333333%; - } - - .col-xx-push-3 { - left: 25%; - } - - .col-xx-push-2 { - left: 16.66666667%; - } - - .col-xx-push-1 { - left: 8.33333333%; - } - - .col-xx-push-0 { - left: auto; - } - - .col-xx-offset-12 { - margin-left: 100%; - } - - .col-xx-offset-11 { - margin-left: 91.66666667%; - } - - .col-xx-offset-10 { - margin-left: 83.33333333%; - } - - .col-xx-offset-9 { - margin-left: 75%; - } - - .col-xx-offset-8 { - margin-left: 66.66666667%; - } - - .col-xx-offset-7 { - margin-left: 58.33333333%; - } - - .col-xx-offset-6 { - margin-left: 50%; - } - - .col-xx-offset-5 { - margin-left: 41.66666667%; - } - - .col-xx-offset-4 { - margin-left: 33.33333333%; - } - - .col-xx-offset-3 { - margin-left: 25%; - } - - .col-xx-offset-2 { - margin-left: 16.66666667%; - } - - .col-xx-offset-1 { - margin-left: 8.33333333%; - } - - .col-xx-offset-0 { - margin-left: 0; - } - - .visible-xx { - display: block !important; - } - - table.visible-xx { - display: table; - } - - tr.visible-xx { - display: table-row !important; - } - - th.visible-xx, td.visible-xx { - display: table-cell !important; - } - - .visible-xx-block { - display: block !important; - } - - .visible-xx-inline { - display: inline !important; - } - - .visible-xx-inline-block { - display: inline-block !important; - } - - .hidden-xx { - display: none !important; - } -} \ No newline at end of file diff --git a/app/assets/stylesheets/custom_bootstrap.sass b/app/assets/stylesheets/custom_bootstrap.sass deleted file mode 100644 index c2ce93e9c..000000000 --- a/app/assets/stylesheets/custom_bootstrap.sass +++ /dev/null @@ -1,237 +0,0 @@ -article.container-fluid - background: #FFF - -$logo-mini-height: 32px -$mini-avatar-height: 30px - -.top_menu - min-height: $top-menu-height - margin-bottom: 0 - - .navbar-brand - padding: $top-menu-padding-vertical $navbar-padding-horizontal - height: $top-menu-height - - .navbar-nav - @media (min-width: $grid-float-breakpoint) - > li - > a - padding-top: $top-menu-padding-vertical - padding-bottom: $top-menu-padding-vertical - - .navbar-form, - .navbar-toggle - margin-top: (($top-menu-height - $input-height-base) / 2) - margin-bottom: (($top-menu-height - $input-height-base) / 2) - - .navbar-right .avatar - margin-top: (($top-menu-height - $mini-avatar-height) / 2) - margin-bottom: (($top-menu-height - $mini-avatar-height) / 2) - - a.navbar-brand - padding-top: (($top-menu-height - $logo-mini-height) / 2) - padding-bottom: (($top-menu-height - $logo-mini-height) / 2) - -.nav a, -.pagination a, -.carousel a, -.panel-title a, -i.fa-question-circle[data-toggle='modal'], -span.fa.fa-times, -.navbar a, ul.dropdown-menu a - cursor: pointer - -footer - padding-top: 20px - padding-bottom: 20px - text-align: center - background-color: $navbar-default-bg - - ul li - display: inline - padding: 0 - font-size: 12px - color: $navbar-default-link-color - - a - color: $navbar-default-link-color - - a:hover, - a:focus - color: $navbar-default-link-hover-color - -.offset5 - margin-top: 10px -.offset10 - margin-top: 10px -.offset20 - margin-top: 20px -.offset0 - margin-top: 0 - -.boffset5 - margin-bottom: 5px -.boffset10 - margin-bottom: 10px -.boffset20 - margin-bottom: 20px -.boffset0 - margin-bottom: 0 - -.loffset5 - margin-left: 5px -.loffset10 - margin-left: 10px - -.roffset5 - margin-right: 5px - -.boffset_auto - margin-bottom: auto - -.lroffset-15 - margin-left: 15px - margin-right: 15px - -.lpadding-5 - padding-left: 5px - -.ubpadding-5 - padding-top: 5px - padding-bottom: 5px - -.padding-5 - padding: 5px - -[ng\:cloak], -[ng-cloak], -[data-ng-cloak], -[x-ng-cloak], -.ng-cloak, -.x-ng-cloak - display: none !important - -table - tbody - td.build-list-statuses - background: #FFF !important - - .status - float: left - border: 1px solid #DDD - margin: 1px 2px - - .nocolor - background: #FFF - - td.build-list-chevrons - background: #FFF !important - a - cursor: pointer - - tr.group-start td - border-top: 2px solid #125687 - - tr.group-end td - border-bottom: 2px solid #125687 - - thead > tr > th.icon - width: 12px - -table.table-borderless > tbody > tr > td, -table.table-borderless > thead > tr > th - border: 0 - -.build-list - .panel-heading - .build-list-status - padding: 5px 10px - color: #000 - - .build-list-time - padding: 5px 10px - - .bg-nocolor - background-color: #fff - - form .row [class^=col-] - padding-top: 5px - padding-bottom: 5px - -.submenu - margin-bottom: 0 - -#submenu-navbar-collapse ul.left-border - border-left: 1px solid #dcdcdc - -#repo-block-navbar-collapse - padding-left: 0 - -form#clone_url - padding-left: 0px - padding-right: 1px - -#copy_to_clipboard.navbar-text.navbar-left - margin-left: 8px - -#git-help.navbar-text.navbar-left - margin-left: 8px - margin-right: 8px - -p.navbar-text.navbar-right.current_branch - margin-right: 0 - -#output.formatted - overflow-x: auto - -table.highlighttable - width: 100% - max-width: 100% - - td.linenos - min-width: 52px - width: 2% - cursor: pointer - - .highlight-line - background-color: #FF9900 - -textarea.resize-vertical - resize: vertical - -.label-flag - float: left - margin: 1px 2px - border: 1px solid - -.colors - a.fa - text-decoration: none - -.update-label, .update-status, .pointer - cursor: pointer - -.no-pointer - cursor: default !important - -#scroller - position: fixed - bottom: 20px - left: 20px - cursor: pointer - display: none - -nav.navbar - form#clone_url - width: 35% - .form-group - display: inline - input - width: 100% - -.pre-fail-reason - border: none - border-radius: 0 - background: none - padding: 0 - margin: 0 \ No newline at end of file diff --git a/app/assets/stylesheets/new_application.scss b/app/assets/stylesheets/new_application.scss index ddda2cf68..2aa275d46 100644 --- a/app/assets/stylesheets/new_application.scss +++ b/app/assets/stylesheets/new_application.scss @@ -35,10 +35,7 @@ $navbar-inverse-toggle-border-color: #ddd; $blockquote-font-size: 14px; -@import "bootstrap-sprockets"; -@import "bootstrap"; -@import "BootstrapXL"; -@import "custom_bootstrap"; +@import "rdash"; @import "timeline"; @import "font-awesome"; @import "loading-bar"; diff --git a/app/assets/stylesheets/rdash.css b/app/assets/stylesheets/rdash.css new file mode 100644 index 000000000..81ed5cb7e --- /dev/null +++ b/app/assets/stylesheets/rdash.css @@ -0,0 +1,517 @@ +.content-wrapper { + padding-left: 0; + margin-left: 0; + width: 100%; + height: auto; +} +@media only screen and (min-width: 561px) { + .page-wrapper.open { + padding-left: 250px; + } +} +@media only screen and (max-width: 560px) { + .page-wrapper.open { + padding-left: 70px; + } +} +.page-wrapper.open .sidebar-wrapper { + left: 150px; +} + +/** + * Hamburg Menu + * When the class of 'hamburg' is applied to the body tag of the document, + * the sidebar changes it's style to attempt to mimic a menu on a phone app, + * where the content is overlaying the content, rather than push it. + */ +@media only screen and (max-width: 560px) { + body.hamburg .page-wrapper { + padding-left: 0; + } + body.hamburg .page-wrapper:not(.open) .sidebar-wrapper { + position: absolute; + left: -100px; + } + body.hamburg .page-wrapper:not(.open) ul.sidebar .sidebar-title.separator { + display: none; + } + body.hamburg .page-wrapper.open .sidebar-wrapper { + position: fixed; + } + body.hamburg .page-wrapper.open .sidebar-wrapper ul.sidebar li.sidebar-main { + margin-left: 0px; + } + body.hamburg .sidebar-wrapper ul.sidebar li.sidebar-main, + body.hamburg .row.header .meta { + margin-left: 70px; + } + body.hamburg .sidebar-wrapper ul.sidebar li.sidebar-main, + body.hamburg .page-wrapper.open .sidebar-wrapper ul.sidebar li.sidebar-main { + transition: margin-left 0.4s ease 0s; + } +} + +/** + * Header + */ +.row.header { + height: 60px; + background: #fff; + /*margin-bottom: 15px;*/ +} +.row.header > div:last-child { + padding-right: 0; +} +.row.header .meta .page { + font-size: 17px; + padding-top: 11px; +} +.row.header .meta .breadcrumb-links { + font-size: 10px; +} +.row.header .meta div { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.row.header .login a { + padding: 18px; + display: block; +} +.row.header .user { + min-width: 130px; +} +.row.header .user > .item { + width: 65px; + height: 60px; + float: right; + display: inline-block; + text-align: center; + vertical-align: middle; +} +.row.header .user > .item a { + color: #919191; + display: block; +} +.row.header .user > .item i { + font-size: 20px; + line-height: 55px; +} +.row.header .user > .item img { + width: 40px; + height: 40px; + margin-top: 10px; + border-radius: 2px; +} +.row.header .user > .item ul.dropdown-menu { + border-radius: 2px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05); +} +.row.header .user > .item ul.dropdown-menu .dropdown-header { + text-align: center; +} +.row.header .user > .item ul.dropdown-menu li.link { + text-align: left; +} +.row.header .user > .item ul.dropdown-menu li.link a { + padding-left: 7px; + padding-right: 7px; +} +.row.header .user > .item ul.dropdown-menu:before { + position: absolute; + top: -7px; + right: 23px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid rgba(0, 0, 0, 0.2); + border-left: 7px solid transparent; + content: ''; +} +.row.header .user > .item ul.dropdown-menu:after { + position: absolute; + top: -6px; + right: 24px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; +} + +.loading { + width: 40px; + height: 40px; + position: relative; + margin: 100px auto; +} +.double-bounce1, +.double-bounce2 { + width: 100%; + height: 100%; + border-radius: 50%; + background-color: #333; + opacity: 0.6; + position: absolute; + top: 0; + left: 0; + -webkit-animation: bounce 2s infinite ease-in-out; + animation: bounce 2s infinite ease-in-out; +} +.double-bounce2 { + -webkit-animation-delay: -1s; + animation-delay: -1s; +} +@-webkit-keyframes bounce { + 0%, + 100% { + -webkit-transform: scale(0); + } + 50% { + -webkit-transform: scale(1); + } +} +@keyframes bounce { + 0%, + 100% { + transform: scale(0); + -webkit-transform: scale(0); + } + 50% { + transform: scale(1); + -webkit-transform: scale(1); + } +} + +/* Fonts */ +@font-face { + font-family: 'Montserrat'; +/* src: url('../fonts/montserrat-regular-webfont.eot'); + src: url('../fonts/montserrat-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/montserrat-regular-webfont.woff') format('woff'), url('../fonts/montserrat-regular-webfont.ttf') format('truetype'), url('../fonts/montserrat-regular-webfont.svg#montserratregular') format('svg'); +*/ + font-weight: normal; + font-style: normal; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + @font-face { + font-family: 'Montserrat'; +/* src: url('../fonts/montserrat-regular-webfont.svg') format('svg'); */ + } + select { + font-family: Arial, Helvetica, sans-serif; + } +} +/* Base */ +html { + overflow-y: scroll; +} +body { + background: #f3f3f3; + font-family: "Montserrat"; + color: #333333 !important; +} +.row { + margin-left: 0 !important; + margin-right: 0 !important; +} +.alerts-container .alert:last-child { + margin-bottom: 0; +} +.page-wrapper { + padding-left: 70px; + height: 100%; +} +.sidebar-wrapper { + margin-left: -150px; + left: -30px; + width: 250px; + position: fixed; + height: 100%; + z-index: 999; +} +.page-wrapper, +.sidebar-wrapper { + transition: all .4s ease 0s; +} +.green { + background: #23ae89 !important; +} +.blue { + background: #2361ae !important; +} +.orange { + background: #d3a938 !important; +} +.red { + background: #ae2323 !important; +} +.form-group .help-block.form-group-inline-message { + padding-top: 5px; +} +div.input-mask { + padding-top: 7px; +} + + +/* #592727 RED */ +/* #2f5927 GREEN */ +/* #30426a BLUE (default)*/ +/* Sidebar background color */ +/* Sidebar header and footer color */ +/* Sidebar title text colour */ +/* Sidebar menu item hover color */ +/** + * Sidebar + */ +.sidebar-wrapper { + background: #30426a; +} +ul.sidebar .sidebar-main a, +.sidebar-footer, +ul.sidebar .sidebar-list a:hover, +.page-wrapper:not(.open) ul.sidebar .sidebar-title.separator { + /* Sidebar header and footer color */ + background: #2d3e63; +} +ul.sidebar { + position: absolute; + top: 0; + bottom: 0; + padding: 0; + margin: 0; + list-style: none; + text-indent: 20px; + overflow-x: hidden; + overflow-y: auto; +} +ul.sidebar li a { + color: #fff; + display: block; + float: left; + text-decoration: none; + width: 250px; +} +ul.sidebar .sidebar-main { + height: 65px; +} +ul.sidebar .sidebar-main a { + font-size: 18px; + line-height: 60px; +} +ul.sidebar .sidebar-main a:hover { + cursor: pointer; +} +ul.sidebar .sidebar-main .menu-icon { + float: right; + font-size: 18px; + padding-right: 28px; + line-height: 60px; +} +ul.sidebar .sidebar-title { + color: #738bc0; + font-size: 12px; + height: 35px; + line-height: 40px; + text-transform: uppercase; + transition: all .6s ease 0s; +} +ul.sidebar .sidebar-list { + height: 40px; +} +ul.sidebar .sidebar-list a { + text-indent: 25px; + font-size: 15px; + color: #b2bfdc; + line-height: 40px; +} +ul.sidebar .sidebar-list a:hover { + color: #fff; + border-left: 3px solid #e99d1a; + text-indent: 22px; +} +ul.sidebar .sidebar-list a:hover .menu-icon { + text-indent: 25px; +} +ul.sidebar .sidebar-list .menu-icon { + float: right; + padding-right: 29px; + line-height: 40px; + width: 70px; +} +.page-wrapper:not(.open) ul.sidebar { + bottom: 0; +} +.page-wrapper:not(.open) ul.sidebar .sidebar-title { + display: none; + height: 0px; + text-indent: -100px; +} +.page-wrapper:not(.open) ul.sidebar .sidebar-title.separator { + display: block; + height: 2px; + margin: 13px 0; +} +.page-wrapper:not(.open) ul.sidebar .sidebar-list a:hover span { + border-left: 3px solid #e99d1a; + text-indent: 22px; +} +.page-wrapper:not(.open) .sidebar-footer { + display: none; +} +.sidebar-footer { + position: absolute; + height: 40px; + bottom: 0; + width: 100%; + padding: 0; + margin: 0; + transition: all .6s ease 0s; + text-align: center; +} +.sidebar-footer div a { + color: #b2bfdc; + font-size: 12px; + line-height: 43px; +} +.sidebar-footer div a:hover { + color: #ffffff; + text-decoration: none; +} + +/* #592727 RED */ +/* #2f5927 GREEN */ +/* #30426a BLUE (default)*/ +/* Sidebar background color */ +/* Sidebar header and footer color */ +/* Sidebar title text colour */ +/* Sidebar menu item hover color */ + +/** + * Widgets + */ +.widget { + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + background: #ffffff; + border: 1px solid transparent; + border-radius: 2px; + border-color: #e9e9e9; +} +.widget .widget-header .pagination, +.widget .widget-footer .pagination { + margin: 0; +} +.widget .widget-header { + color: #767676; + background-color: #f6f6f6; + padding: 10px 15px; + border-bottom: 1px solid #e9e9e9; + line-height: 30px; +} +.widget .widget-header i { + margin-right: 5px; +} +.widget .widget-body { + padding: 20px; +} +.widget .widget-body table thead { + background: #fafafa; +} +.widget .widget-body table thead * { + font-size: 14px !important; +} +.widget .widget-body table tbody * { + font-size: 13px !important; +} +.widget .widget-body .error { + color: #ff0000; +} +.widget .widget-body button { + margin-left: 5px; +} +.widget .widget-body div.alert { + margin-bottom: 10px; +} +.widget .widget-body.large { + height: 350px; + overflow-y: auto; +} +.widget .widget-body.medium { + height: 250px; + overflow-y: auto; +} +.widget .widget-body.small { + height: 150px; + overflow-y: auto; +} +.widget .widget-body.no-padding { + padding: 0; +} +.widget .widget-body.no-padding .error, +.widget .widget-body.no-padding .message { + padding: 20px; +} +.widget .widget-footer { + border-top: 1px solid #e9e9e9; + padding: 10px; +} +.widget .widget-icon { + background: #30426a; + width: 65px; + height: 65px; + border-radius: 50%; + text-align: center; + vertical-align: middle; + margin-right: 15px; +} +.widget .widget-icon i { + line-height: 66px; + color: #ffffff; + font-size: 30px; +} +.widget .widget-footer { + border-top: 1px solid #e9e9e9; + padding: 10px; +} +.widget .widget-title .pagination, +.widget .widget-footer .pagination { + margin: 0; +} +.widget .widget-content .title { + font-size: 28px; + display: block; +} +.no-left-gutter { + /*padding-right:0;*/ + padding-left: 0; +} +.top-space { + margin-top: 15px; +} +.bottom-space { + margin-bottom: 15px; +} +table tbody td.build-list-statuses .status { + float: left; + border: 1px solid #DDD; + margin: 1px 2px; +} +table tbody td.build-list-statuses { + background: none !important; +} +table tbody td.build-list-chevrons { + background: none !important; +} +table tbody tr.group-start td { + border-top: 2px solid #125687 +} +table tbody tr.group-end td { + border-bottom: 2px solid #125687 +} +.no-align { + text-align: left; +} +.form-inline > * { + margin-left: 5px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/timeline.css b/app/assets/stylesheets/timeline.css new file mode 100644 index 000000000..742daf415 --- /dev/null +++ b/app/assets/stylesheets/timeline.css @@ -0,0 +1,28 @@ +ul.timeline { + list-style: none; + padding: 0; + margin-bottom: 0; +} +ul.timeline > li.timeline-day { + margin-top: 5px; + padding: 5px; + border-bottom: none; +} +ul.timeline > li.timeline-day span { + padding: 3px; + border-radius: 3px; + border: 1px solid rgb(221, 221, 221); + background: rgb(250, 250, 250); +} +ul.timeline > li { + border-bottom: 1px solid rgb(221, 221, 221); +} +ul.timeline > li:last-of-type { + border-bottom: none; +} +ul.timeline > li div.timeline-item { + padding: 10px; +} +ul.timeline > li div.timeline-item > div.timeline-item-body { + margin-top: 5px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/views/blame.sass b/app/assets/stylesheets/views/blame.sass deleted file mode 100644 index 48c0572cd..000000000 --- a/app/assets/stylesheets/views/blame.sass +++ /dev/null @@ -1,12 +0,0 @@ -table.table.blame - tr - td - padding-top: 0 - padding-bottom: 0 - - pre - margin-bottom: 0 - border: 0 - .highlight - pre - background: none diff --git a/app/assets/stylesheets/views/diff.sass b/app/assets/stylesheets/views/diff.sass deleted file mode 100644 index 5e6448143..000000000 --- a/app/assets/stylesheets/views/diff.sass +++ /dev/null @@ -1,71 +0,0 @@ -.table-responsive.overflow-auto - border: 1px solid #DDD - overflow-x: auto - -table.table.diff.inline - margin-bottom: 0 - - tr.changes - pre - padding: 0 - margin: 0 - background: none - border: none - - .diff-content - padding: 0 - margin: 0 - tr - td.header - background: whitesmoke - padding: 0 0 0 10px - - td.code, td.line_numbers - padding: 0 0 0 10px - border-top: none - - td.line_numbers - background-color: #ECECEC - border-right: 1px solid #DDD - text-align: right - vertical-align: middle - padding: 0 6px - width: 40px - - td.code.del - background-color: #FFDDDD - - .idiff - background-color: #F2ACAD - - td.code.ins - background-color: #DDFFDD - - td.code.highlight-line - background-color: #FFFFCC - - tr.inline-comments - border-top: 1px solid #DDD - - .add_line-comment - position: absolute - width: 25px - height: 18px - margin-left: -103px - margin-top: 0 - cursor: pointer - opacity: 0 - filter: alpha(Opacity=0) - -moz-opacity: 0 - - tr:hover .add_line-comment - opacity: 1 - filter: alpha(Opacity=100) - -moz-opacity: 1 - - .line-comment, #new_inline_comment - max-width: 700px - -div.file div.top - min-height: 28px - background: #ededed diff --git a/app/controllers/api/v1/jobs_controller.rb b/app/controllers/api/v1/jobs_controller.rb index beb1b0c15..d84b52f1d 100644 --- a/app/controllers/api/v1/jobs_controller.rb +++ b/app/controllers/api/v1/jobs_controller.rb @@ -119,7 +119,6 @@ class Api::V1::JobsController < Api::V1::BaseController arches = params[:arches].to_s.split(',') native_arches = params[:native_arches].to_s.split(',') native_arches &= arches if !arches.empty? - puts native_arches native_arches.present? ? Arch.where(name: native_arches).pluck(:id) : [] end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 0eb918ff1..fa774eb35 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -2,12 +2,14 @@ class HomeController < ApplicationController before_action :authenticate_user!, except: [:root] skip_after_action :verify_authorized + def index + redirect_to projects_dashboard_path + end + def activity(is_my_activity = false) - #@filter = :build @activity_feeds = current_user.activity_feeds .by_project_name(params[:project_name_filter]) .by_owner_uname(params[:owner_filter]) - #@activity_feeds = @activity_feeds.where(kind: "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all @activity_feeds = if is_my_activity @activity_feeds.where(creator_id: current_user) @@ -17,8 +19,17 @@ class HomeController < ApplicationController @activity_feeds = @activity_feeds.paginate page: current_page + if @activity_feeds.next_page + if is_my_activity + method = :own_activity_path + else + method = :activity_feeds_path + end + @next_page_link = method.to_proc.call(self, page: @activity_feeds.next_page, owner_filter: params[:owner_filter], + project_name_filter: params[:project_name_filter], format: :json) + end + respond_to do |format| - format.html { render 'activity' } format.json { render 'activity' } format.atom end diff --git a/app/controllers/platforms/platforms_controller.rb b/app/controllers/platforms/platforms_controller.rb index bdda87fb4..d3fb34269 100644 --- a/app/controllers/platforms/platforms_controller.rb +++ b/app/controllers/platforms/platforms_controller.rb @@ -11,8 +11,6 @@ class Platforms::PlatformsController < Platforms::BaseController format.json { @platforms = PlatformPolicy::Scope.new(current_user, Platform).related - @platforms_count = @platforms.count - @platforms = @platforms.paginate(page: current_page, per_page: Platform.per_page) } end end diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index ea2367b96..be81d6756 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -16,7 +16,6 @@ class Projects::BuildListsController < Projects::BaseController params[:filter].each{|k,v| params[:filter].delete(k) if v.blank? } if params[:filter] respond_to do |format| - format.html format.json do @filter = BuildList::Filter.new(@project, current_user, params[:filter] || {}) params[:page] = params[:page].to_i == 0 ? nil : params[:page] @@ -84,7 +83,8 @@ class Projects::BuildListsController < Projects::BaseController else BuildList.where(id: build_lists.map(&:id)).update_all(group_id: build_lists[0].id) if build_lists.size > 1 flash[:notice] = notices.join('
    ').html_safe - redirect_to project_build_lists_path(@project) + puts root_path(anchor: "project=" + @project.name_with_owner) + redirect_to root_path(anchor: "?project=" + @project.name_with_owner) end end @@ -153,18 +153,6 @@ class Projects::BuildListsController < Projects::BaseController } end - def list - @build_lists = @project.build_lists - @build_lists = @build_lists.where(user_id: current_user) if params[:owner_filter] == 'true' - @build_lists = @build_lists.where(status: [BuildList::BUILD_ERROR, BuildList::FAILED_PUBLISH, BuildList::REJECTED_PUBLISH]) if params[:status_filter] == 'true' - - @total_build_lists = @build_lists.count - - @build_lists = @build_lists.recent.paginate(page: current_page) - - render partial: 'build_lists_ajax', layout: false - end - protected def build_list_params diff --git a/app/controllers/projects/projects_controller.rb b/app/controllers/projects/projects_controller.rb index 801fd40e6..546e014d6 100644 --- a/app/controllers/projects/projects_controller.rb +++ b/app/controllers/projects/projects_controller.rb @@ -8,70 +8,57 @@ class Projects::ProjectsController < Projects::BaseController def index authorize :project - @projects = ProjectPolicy::Scope.new(current_user, Project).membered.search(params[:search]) respond_to do |format| - format.html { - @groups = current_user.groups - @owners = User.where(id: @projects.where(owner_type: 'User').uniq.pluck(:owner_id)) - } format.json { - groups = params[:groups] || [] - owners = params[:users] || [] - @projects = @projects.by_owners(groups, owners) if groups.present? || owners.present? - @projects_count = @projects.count - @projects = @projects.recent.paginate(page: current_page, per_page: Project.per_page) + if not params[:search].present? + @projects = Project.find(current_user.build_lists.group(:project_id).limit(10).pluck(:project_id)) + else + @projects = ProjectPolicy::Scope.new(current_user, Project).membered.search(params[:search]).limit(20) + end } end end + def project_info + authorize @project + respond_to do |format| + format.json { + @github_basic_info = @project.github_data + @commits = [] + @project.github_branches.each do |branch| + last_commit_info = @project.github_last_commit(branch.name)[0] + if last_commit_info + last_commit = { + branch: branch.name, + url: last_commit_info['html_url'], + sha: last_commit_info['sha'], + message: last_commit_info['commit']['message'] + } + if last_commit_info['committer'] + last_commit[:committer_login] = last_commit_info['committer']['login'] + last_commit[:committer_url] = last_commit_info['committer']['html_url'] + else + last_commit[:committer_login] = last_commit_info['commit']['author']['name'] + last_commit[:committer_url] = '' + end + @commits << last_commit + end + end + } + end + end + + def dashboard + authorize :project + end + def new authorize :project @project = Project.new end - def mass_import - authorize :project - @project = Project.new(mass_import: true) - end - - def mass_create - authorize :project - @project = Project.new(mass_create: true) - end - - def run_mass_import - @project = Project.new project_params - @project.owner = choose_owner - authorize @project - @project.valid? - @project.errors.messages.slice! :url - if @project.errors.messages.blank? # We need only url validation - @project.init_mass_import - flash[:notice] = t('flash.project.mass_import_added_to_queue') - redirect_to projects_path - else - render :mass_import - end - end - - def run_mass_create - @project = Project.new project_params - @project.owner = choose_owner - authorize @project - @project.valid? - @project.errors.messages.slice! :url - if @project.errors.messages.blank? # We need only url validation - @project.init_mass_create - flash[:notice] = t('flash.project.mass_create_added_to_queue') - redirect_to projects_path - else - render :mass_create - end - end - def edit authorize @project - @project_aliases = Project.project_aliases(@project).paginate(page: current_page) end def create @@ -96,7 +83,7 @@ class Projects::ProjectsController < Projects::BaseController format.html do if @project.update_attributes(project_params) flash[:notice] = t('flash.project.saved') - redirect_to @project + redirect_to root_path else flash[:error] = t('flash.project.save_error') flash[:warning] = @project.errors.full_messages.join('. ') @@ -137,31 +124,6 @@ class Projects::ProjectsController < Projects::BaseController redirect_to @project.owner end - def sections - authorize @project, :update? - if request.patch? - if @project.update_attributes(project_params) - flash[:notice] = t('flash.project.saved') - redirect_to sections_project_path(@project) - else - @project.save - flash[:error] = t('flash.project.save_error') - end - end - end - - def remove_user - authorize @project - @project.relations.by_actor(current_user).destroy_all - respond_to do |format| - format.html do - flash[:notice] = t("flash.project.user_removed") - redirect_to projects_path - end - format.json { render nothing: true } - end - end - def autocomplete_maintainers authorize @project term, limit = params[:query], params[:limit] || 10 @@ -179,10 +141,6 @@ class Projects::ProjectsController < Projects::BaseController redirect_to 'https://github.com/' + @project.github_get_organization + '/' + @project.name + '/compare/' + params[:diff] end - def bl_redirect - redirect_to controller: "build_lists", action: "index" - end - protected def project_params diff --git a/app/models/concerns/project/github_api.rb b/app/models/concerns/project/github_api.rb index 6a2f913ce..78643c738 100644 --- a/app/models/concerns/project/github_api.rb +++ b/app/models/concerns/project/github_api.rb @@ -4,7 +4,7 @@ module Project::GithubApi extend ActiveSupport::Concern def github_data - Octokit.repo github_get_organization + '/' + name rescue nil + Octokit.repo github_get_organization + '/' + name rescue {} end def github_branches @@ -15,6 +15,14 @@ module Project::GithubApi Octokit.tags github_get_organization + '/' + name rescue [] end + def github_last_commit(branch = nil) + if branch.present? + Octokit.commits github_get_organization + '/' + name, sha: branch, per_page: 1 rescue [] + else + Octokit.commits github_get_organization + '/' + name, per_page: 1 rescue [] + end + end + def github_get_organization return github_organization if github_organization.presence APP_CONFIG['github_organization'] diff --git a/app/models/product_build_list.rb b/app/models/product_build_list.rb index 9b0a746f0..bb2e3bc4e 100644 --- a/app/models/product_build_list.rb +++ b/app/models/product_build_list.rb @@ -5,6 +5,7 @@ class ProductBuildList < ActiveRecord::Base include EventLoggable include ProductBuildLists::Statusable include ProductBuildLists::AbfWorkerable + include EventLoggable LIVE_TIME = 2.week # for autostart MAX_LIVE_TIME = 3.month # for manual start; diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index f8810c9a8..8c7aa8174 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -3,6 +3,7 @@ class ProjectPolicy < ApplicationPolicy def index? !user.guest? end + alias_method :dashboard?, :index? alias_method :autocomplete_project?, :index? alias_method :remove_user?, :index? alias_method :preview?, :index? @@ -15,11 +16,12 @@ class ProjectPolicy < ApplicationPolicy local_reader? end - alias_method :commit?, :show? + alias_method :commit?, :show? alias_method :read?, :show? alias_method :archive?, :show? alias_method :get_id?, :show? alias_method :refs_list?, :show? + alias_method :project_info?, :show? def fork? !user.guest? && show? diff --git a/app/views/devise/passwords/edit.html.slim b/app/views/devise/passwords/edit.html.slim index e2564e5ac..1b1738e5c 100644 --- a/app/views/devise/passwords/edit.html.slim +++ b/app/views/devise/passwords/edit.html.slim @@ -1,13 +1,11 @@ -.panel.panel-default - .panel-heading - h4= t('devise.passwords.new_password') - .panel-body - +rd-widget + rd-widget-header title=t('devise.passwords.new_password') + rd-widget-body = simple_form_for resource, url: password_path(resource_name), html: { method: :put } do |f| = f.hidden_field :reset_password_token = f.input :password = f.input :password_confirmation - hr - .pull-right - = f.button :submit, t('devise.passwords.edit_button') + .row + .pull-right + = f.button :submit, t('devise.passwords.edit_button') diff --git a/app/views/devise/passwords/new.html.slim b/app/views/devise/passwords/new.html.slim index 9cd1e413d..e0cf70f90 100644 --- a/app/views/devise/passwords/new.html.slim +++ b/app/views/devise/passwords/new.html.slim @@ -1,12 +1,12 @@ -.panel.panel-default - .panel-heading - h4= t('devise.passwords.forgot') - .panel-body +.row.top-space + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=t('devise.passwords.forgot') + rd-widget-body + = simple_form_for resource, url: password_path(resource_name), html: { method: :post } do |f| + = hidden_field_tag :invitation_token, @invitation_token - = simple_form_for resource, url: password_path(resource_name), html: { method: :post } do |f| - = hidden_field_tag :invitation_token, @invitation_token - - = f.input :email - hr - .pull-right - = f.button :submit, t('devise.passwords.send') + = f.input :email + .row + .pull-right + = f.button :submit, t('devise.passwords.send') diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim index 1673f366d..b10e7431e 100644 --- a/app/views/devise/registrations/new.html.slim +++ b/app/views/devise/registrations/new.html.slim @@ -1,18 +1,16 @@ +.row.top-space + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=t('layout.devise.shared_links.sign_up') + rd-widget-body + = simple_form_for resource, url: registration_path(resource_name) do |f| + = hidden_field_tag :invitation_token, @invitation_token -.panel.panel-default - .panel-heading - h4= t('layout.devise.shared_links.sign_up') - .panel-body - - = simple_form_for resource, url: registration_path(resource_name) do |f| - = hidden_field_tag :invitation_token, @invitation_token - - = f.input :uname - = f.input :name - = f.input :email - = f.input :password - = f.input :password_confirmation - - hr - .pull-right - = f.button :submit, t('layout.devise.shared_links.sign_up') \ No newline at end of file + = f.input :uname + = f.input :name + = f.input :email + = f.input :password + = f.input :password_confirmation + .row + .pull-right + = f.button :submit, t('layout.devise.shared_links.sign_up') \ No newline at end of file diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim index d3b7e060f..41d884cda 100644 --- a/app/views/devise/sessions/new.html.slim +++ b/app/views/devise/sessions/new.html.slim @@ -1,22 +1,19 @@ +.row.top-space + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=t('layout.devise.shared_links.sign_in') + rd-widget-body + - login = t('devise.sessions.login'); password = t('devise.sessions.password') + = hidden_field_tag :login_default, login + = hidden_field_tag :password_default, password + = simple_form_for resource, url: session_path(resource_name) do |f| -.panel.panel-default - .panel-heading - h4= t('layout.devise.shared_links.sign_in') - .panel-body - - - - login = t('devise.sessions.login'); password = t('devise.sessions.password') - = hidden_field_tag :login_default, login - = hidden_field_tag :password_default, password - = simple_form_for resource, url: session_path(resource_name) do |f| - - = f.input :login - = f.input :password - - hr - .pull-left - = f.input :remember_me, as: :boolean, checked: true - .pull-right - = f.button :submit, t('layout.devise.shared_links.sign_in') - -= link_to t('layout.devise.shared_links.forgot_password'), new_password_path(resource_name) + = f.input :login + = f.input :password + .row + .pull-left + = f.input :remember_me, as: :boolean, checked: true + .pull-right + = f.button :submit, t('layout.devise.shared_links.sign_in') + .row + = link_to t('layout.devise.shared_links.forgot_password'), new_password_path(resource_name) diff --git a/app/views/home/_activity_tab.html.slim b/app/views/home/_activity_tab.html.slim deleted file mode 100644 index 200630291..000000000 --- a/app/views/home/_activity_tab.html.slim +++ /dev/null @@ -1,13 +0,0 @@ -tab[ heading= t('activity_menu.activity_feed') - active= "actCtrl.activity_tab.active" - select = "actCtrl.getContent('activity')" ] - .row - .col-md-3.offset10== render 'sidebar' - .col-md-9.offset10 - h3 - = t 'layout.activity_feed.header' - = link_to image_tag('rss.ico', width: '15px', height: '15px', class: 'atom_icon'), - atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token) - i< class= 'fa fa-spinner fa-spin fa-lg offset10 boffset10' ng-show= 'actCtrl.processing' - - == render 'activity_tabsets' diff --git a/app/views/home/_activity_tabsets.html.slim b/app/views/home/_activity_tabsets.html.slim deleted file mode 100644 index 8532bc437..000000000 --- a/app/views/home/_activity_tabsets.html.slim +++ /dev/null @@ -1,18 +0,0 @@ -div ng-hide= 'actCtrl.processing' - / The time line - .row.offset10 - .col-md-12.col-sm-12 - ul.timeline - / timeline time label - li.time-label ng-repeat-start= 'item in actCtrl.getCurActivity().feed' - span ng-show= "item.is_date_changed" - | {{item.date | amDateFormat:'ll'}} - / timeline item - li ng-include= "actCtrl.getTemplate(item)" - .hide ng-repeat-end= true - li - i.img-circle.bg-primary.fa.fa-clock-o - hr - btn.center-block.btn.btn-primary[ ng-show= 'actCtrl.getCurActivity().next_page_link' - ng-click= "actCtrl.load_more()" ] - = t('layout.activity_feed.load_messages') diff --git a/app/views/home/_feed_tabs.html.haml b/app/views/home/_feed_tabs.html.haml deleted file mode 100644 index fbf09a3bb..000000000 --- a/app/views/home/_feed_tabs.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -.sub-menu.activity-tabs - %nav - %ul - - (collection = t 'feed_menu').each do |base, title| - %li= link_to title, root_path(filter: base), class: @filter == base ? 'active' : '' diff --git a/app/views/home/_filters.html.slim b/app/views/home/_filters.html.slim deleted file mode 100644 index 5830cc3b8..000000000 --- a/app/views/home/_filters.html.slim +++ /dev/null @@ -1,21 +0,0 @@ -hr - h4 - => t('layout.relations.filters') - -.form-group - = text_field_tag :owner_uname, nil, - class: 'form-control', - placeholder: t('search.placeholders.owner_filter'), - 'ng-model' => 'actCtrl.current_activity_tab.owner_uname_filter_tmp', - 'typeahead' => 'owner.uname for owner in actCtrl.getOwnersList($viewValue)', - 'typeahead-on-select' => 'actCtrl.selectOwnerFilter($item, $model, $label)', - 'typeahead-template-url' => "get_owners.html" - -.form-group - = text_field_tag :project_name, nil, - class: 'form-control', - placeholder: t('search.placeholders.name_filter'), - 'ng-model' => 'actCtrl.current_activity_tab.project_name_filter_tmp', - 'ng-value' => 'actCtrl.current_activity_tab.project_name_filter_tmp', - 'typeahead' => 'project.name for project in actCtrl.getProjectNamesList($viewValue)', - 'typeahead-on-select' => 'actCtrl.selectProjectNameFilter($item, $model, $label)' diff --git a/app/views/home/_own_activity_tab.html.slim b/app/views/home/_own_activity_tab.html.slim deleted file mode 100644 index 970aa76d9..000000000 --- a/app/views/home/_own_activity_tab.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -tab[ heading= t('activity_menu.own_activity') - active= "actCtrl.own_activity_tab.active" - select = "actCtrl.getContent('own_activity')" ] - .row - .col-md-3.offset10== render 'sidebar' - .col-md-9.offset10 - h3 - = t 'layout.activity_feed.own_header' - i< class= 'fa fa-spinner fa-spin fa-lg offset10 boffset10' ng-show= 'actCtrl.processing' - == render 'activity_tabsets' diff --git a/app/views/home/_sidebar.html.slim b/app/views/home/_sidebar.html.slim deleted file mode 100644 index 63e473323..000000000 --- a/app/views/home/_sidebar.html.slim +++ /dev/null @@ -1,30 +0,0 @@ -p - = link_to t('layout.activity_feed.new_project'), new_project_path, - class: 'btn btn-primary btn-small', role: 'button' -== render 'filters' -hr -h5= t('layout.activity_feed.my_last_projects') - -ul.nav.nav-pills.nav-stacked - - current_user.projects.order(updated_at: :desc).limit(5).each do |project| - li - = link_to project_path(project) do - = fa_visibility_icon project - = project.name_with_owner - li - = link_to t('layout.activity_feed.all_my_projects'), projects_path - -hr -- midnight = Time.now.utc.to_date -h5= t 'layout.activity_feed.my_builds_by_day' -ul.nav.nav-pills.nav-stacked - - ['BuildList::BUILD_PUBLISHED', 'BuildList::SUCCESS', 'BuildList::BUILD_STARTED', - 'BuildList::BUILD_PENDING', 'BuildList::BUILD_ERROR'].each do |state| - li - a[ href = build_lists_path(filter: {status: state.constantize, 'updated_at_start(1i)' => midnight.year, - 'updated_at_start(2i)' => midnight.month, 'updated_at_start(3i)' => midnight.day}) ] - span.badge.pull-right - = BuildList.for_status(state.constantize).for_user(current_user).for_notified_date_period(midnight, nil).count - = t "layout.build_lists.statuses.#{state.demodulize.downcase}" - li - a[ href = build_lists_path ]=t 'layout.activity_feed.all_my_builds' diff --git a/app/views/home/activity.html.slim b/app/views/home/activity.html.slim deleted file mode 100644 index 6f0e73f56..000000000 --- a/app/views/home/activity.html.slim +++ /dev/null @@ -1,7 +0,0 @@ --set_meta_tags title: nil -.row - .col-xs-12.col-md-10.col-md-offset-1[ ng-controller= 'ActivityController as actCtrl' - ng-init= "actCtrl.init('#{action_name}')" ] - tabset.offset10 ng-cloak= true - == render 'activity_tab' - == render 'own_activity_tab' diff --git a/app/views/home/activity.json.jbuilder b/app/views/home/activity.json.jbuilder index 048229a85..f5748d915 100644 --- a/app/views/home/activity.json.jbuilder +++ b/app/views/home/activity.json.jbuilder @@ -1,9 +1,5 @@ if @activity_feeds.next_page - json.next_page_link root_path(filter: @filter, - page: @activity_feeds.next_page, - owner_filter: @owner_filter, - project_name_filter: @project_name_filter, - format: :json) + json.next_page_link @next_page_link end json.feed do diff --git a/app/views/home/index.html.slim b/app/views/home/index.html.slim new file mode 100644 index 000000000..e36f7d88d --- /dev/null +++ b/app/views/home/index.html.slim @@ -0,0 +1,147 @@ +.row.top-space + .col-md-6 + rd-widget + div ng-controller="ProjectsController" + rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" + input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") + ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] + rd-widget-body classes="medium no-padding" loading="requesting" + .table-responsive + table.table ng-cloak=true + thead + tr + th ng-show="search" = t 'dashboard.projects.name' + th ng-hide="search" = t 'dashboard.projects.last_projects' + th + th + tbody + tr ng-repeat = 'item in projects' + td + button[ ng-click = 'selectProject(item.name_with_owner)' + ng-disabled="ProjectSelectService.disable()" class="btn btn-xs btn-link"] {{::item.name_with_owner}} + td + a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' + td + a[ ng-href = '{{::item.edit_link}}' + ng-show='::item.edit_link' target='_blank'] = t 'project_menu.settings' + - if policy(:project).create? + rd-widget-footer + ul.nav.nav-justified + li + = link_to t('layout.projects.new'), new_project_path, target: '_blank' + .col-md-6 + rd-widget + div ng-controller="ProjectInfoController" + rd-widget-header title=(t('dashboard.project_info.title') + '{{widget_title}}') + rd-widget-body class="medium" loading="requesting" + div ng-hide="widget_title" + = t('dashboard.project_info.select') + div ng-show="widget_title" + div + a ng-href="{{project_info.html_url}}" target="_blank" + | {{project}} + div.bottom-space + | {{project_info.description}} + div + div.bottom-space ng-repeat="commit in project_info.commits" + div + span + | {{::commit.branch}} + span.pull-right + a ng-href="{{::commit.committer_url}}" target="_blank" + | {{::commit.committer_login}} + div + a ng-href="{{::commit.url}}" target="_blank" + | {{::commit.sha}} + div + | {{::commit.message}} + +.row.top-space + .col-md-12 + == render 'projects/build_lists/filter' + rd-widget + div ng-controller="BuildListsController" + rd-widget-header title="Build Lists{{widget_title}}" icon="fa-gears" + .form-inline ng-init="autoreload=true" + button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" + = t 'layout.autoreload_page' + button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" + | Filters + button [class="btn btn-default" ng-show="widget_title" + ng-click="clearProject()" ng-disabled="ProjectSelectService.disable()"] + | Clear selected project + rd-widget-body classes="large no-padding" loading="isRequest" + .row + table.table.table-condensed + thead + tr + th + th= t('activerecord.attributes.build_list.id') + th= t('activerecord.attributes.build_list.status') + th= t('activerecord.attributes.build_list.project') + th= t('diff') + th= t('activerecord.attributes.build_list.project_version') + th= t('activerecord.attributes.build_list.save_to_repository') + th= t('activerecord.attributes.build_list.arch_short') + th= t('activerecord.attributes.build_list.user') + th= t('activerecord.attributes.build_list.hostname') + th= t('activerecord.attributes.build_list.updated_at') + tbody + tr[ ng-repeat = 'bl in build_lists' + class = '{{::bl.status_color}}' + id = 'build-list-{{::bl.id}}' + ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" + ng-show = 'bl.show' ] + td.build-list-chevrons + a.expand ng-show = '::bl.hasRelated' + span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' + span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' + / id + td.build-list-statuses + + a[ ng-href = '{{::bl.url}}' ] {{::bl.id}} + div ng-show = '::bl.hasRelated' ng-bind-html="::bl.chevronHtml" + + / status + td + | {{::bl.human_status | i18n}} + br + time ng-show = '::bl.duration' + | {{::bl.duration}} + time ng-show = '::bl.average_build_time' + | /{{::bl.average_build_time}} + + / project + td.centered ng-hide = '::bl.project' colspan = 2 + = t('layout.projects.unexisted_project') + td ng-show = '::bl.project' + | {{::bl.project.name_with_owner}} + + / diff + td + a ng-href = '{{::bl.version_link_url}}' ng-show = '::bl.project' + | {{::bl.version_link_text}} + + / project_version + td[] {{::bl.version_release}} + + / save_to_repository + td + a[ ng-href = '{{::bl.save_to_repository_url}}' ] {{::bl.save_to_repository_name}} + + / arch_short + td[ ng-show = '::bl.arch' ] {{::bl.arch.name}} + td[ ng-hide = '::bl.arch' ]= t('layout.arches.unexisted_arch') + + / user + td + a[ ng-href = '{{::bl.user.url}}' ] {{::bl.user.fullname}} + + / hostname + td[] {{::bl.hostname}} + + / updated_at + td title = '{{::bl.updated_at_utc}}' + | {{::bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} + rd-widget-footer ng-show="total_items > per_page" + == angularjs_paginate( per_page: 'per_page' ) \ No newline at end of file diff --git a/app/views/layouts/_flashes.html.slim b/app/views/layouts/_flashes.html.slim index 977823508..9ee207dc2 100644 --- a/app/views/layouts/_flashes.html.slim +++ b/app/views/layouts/_flashes.html.slim @@ -1,6 +1,6 @@ -.row - .col-lx-12.col-md-10.col-md-offset-1 - - flash.each do |type, message| - .alert.text-center class = alert_class(type) - button.close[ type = 'button' data-dismiss = 'alert' aria-hidden = true ] × - == message +- unless flash.empty? + .row.top-space.alerts-container ng-hide="hideAlerts" + .col-md-10.col-md-offset-1 + - flash.each do |type, message| + uib-alert.alert.text-center class=alert_class(type) + == message \ No newline at end of file diff --git a/app/views/layouts/_scroller.html.slim b/app/views/layouts/_scroller.html.slim deleted file mode 100644 index 8f854ef8f..000000000 --- a/app/views/layouts/_scroller.html.slim +++ /dev/null @@ -1 +0,0 @@ -#scroller.fa.fa-arrow-circle-up.fa-2x.text-primary.hidden-xs \ No newline at end of file diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index c28a821e7..edefc7554 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -3,36 +3,59 @@ html head meta name="viewport" content="width=device-width, initial-scale=1.0" meta content="text/html; charset=utf-8" http-equiv="Content-Type" - == render 'shared/header' == csrf_meta_tag = display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-' - if user_signed_in? = auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name']) + script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js" type="text/javascript" + link href='//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' rel='stylesheet' + link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css' == stylesheet_link_tag 'new_application', cache: 'application' - body[ ng-app='RosaABF' ng-controller='RosaABFController' - ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ] - == render 'layouts/menu/new_top' - == yield :submenu if content_for?(:submenu) + body[ ng-app='RosaABF' ng-controller='RosaABFController' ng-strict-di='' + ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ng-cloak="true"] + .page-wrapper.open + .sidebar-wrapper + ul.sidebar + li.sidebar-main + a href="/" + = link_to image_tag('logo-mini.png', alt: 'ABF'), root_path + == render 'layouts/menu/new_top' - - if current_user || APP_CONFIG['anonymous_access'] - - if (flash_notify = FlashNotify.published_first_cached) && flash_notify.should_show?(cookies[:flash_notify_hash]) - javascript: - var FLASH_HASH_ID = "#{flash_notify.hash_id}"; - .notify.alert.alert-dismissable.text-center class=alert_class(flash_notify.status) - button.close type='button' data-dismiss='alert' aria-hidden=true - = flash_notify.body(I18n.locale).html_safe + .content-wrapper + .page-content + .row.header + .col-md-12 + .user.pull-right + - if current_user + .item.dropdown(uib-dropdown) + a(uib-dropdown-toggle) + = image_tag avatar_url(current_user), alt: 'avatar' + ul.dropdown-menu.dropdown-menu-right + li.link= link_to current_user.uname, current_user + li.link= link_to t('layout.settings.label'), profile_settings_path + li.divider + li.link= link_to t('layout.logout'), destroy_user_session_path, method: :delete + - else + ul.nav.navbar-nav + li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path + li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path + .meta + .page + == yield :submenu if content_for?(:submenu) + == render 'layouts/noscript' + == render "layouts/flashes" - == render 'layouts/noscript' - == render "layouts/flashes" + == yield - article.container-fluid - == yield - == render 'layouts/menu/new_bottom' - == javascript_include_tag 'new_application', cache: 'application' - - if I18n.locale == :ru - == javascript_include_tag 'moment/ru.js', cache: 'moment' - == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' - == yield :additional_scripts if content_for?(:additional_scripts) - - == render '/layouts/scroller' + script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-resource.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-cookies.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-sanitize.js" type="text/javascript" + script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.5/ui-bootstrap-tpls.js" type="text/javascript" + script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous" + == javascript_include_tag 'new_application', cache: 'application' + == yield :additional_scripts if content_for?(:additional_scripts) + - if I18n.locale == :ru + == javascript_include_tag 'moment/ru.js', cache: 'moment' + == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' \ No newline at end of file diff --git a/app/views/layouts/invite.html.haml b/app/views/layouts/invite.html.haml deleted file mode 100644 index 246ff32ad..000000000 --- a/app/views/layouts/invite.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -!!! -%html - %head - %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/ - %title=t 'invites.title' - %script{src: "http://html5shiv.googlecode.com/svn/trunk/html5.js", type: "text/javascript"} - %link{href: "/styles/prereg.css", rel: "stylesheet", type: "text/css"}/ - %body - .wrap - = yield :nav if content_for?(:nav) - / Top block - %header - .logo - .text=t 'invites.header' - .both - / Page - %article - =yield - .both - / Footer - %footer= render "layouts/menu/bottom" - = render 'layouts/counters' if !current_user.try(:admin?) && Rails.env.production? diff --git a/app/views/layouts/loading.html.slim b/app/views/layouts/loading.html.slim new file mode 100644 index 000000000..35ab6f610 --- /dev/null +++ b/app/views/layouts/loading.html.slim @@ -0,0 +1,2 @@ +div ng-if="false" + \ No newline at end of file diff --git a/app/views/layouts/menu/_new_top.html.slim b/app/views/layouts/menu/_new_top.html.slim index c58f7be3d..dafcc45c0 100644 --- a/app/views/layouts/menu/_new_top.html.slim +++ b/app/views/layouts/menu/_new_top.html.slim @@ -1,62 +1,12 @@ -nav.navbar.navbar-inverse.top_menu role = "navigation" - .container-fluid - / Brand and toggle get grouped for better mobile display - .navbar-header - button.navbar-toggle[ data-target = "#top-menu-navbar-collapse" data-toggle = "collapse" type = "button" ] - span.sr-only Toggle navigation - span.icon-bar - span.icon-bar - span.icon-bar - = link_to image_tag('logo-mini.png', alt: 'ABF'), root_path, class: 'navbar-brand' - / Collect the nav links, forms, and other content for toggling - #top-menu-navbar-collapse.collapse.navbar-collapse - ul.nav.navbar-nav - - (collection = t 'top_menu').each do |base, title| - - if policy(base.to_s.singularize.to_sym).index? - li class=top_menu_class(base) - a href=send("#{base}_path") - i.fa.hidden-sm class=top_menu_icon(base) - i.fa.visible-sm-inline-block.fa-2x class=top_menu_icon(base) - span.hidden-sm - =< title - li - a href="http://repoclosure.openmandriva.org" - i.fa.hidden-sm class="fa-bicycle" - i.fa.visible-sm-inline-block.fa-2x class="fa-bicycle" - span.hidden-sm - =< t('repoclosure') - - if current_user.try(:admin?) - li class=top_menu_class('admin') - a href=admin_users_path target="_blank" - i.fa.fa-lock.hidden-sm - i.fa.fa-lock.visible-sm-inline-block.fa-2x - span.hidden-sm - =< t('admins_menu_header') - li - = form_tag search_index_path, method: 'get', class: 'navbar-form navbar-left', - role: 'search' do - .form-group - = text_field_tag 'query', @query, placeholder: t('layout.search.header'), class: 'form-control' - ul.nav.navbar-nav.navbar-right - - if current_user - li.hidden-xs - .avatar - = image_tag avatar_url(current_user), alt: 'avatar', class: 'img-responsive' - li.dropdown - a.dropdown[ data-toggle = 'dropdown' href = '#' id = 'userMenuLabel' - aria-haspopup = 'true' aria-expanded = 'false' ] - span.visible-xs-inline-block.visible-lg-inline-block> - = current_user.uname - i.fa.fa-cog.hidden-sm - i.fa.fa-cog.visible-sm-inline-block.fa-2x - ul.dropdown-menu role = 'menu' aria-labelledby = 'userMenuLabel' - li= link_to current_user.uname, current_user - li= link_to t('layout.settings.label'), profile_settings_path - li.divider - li= link_to t('layout.logout'), destroy_user_session_path, method: :delete - - else - ul.nav.navbar-nav - li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path - li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path - / /.navbar-collapse - / /.container-fluid +-if current_user + -if policy(:project).dashboard? + li.sidebar-list + a href=projects_dashboard_path + =t 'dashboard.dashboard_name' + span.menu-icon.fa.fa-tachometer + - (collection = t 'top_menu').each do |base, title| + - if policy(base.to_s.singularize.to_sym).index? + li.sidebar-list + a href=send("#{base}_path") + = title + span.menu-icon.fa class=top_menu_icon(base) \ No newline at end of file diff --git a/app/views/layouts/sessions.html.slim b/app/views/layouts/sessions.html.slim index 5c36f0851..edefc7554 100644 --- a/app/views/layouts/sessions.html.slim +++ b/app/views/layouts/sessions.html.slim @@ -3,27 +3,59 @@ html head meta name="viewport" content="width=device-width, initial-scale=1.0" meta content="text/html; charset=utf-8" http-equiv="Content-Type" - == render 'shared/header' == csrf_meta_tag = display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-' + - if user_signed_in? + = auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name']) + script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js" type="text/javascript" + link href='//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' rel='stylesheet' + link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css' == stylesheet_link_tag 'new_application', cache: 'application' - body - == render 'layouts/menu/new_top' - == render 'layouts/noscript' - == render "layouts/flashes" + body[ ng-app='RosaABF' ng-controller='RosaABFController' ng-strict-di='' + ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ng-cloak="true"] + .page-wrapper.open + .sidebar-wrapper + ul.sidebar + li.sidebar-main + a href="/" + = link_to image_tag('logo-mini.png', alt: 'ABF'), root_path + == render 'layouts/menu/new_top' + + .content-wrapper + .page-content + .row.header + .col-md-12 + .user.pull-right + - if current_user + .item.dropdown(uib-dropdown) + a(uib-dropdown-toggle) + = image_tag avatar_url(current_user), alt: 'avatar' + ul.dropdown-menu.dropdown-menu-right + li.link= link_to current_user.uname, current_user + li.link= link_to t('layout.settings.label'), profile_settings_path + li.divider + li.link= link_to t('layout.logout'), destroy_user_session_path, method: :delete + - else + ul.nav.navbar-nav + li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path + li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path + .meta + .page + == yield :submenu if content_for?(:submenu) + == render 'layouts/noscript' + == render "layouts/flashes" - article.container-fluid.offset10 - .row - .col-md-6.col-md-offset-3 - .panel.panel-primary - .panel-heading - = image_tag 'logo.png', class: 'img-responsive center-block img-rounded' == yield - == render 'layouts/menu/new_bottom' - == javascript_include_tag 'new_application', cache: 'application' - == javascript_include_tag 'login' - - if I18n.locale == :ru - == javascript_include_tag 'moment/ru.js', cache: 'moment' - == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' - == yield :additional_scripts if content_for?(:additional_scripts) \ No newline at end of file + + script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-resource.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-cookies.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-sanitize.js" type="text/javascript" + script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.5/ui-bootstrap-tpls.js" type="text/javascript" + script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous" + == javascript_include_tag 'new_application', cache: 'application' + == yield :additional_scripts if content_for?(:additional_scripts) + - if I18n.locale == :ru + == javascript_include_tag 'moment/ru.js', cache: 'moment' + == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' \ No newline at end of file diff --git a/app/views/platforms/base/_submenu.html.slim b/app/views/platforms/base/_submenu.html.slim index 1d44f7b4a..13f3ddb51 100644 --- a/app/views/platforms/base/_submenu.html.slim +++ b/app/views/platforms/base/_submenu.html.slim @@ -5,39 +5,33 @@ .container-fluid / Brand and toggle get grouped for better mobile display .navbar-header - button.navbar-toggle data-target='#submenu-navbar-collapse' data-toggle='collapse' type='button' - span.sr-only Toggle navigation - span.icon-bar - span.icon-bar - span.icon-bar .navbar-brand = link_to platform_printed_name(@platform), @platform / Collect the nav links, forms, and other content for toggling - #submenu-navbar-collapse.collapse.navbar-collapse - ul.nav.navbar-nav.left-border + ul.nav.navbar-nav.left-border - li class=('active' if act == :show && contr == :platforms) - = link_to t("layout.platforms.about"), platform_path(@platform) - li class=('active' if contr == :repositories) - = link_to t("layout.repositories.list_header"), platform_repositories_path(@platform) - li class=('active' if contr == :contents) - = link_to t('layout.platforms.contents'), platform_contents_path(@platform) - - if policy(@platform).show? - li class=('active' if act == :index && contr == :maintainers) - = link_to t("layout.platforms.maintainers"), platform_maintainers_path(@platform) - li class=('active' if contr == :mass_builds) - = link_to t("layout.platforms.mass_build"), platform_mass_builds_path(@platform) - - if policy(@platform.products.build).show? - li class=('active' if contr == :products) - = link_to t("layout.products.list_header"), platform_products_path(@platform) - - if policy(@platform).update? - li class=('active' if act == :edit && contr == :platforms) - = link_to t("platform_menu.settings"), edit_platform_path(@platform) - - if policy(@platform).local_admin_manage? - li class=('active' if act == :members && contr == :platforms) - = link_to t("layout.platforms.members"), members_platform_path(@platform) - - if policy(@platform).edit? - li class=('active' if contr == :key_pairs) - = link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform) - li class=('active' if contr == :tokens) - = link_to t('layout.tokens.header'), platform_tokens_path(@platform) + li class=('active' if act == :show && contr == :platforms) + = link_to t("layout.platforms.about"), platform_path(@platform) + li class=('active' if contr == :repositories) + = link_to t("layout.repositories.list_header"), platform_repositories_path(@platform) + li class=('active' if contr == :contents) + = link_to t('layout.platforms.contents'), platform_contents_path(@platform) + - if policy(@platform).show? + li class=('active' if act == :index && contr == :maintainers) + = link_to t("layout.platforms.maintainers"), platform_maintainers_path(@platform) + li class=('active' if contr == :mass_builds) + = link_to t("layout.platforms.mass_build"), platform_mass_builds_path(@platform) + - if policy(@platform.products.build).show? + li class=('active' if contr == :products) + = link_to t("layout.products.list_header"), platform_products_path(@platform) + - if policy(@platform).update? + li class=('active' if act == :edit && contr == :platforms) + = link_to t("platform_menu.settings"), edit_platform_path(@platform) + - if policy(@platform).local_admin_manage? + li class=('active' if act == :members && contr == :platforms) + = link_to t("layout.platforms.members"), members_platform_path(@platform) + - if policy(@platform).edit? + li class=('active' if contr == :key_pairs) + = link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform) + li class=('active' if contr == :tokens) + = link_to t('layout.tokens.header'), platform_tokens_path(@platform) diff --git a/app/views/platforms/contents/index.html.slim b/app/views/platforms/contents/index.html.slim index bf96cd23a..3e33f277c 100644 --- a/app/views/platforms/contents/index.html.slim +++ b/app/views/platforms/contents/index.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@platform), t('layout.platforms.contents')] = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-xs-12.col-md-12 h3 = t('layout.platforms.contents_of') |   diff --git a/app/views/platforms/maintainers/index.html.slim b/app/views/platforms/maintainers/index.html.slim index 5ca369922..b12a21f1f 100644 --- a/app/views/platforms/maintainers/index.html.slim +++ b/app/views/platforms/maintainers/index.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@platform), t('layout.maintainers.list_header')] / FIXME: no these 'base' links! = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-xs-12.col-md-12 .row / = render partial: 'list', object: @maintainers / = will_paginate @maintainers diff --git a/app/views/platforms/mass_builds/index.html.slim b/app/views/platforms/mass_builds/index.html.slim index 23c234def..2e5a077b5 100644 --- a/app/views/platforms/mass_builds/index.html.slim +++ b/app/views/platforms/mass_builds/index.html.slim @@ -1,6 +1,6 @@ = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-md-12 .row - if policy(@platform.mass_builds.build).create? a.btn.btn-primary href=new_platform_mass_build_path(@platform) diff --git a/app/views/platforms/mass_builds/new.html.slim b/app/views/platforms/mass_builds/new.html.slim index 9224c2fd5..845e18c60 100644 --- a/app/views/platforms/mass_builds/new.html.slim +++ b/app/views/platforms/mass_builds/new.html.slim @@ -2,12 +2,11 @@ = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 - +.col-md-12 .row[ ng-controller = 'NewMassBuildController as newMassBuildCtrl' ng-cloak = true ] = simple_form_for @mass_build, url: platform_mass_builds_path(@platform) do |f| - .col-md-4.col-md-offset-2 + .col-md-8 = f.input :description, as: :text, input_html: { class: 'resize-vertical' } b diff --git a/app/views/platforms/mass_builds/show.html.slim b/app/views/platforms/mass_builds/show.html.slim index 51e033297..92ca35e13 100644 --- a/app/views/platforms/mass_builds/show.html.slim +++ b/app/views/platforms/mass_builds/show.html.slim @@ -7,7 +7,7 @@ = render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-md-12 .row h3 = t('activerecord.models.mass_build') diff --git a/app/views/platforms/platforms/edit.html.slim b/app/views/platforms/platforms/edit.html.slim index f5420457f..5eed0fd33 100644 --- a/app/views/platforms/platforms/edit.html.slim +++ b/app/views/platforms/platforms/edit.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@platform), t('layout.platforms.edit')] = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row = simple_form_for @platform, wrapper_mappings: { boolean: :vertical_boolean } do |f| = render 'form', f: f diff --git a/app/views/platforms/platforms/index.html.slim b/app/views/platforms/platforms/index.html.slim index a35dbd503..495c84101 100644 --- a/app/views/platforms/platforms/index.html.slim +++ b/app/views/platforms/platforms/index.html.slim @@ -1,23 +1,24 @@ - set_meta_tags title: t('layout.platforms.list_header') -.row ng-controller='PlatformsCtrl' - .col-md-6.col-md-offset-3 ng-cloak=true - - if policy(:platform).create? - a.btn.btn-primary href=new_platform_path - = t('layout.platforms.new') - table.table.table-hover.offset10 - thead - tr - th - th= t 'activerecord.attributes.platform.name' - th= t 'activerecord.attributes.platform.distrib_type' - tbody - tr ng-repeat='item in platforms' - td - i.fa.fa-lg ng-class='item.visibility_class' - td - a ng-href="{{item.link}}" - | {{item.name}} - td - | {{item.distrib_type}} - - = angularjs_paginate per_page: Platform.per_page +.row.top-space ng-controller='PlatformsController' + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=(t('layout.platforms.list_header')) + rd-widget-body class="no-padding" + table.table.table-hover + thead + tr + th= t 'activerecord.attributes.platform.name' + th= t 'activerecord.attributes.platform.distrib_type' + tbody + tr ng-repeat='item in platforms' + td + a ng-href="{{item.link}}" + | {{item.name}} + td + | {{item.distrib_type}} + - if policy(:platform).create? + rd-widget-footer + ul.nav.nav-justified + li + a href=new_platform_path + = t('layout.platforms.new') \ No newline at end of file diff --git a/app/views/platforms/platforms/index.json.jbuilder b/app/views/platforms/platforms/index.json.jbuilder index 56acd2e81..d872425b6 100644 --- a/app/views/platforms/platforms/index.json.jbuilder +++ b/app/views/platforms/platforms/index.json.jbuilder @@ -4,10 +4,6 @@ json.platforms do json.name platform_printed_name(item) json.link platform_path(item) json.distrib_type item.distrib_type - json.visibility_class fa_platform_visibility_icon(item) end end -end - -json.page params[:page] -json.platforms_count @platforms_count +end \ No newline at end of file diff --git a/app/views/platforms/platforms/members.html.slim b/app/views/platforms/platforms/members.html.slim index ebbf4e2bd..70eee08db 100644 --- a/app/views/platforms/platforms/members.html.slim +++ b/app/views/platforms/platforms/members.html.slim @@ -1,7 +1,7 @@ -set_meta_tags title: [title_object(@platform), t('layout.platforms.members')] = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row = render "shared/members_table", remove_members_path: remove_members_platform_path(@platform), diff --git a/app/views/platforms/platforms/new.html.slim b/app/views/platforms/platforms/new.html.slim index 9f576cd00..19169fc31 100644 --- a/app/views/platforms/platforms/new.html.slim +++ b/app/views/platforms/platforms/new.html.slim @@ -1,7 +1,7 @@ .container .row - .col-md-offset-2.col-md-8 + .col-md-12 = simple_form_for @platform, html: { class: 'form-horizontal' }, wrapper: :horizontal_form, wrapper_mappings: { boolean: :horizontal_boolean } do |f| diff --git a/app/views/platforms/platforms/show.html.slim b/app/views/platforms/platforms/show.html.slim index 1bcd2904e..eb30539e1 100644 --- a/app/views/platforms/platforms/show.html.slim +++ b/app/views/platforms/platforms/show.html.slim @@ -7,7 +7,7 @@ = render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-md-12 .row .col-md-6 h3 diff --git a/app/views/platforms/product_build_lists/new.html.slim b/app/views/platforms/product_build_lists/new.html.slim index 613fdfe9c..b85c996db 100644 --- a/app/views/platforms/product_build_lists/new.html.slim +++ b/app/views/platforms/product_build_lists/new.html.slim @@ -2,7 +2,7 @@ = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row - pbl = @product_build_list = simple_form_for @product_build_list, url: platform_product_product_build_lists_path(@platform, @product) do |f| diff --git a/app/views/platforms/product_build_lists/show.html.slim b/app/views/platforms/product_build_lists/show.html.slim index 3218d143d..be3399828 100644 --- a/app/views/platforms/product_build_lists/show.html.slim +++ b/app/views/platforms/product_build_lists/show.html.slim @@ -10,7 +10,7 @@ - product = pbl.product - platform = product.platform -.container.col-md-offset-2.col-md-8 ng-controller='ProductBuildListController' +.container.col-md-12 ng-controller='ProductBuildListController' .row h3 = t('layout.product_build_lists.main_data') diff --git a/app/views/platforms/products/edit.html.slim b/app/views/platforms/products/edit.html.slim index 73d8421b6..27161b584 100644 --- a/app/views/platforms/products/edit.html.slim +++ b/app/views/platforms/products/edit.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@product), t('title_editing')] = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row h3 = t('layout.products.edit_header') diff --git a/app/views/platforms/products/index.html.slim b/app/views/platforms/products/index.html.slim index 71b025715..9934a4106 100644 --- a/app/views/platforms/products/index.html.slim +++ b/app/views/platforms/products/index.html.slim @@ -2,7 +2,7 @@ = render 'submenu' if params[:platform_id] -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row - if policy(@platform.products.build).create? diff --git a/app/views/platforms/products/new.html.slim b/app/views/platforms/products/new.html.slim index e74fe13e5..00e4dd9a7 100644 --- a/app/views/platforms/products/new.html.slim +++ b/app/views/platforms/products/new.html.slim @@ -2,7 +2,7 @@ = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row = simple_form_for [@platform, @product] do |f| = render 'form', f: f diff --git a/app/views/platforms/products/show.html.slim b/app/views/platforms/products/show.html.slim index 20b7d8b6b..e610a11b6 100644 --- a/app/views/platforms/products/show.html.slim +++ b/app/views/platforms/products/show.html.slim @@ -7,7 +7,7 @@ = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row h3 diff --git a/app/views/platforms/repositories/index.html.slim b/app/views/platforms/repositories/index.html.slim index 43b041d16..790bcc6cc 100644 --- a/app/views/platforms/repositories/index.html.slim +++ b/app/views/platforms/repositories/index.html.slim @@ -8,7 +8,7 @@ = render 'submenu' if params[:platform_id] -.container.col-md-offset-2.col-md-8 +.container.col-md-12 - if policy(@platform.repositories.build).create? .row a.btn.btn-primary href=new_platform_repository_path(@platform) diff --git a/app/views/platforms/repositories/show.html.slim b/app/views/platforms/repositories/show.html.slim index cbc8236ce..b50509d7c 100644 --- a/app/views/platforms/repositories/show.html.slim +++ b/app/views/platforms/repositories/show.html.slim @@ -6,7 +6,7 @@ description: truncate(@repository.description, length: 200) } = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row h3 = t("layout.repositories.about") diff --git a/app/views/projects/base/_submenu.html.slim b/app/views/projects/base/_submenu.html.slim deleted file mode 100644 index fe9ae0604..000000000 --- a/app/views/projects/base/_submenu.html.slim +++ /dev/null @@ -1,57 +0,0 @@ -- content_for :submenu do - - act = action_name.to_sym; contr = controller_name.to_sym; - - github_success = @project.github_data != nil - - github_base_url = @project.github_data.html_url unless not github_success - nav.navbar.navbar-default role='navigation' - .container-fluid ng-cloak = true - / Brand and toggle get grouped for better mobile display - .navbar-header - button.navbar-toggle data-target='#submenu-navbar-collapse' data-toggle='collapse' type='button' - span.sr-only Toggle navigation - span.icon-bar - span.icon-bar - span.icon-bar - .navbar-brand - = fa_visibility_icon @project - = link_to @project.owner.uname, @project.owner - | / - = link_to @project.name, project_path(@project) - / Collect the nav links, forms, and other content for toggling - #submenu-navbar-collapse.collapse.navbar-collapse - ul.nav.navbar-nav.left-border - - if github_success - li - a href=github_base_url target="_blank" - i.fa.fa-github> - = t('project_menu.github') - - if @project.is_package - li class=('active' if contr == :build_lists) - a href=project_build_lists_path(@project) - i.fa.fa-cogs> - = t('project_menu.builds') - - - if github_success and @project.github_data.has_issues - li - a href=(github_base_url + "/issues") target="_blank" - i.fa.fa-exclamation-circle> - = t('project_menu.tracker', count: @project.github_data.open_issues_count) - - if github_success - li - a href=(github_base_url + "/pulls") target="_blank" - i.fa.fa-tasks> - = t('project_menu.pull_requests') - - if github_success and @project.github_data.has_wiki - li - a href=(github_base_url + "/wiki") target="_blank" - i.fa.fa-book> - = t('project_menu.wiki') - - if policy(@project).update? - li class=('active' if act.in?(%i[edit update sections]) && contr == :projects) - a href=edit_project_path(@project) - i.fa.fa-cog> - = t('project_menu.settings') - - if contr == :build_lists && act == :index - .clearfix - == render 'server_status' - / /.navbar-collapse - / /.container-fluid diff --git a/app/views/projects/build_lists/_build_lists_ajax.json.jbuilder b/app/views/projects/build_lists/_build_lists_ajax.json.jbuilder deleted file mode 100644 index bb9eaa923..000000000 --- a/app/views/projects/build_lists/_build_lists_ajax.json.jbuilder +++ /dev/null @@ -1,30 +0,0 @@ -json.build_lists @build_lists do |bl| - json.id bl.id - json.path build_list_path(bl) - json.human_status bl.human_status - - json.version do - json.name build_list_version_name(bl) - json.path get_build_list_version_path(bl) - json.release get_version_release(bl) - end - - if bl.build_for_platform && bl.save_to_platform.personal? - build_for = " (#{bl.build_for_platform.name})" - end - - json.save_to_repository do - json.path platform_repository_path(bl.save_to_platform, bl.save_to_repository) - json.name "#{bl.save_to_platform.name}/#{bl.save_to_repository.name}#{build_for}" - end - - json.arch bl.arch.try(:name) || t('layout.arches.unexisted_arch') - json.user do - json.path user_path(bl.user) if bl.user - json.fullname bl.user.try(:fullname) - end - - json.updated_at bl.updated_at -end - -json.total_items @total_build_lists diff --git a/app/views/projects/build_lists/_filter.html.slim b/app/views/projects/build_lists/_filter.html.slim index e7cb640ff..0741171a5 100644 --- a/app/views/projects/build_lists/_filter.html.slim +++ b/app/views/projects/build_lists/_filter.html.slim @@ -1,92 +1,60 @@ -- html_options = { class: 'form-control' } -.panel.panel-info - .panel-heading.pointer ng-click = 'isOpenFilters = !isOpenFilters' - span.fa.fa-filter.fa-lg - =< t 'layout.build_lists.filters' - span.pull-right.fa ng-class = "{'fa-chevron-down': isOpenFilters, 'fa-chevron-up': !isOpenFilters}" - .panel-body ng-show = 'isOpenFilters' - = form_for :filter, html: { class: :form, id: 'monitoring_filter' }, authenticity_token: false do |f| - .row +script type="text/ng-template" id="build_list_filters.html" + .modal-header + | Bleh + .modal-body + .row + - html_options = { class: 'form-control' } + = form_for :filter, html: { id: 'monitoring_filter' }, authenticity_token: false do |f| .col-xl-12.col-md-4 h4= t 'layout.build_lists.ownership.header' - =f.hidden_field :ownership, value: '{{params.filter.ownership}}' if current_user .btn-group.btn-group-justified - ['owned', (@project ? nil : 'related'), 'everything'].compact.each do |ownership| .btn-group - button.btn.btn-default[ ng-model = 'params.filter.ownership' - btn-radio = "'#{ownership}'" - type = 'button' - disabled = !current_user ] + label.btn.btn-default [ ng-model = 'params.ownership' + uib-btn-radio = "'#{ownership}'" ] = t "layout.build_lists.ownership.#{ownership}" h4= t 'number_rows' - =hidden_field_tag :per_page, '{{params.per_page}}' - =hidden_field_tag :page, '{{params.page}}' .btn-group.btn-group-justified -BuildList::Filter::PER_PAGE.each do |num| .btn-group - button.btn.btn-default[ ng-model = 'params.per_page' btn-radio = "'#{num}'" type = 'button' ]= num + label.btn.btn-default[ ng-model = 'params.per_page' uib-btn-radio = "'#{num}'" ]= num h4= t 'activerecord.attributes.build_list.status' = f.select :status, BuildList::STATUSES.collect{ |status| [BuildList.human_status(status), status] }, { include_blank: true }, - html_options.merge(id: 'status', 'ng-model' => 'params.filter.status') + html_options.merge(id: 'status', 'ng-model' => 'params.status') .col-xl-12.col-md-4 h4= t 'activerecord.models.platform' = f.select :save_to_platform_id, filter_by_save_to_platform, { include_blank: true }, - html_options.merge(id: 'platform', 'ng-model' => 'params.filter.save_to_platform_id') + html_options.merge(id: 'platform', 'ng-model' => 'params.save_to_platform_id') h4= t 'activerecord.attributes.build_list.arch' = f.select :arch_id, Arch.recent.collect{ |arch| [arch.name, arch.id] }, { include_blank: true }, - html_options.merge(id: 'architecture', 'ng-model' => 'params.filter.arch_id') + html_options.merge(id: 'architecture', 'ng-model' => 'params.arch_id') h4= t 'activerecord.models.mass_build' = f.select :mass_build_id, mass_build_options, { include_blank: true }, - html_options.merge(id: 'mass_build', 'ng-model' => 'params.filter.mass_build_id') + html_options.merge(id: 'mass_build', 'ng-model' => 'params.mass_build_id') .col-xl-12.col-md-4 .row ng-controller = 'DatePickerController as datePickerCtrl' -[:updated_at_start, :updated_at_end].each do |attr| - .col-xl-12.col-md-6 - h4= t attr == :updated_at_start ? '_on' : 'until' - = f.text_field attr, size: 10, class: 'form-control', - 'datepicker-popup' => '{{datePickerCtrl.format}}', - 'ng-model' => "$scope.$parent.params.filter.#{attr}", - 'is-open' => "datePickerCtrl.#{attr}_opened", - min: 'datePickerCtrl.minDate', - max: 'datePickerCtrl.maxDate', - 'datepicker-options' => 'datePickerCtrl.dateOptions', - 'date-disabled' => "datePickerCtrl.disabled(date, mode)", - 'ng-click' => "datePickerCtrl.open_#{attr}($event)" - h4.medium= t 'layout.build_lists.project_name_search' - input#filter_project_name.form-control[ name = 'filter[project_name]' - size = '30' - type = 'text' - value = '{{params.filter.filter_project_name}}' - disabled = @project.present? ] + h4= t attr == :updated_at_start ? '_on' : 'until' + = f.text_field attr, size: 10, class: 'form-control', + 'uib-datepicker-popup' => '{{datePickerCtrl.format}}', + 'ng-model' => "$scope.$parent.params.#{attr}", + 'is-open' => "datePickerCtrl.#{attr}_opened", + min: 'datePickerCtrl.minDate', + max: 'datePickerCtrl.maxDate', + 'datepicker-options' => 'datePickerCtrl.dateOptions', + 'date-disabled' => "datePickerCtrl.disabled(date, mode)", + 'ng-click' => "datePickerCtrl.open_#{attr}($event)" - h4= t 'layout.build_lists.id_search' - input#filter_id.form-control[ name = 'filter{id}' - size = '30' - type = 'text' - value = '{{params.filter.id}}' - disabled = @project.present? ] - - .clearfix - .col-xl-12.col-md-4.offset10 - = label_tag :autoreload do - = check_box_tag :autoreload, true, true - = t 'layout.autoreload_page' - .col-xl-12.col-xl-offset-0.col-md-4.col-md-offset-4.offset10 - .btn-group.btn-group-justified - .btn-group ng-show = 'isRequest' - button.btn.btn-default type = 'button' disabled = true - = t('layout.processing') - .btn-group ng-hide = 'isRequest' - button.btn.btn-primary type = 'button' ng-click = 'refresh(true)' - i.fa.fa-search - = t('layout.search.header') - .btn-group - button.btn.btn-primary[ type = 'button' ng-click = 'clear()' ]= t('reset') + .modal-footer + button.btn.btn-primary type = 'button' ng-click = 'apply()' + i.fa.fa-search + = t('layout.search.header') + button.btn.btn-primary[ type = 'button' ng-click = 'reset()' ]= t('reset') diff --git a/app/views/projects/build_lists/_item_groups.html.slim b/app/views/projects/build_lists/_item_groups.html.slim index d9e65c749..9696cf16a 100644 --- a/app/views/projects/build_lists/_item_groups.html.slim +++ b/app/views/projects/build_lists/_item_groups.html.slim @@ -1,26 +1,23 @@ -.row - h3 - = t('layout.build_lists.items_header') - h4 ng-hide='build_list.item_groups' - = t("layout.build_lists.no_items_data") +rd-widget ng-show='build_list.item_groups' + rd-widget-header title=t('layout.build_lists.items_header') + rd-widget-body + div ng-repeat='group in build_list.item_groups' + .row ng-repeat='item in group' + h4 + | {{item.name + ' #' + item.level}} -div ng-repeat='group in build_list.item_groups' - .row ng-repeat='item in group' - h4 - | {{item.name + ' #' + item.level}} - - table.table - thead - tr - th= t('activerecord.attributes.build_list/item.name') - th= t('activerecord.attributes.build_list/item.version') - th= t('activerecord.attributes.build_list/item.status') - tbody - tr class="{{build_list.itemStatusColor(item.status)}}" - td - | {{item.name}} - td - a ng-href='{{item.path.href}}' - | {{item.path.text}} - td - | {{build_list.humanStatus(item.status) | i18n}} \ No newline at end of file + table.table + thead + tr + th= t('activerecord.attributes.build_list/item.name') + th= t('activerecord.attributes.build_list/item.version') + th= t('activerecord.attributes.build_list/item.status') + tbody + tr class="{{build_list.itemStatusColor(item.status)}}" + td + | {{item.name}} + td + a ng-href='{{item.path.href}}' + | {{item.path.text}} + td + | {{build_list.humanStatus(item.status) | i18n}} \ No newline at end of file diff --git a/app/views/projects/build_lists/_packages.html.slim b/app/views/projects/build_lists/_packages.html.slim index 3719a8ee7..39b386ea2 100644 --- a/app/views/projects/build_lists/_packages.html.slim +++ b/app/views/projects/build_lists/_packages.html.slim @@ -1,51 +1,50 @@ -.row ng-show='build_list.packages' - hr - h3 - = t('layout.build_lists.packages_header') - table.table.table-hover - thead - tr - th - th= t('activerecord.attributes.build_list/package.fullname') - th= t('activerecord.attributes.build_list/package.name') - th= t('activerecord.attributes.build_list/package.epoch') - th= t('activerecord.attributes.build_list/package.version') - th= t('activerecord.attributes.build_list/package.release') - tbody - tr ng-repeat-start='package in build_list.packages' - td - a.expand ng-show='package.dependent_projects' - span.fa.fa-chevron-up[ - ng-show = 'package.show_dependent_projects' - ng-click = 'package.show_dependent_projects = false' ] - span.fa.fa-chevron-down[ - ng-hide = 'package.show_dependent_projects' - ng-click = 'package.show_dependent_projects = true' ] - td - div ng-if='!package.url' - | {{package.fullname}} - a ng-if='package.url' ng-href="{{package.url}}" - | {{package.fullname}} - td - | {{package.name}} - td - | {{package.epoch}} - td - | {{package.version}} - td - | {{package.release}} +rd-widget ng-show='build_list.packages' + rd-widget-header title=t('layout.build_lists.packages_header') + rd-widget-body class="no-padding" + table.table.table-hover + thead + tr + th + th= t('activerecord.attributes.build_list/package.fullname') + th= t('activerecord.attributes.build_list/package.name') + th= t('activerecord.attributes.build_list/package.epoch') + th= t('activerecord.attributes.build_list/package.version') + th= t('activerecord.attributes.build_list/package.release') + tbody + tr ng-repeat-start='package in build_list.packages' + td + a.expand ng-show='package.dependent_projects' + span.fa.fa-chevron-up[ + ng-show = 'package.show_dependent_projects' + ng-click = 'package.show_dependent_projects = false' ] + span.fa.fa-chevron-down[ + ng-hide = 'package.show_dependent_projects' + ng-click = 'package.show_dependent_projects = true' ] + td + div ng-if='!package.url' + | {{package.fullname}} + a ng-if='package.url' ng-href="{{package.url}}" + | {{package.fullname}} + td + | {{package.name}} + td + | {{package.epoch}} + td + | {{package.version}} + td + | {{package.release}} - tr[ - ng-repeat-end = '' - ng-show = 'package.show_dependent_projects' - ng-repeat = 'project in package.dependent_projects' ] - td - td - a ng-href="{{project.url}}" - | {{project.name}} - td - p ng-repeat='package in project.dependent_packages' - | {{package}} - td colspan=3 - a ng-href='{{project.new_url}}' - = t('layout.build_lists.create_build_list') \ No newline at end of file + tr[ + ng-repeat-end = '' + ng-show = 'package.show_dependent_projects' + ng-repeat = 'project in package.dependent_projects' ] + td + td + a ng-href="{{project.url}}" + | {{project.name}} + td + p ng-repeat='package in project.dependent_packages' + | {{package}} + td colspan=3 + a ng-href='{{project.new_url}}' + = t('layout.build_lists.create_build_list') \ No newline at end of file diff --git a/app/views/projects/build_lists/_platform_build_list.html.haml b/app/views/projects/build_lists/_platform_build_list.html.haml deleted file mode 100644 index 750e324c1..000000000 --- a/app/views/projects/build_lists/_platform_build_list.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%tr{id: "row#{platform_build_list_counter}"} - %td= link_to platform_build_list.id, platform_build_list - %td= platform_build_list.human_status - %td= link_to platform_build_list.project.name, platform_build_list.project - %td= platform_build_list.updated_at diff --git a/app/views/projects/build_lists/_recreate_build_list.html.haml b/app/views/projects/build_lists/_recreate_build_list.html.haml deleted file mode 100644 index 4a0890e66..000000000 --- a/app/views/projects/build_lists/_recreate_build_list.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -= form_for [build_list.project, build_list.project.build_lists.new], html: { class: :form, method: :post } do |f| - = hidden_field_tag :build_list_id, build_list.id - = f.hidden_field :project_id - = f.submit t('layout.build_lists.recreate_build_list'), data: {'disable-with' => t('layout.processing')} -.both \ No newline at end of file diff --git a/app/views/projects/build_lists/_submenu.html.slim b/app/views/projects/build_lists/_submenu.html.slim deleted file mode 100644 index c51e96fee..000000000 --- a/app/views/projects/build_lists/_submenu.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -- content_for :submenu do - nav.navbar.navbar-default.submenu role="navigation" - .container-fluid ng-cloak = true - .navbar-header - ul.nav.navbar-nav - - if @build_list && @build_list.project - li - = link_to project_path(@build_list.project) do - = fa_visibility_icon @build_list.project - = @build_list.project.name_with_owner - - else - li class=('active' if controller_name == 'build_lists') - = link_to t('layout.projects.list_header'), build_lists_path - li class=('active' if controller_name == 'product_build_lists') - = link_to t('layout.products.list_header'), product_build_lists_path - - == render 'server_status' if action_name == 'index' diff --git a/app/views/projects/build_lists/index.html.slim b/app/views/projects/build_lists/index.html.slim deleted file mode 100644 index e95aedca0..000000000 --- a/app/views/projects/build_lists/index.html.slim +++ /dev/null @@ -1,91 +0,0 @@ --set_meta_tags title: t('.title') - -.row.offset10 ng-controller = 'BuildListsController' ng-init = 'init()' ng-cloak = true - = hidden_field_tag :name_with_owner, @project.try(:name_with_owner) - .col-xl-2.col-sm-12 - -if @project && policy(@project.build_lists.build).create? - - button.btn.btn-primary.btn-block[ id = 'filter_new_build' - type = 'button' - onclick = "location.href='#{new_project_build_list_path(@project)}'" ] - i.fa.fa-plus - =< t('layout.build_lists.new_header') - .offset10 - == render 'filter' - .col-xl-10.col-sm-12 - table.table.table-condensed - thead - tr - th - th= t('activerecord.attributes.build_list.id') - th= t('activerecord.attributes.build_list.status') - th= t('activerecord.attributes.build_list.project') - th= t('diff') - th= t('activerecord.attributes.build_list.project_version') - th= t('activerecord.attributes.build_list.save_to_repository') - th= t('activerecord.attributes.build_list.arch_short') - th= t('activerecord.attributes.build_list.user') - th= t('activerecord.attributes.build_list.hostname') - th= t('activerecord.attributes.build_list.updated_at') - tbody - tr[ ng-repeat = 'bl in build_lists' - class = '{{bl.status_color}}' - id = 'build-list-{{bl.id}}' - ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" - ng-show = 'bl.show' ] - td.build-list-chevrons - a.expand ng-show = 'bl.hasRelated' - span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' - span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' - / id - td.build-list-statuses - - a[ ng-href = '{{bl.url}}' ] {{bl.id}} - div ng-show = 'bl.hasRelated' - div[ ng-repeat = 'related in bl.related' ng-class = '"status bg-" + related.status_color']   - - / status - td - | {{bl.human_status | i18n}} - br - time ng-show = 'bl.duration' - | {{bl.duration}} - time ng-show = 'bl.average_build_time' - | /{{bl.average_build_time}} - - / project - td.centered ng-hide = 'bl.project' colspan = 2 - = t('layout.projects.unexisted_project') - td ng-show = 'bl.project' - a[ ng-href = '{{bl.project.url}}' ] {{bl.project.name_with_owner}} - - / diff - td - a ng-href = '{{bl.version_link_url}}' ng-show = 'bl.project' - | {{bl.version_link_text}} - - / project_version - td[] {{bl.version_release}} - - / save_to_repository - td - a[ ng-href = '{{bl.save_to_repository_url}}' ] {{bl.save_to_repository_name}} - - / arch_short - td[ ng-show = 'bl.arch' ] {{bl.arch.name}} - td[ ng-hide = 'bl.arch' ]= t('layout.arches.unexisted_arch') - - / user - td - a[ ng-href = '{{bl.user.url}}' ] {{bl.user.fullname}} - - / hostname - td[] {{bl.hostname}} - - / updated_at - td title = '{{bl.updated_at_utc}}' - | {{ bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} - - == angularjs_paginate( per_page: 'params.per_page' ) - -== render @project ? 'projects/base/submenu' : 'projects/build_lists/submenu' diff --git a/app/views/projects/build_lists/new.html.slim b/app/views/projects/build_lists/new.html.slim index ce7722694..3b670544a 100644 --- a/app/views/projects/build_lists/new.html.slim +++ b/app/views/projects/build_lists/new.html.slim @@ -1,6 +1,7 @@ -set_meta_tags title: [title_object(@project), t('layout.build_lists.new_header')] -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'NewBuildListController as newBuildCtrl' ng-cloak = true - #new_form== render 'projects/build_lists/new_build/new_form', project: @project, build_list: @build_list - br - == render 'projects/build_lists/new_build/last_build_lists', project: @project - == render 'projects/base/submenu' +.row.top-space + .col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'NewBuildListController as newBuildCtrl' ng-cloak = true + rd-widget + rd-widget-header title=(t('layout.build_lists.new_header') + ' | ' + title_object(@project)) + rd-widget-body + == render 'projects/build_lists/new_build/new_form', project: @project, build_list: @build_list \ No newline at end of file diff --git a/app/views/projects/build_lists/new_build/_last_build_lists.html.slim b/app/views/projects/build_lists/new_build/_last_build_lists.html.slim deleted file mode 100644 index 1e2597767..000000000 --- a/app/views/projects/build_lists/new_build/_last_build_lists.html.slim +++ /dev/null @@ -1,53 +0,0 @@ -h3= t 'layout.build_lists.last_build_lists' -h4= t 'layout.relations.filters' - -.checkbox - label - = check_box_tag :owner_filter_build_lists, true, - (params[:owner_filter] || 'true') == 'true', - 'ng-click' => 'newBuildCtrl.updateFilterOwner()', - 'ng-value' => 'newBuildCtrl.last_builds_filter.owner' - = t 'layout.build_lists.only_my_build_lists' - -.checkbox - label - = check_box_tag :status_filter_build_lists, true, - (params[:status_filter] || 'true') == 'true', - 'ng-value' => 'newBuildCtrl.last_builds_filter.status', - 'ng-click' => 'newBuildCtrl.updateFilterStatus()' - = t 'layout.build_lists.failed_build_lists' - -table.table - thead - tr - th= t('activerecord.attributes.build_list.id') - th= t('activerecord.attributes.build_list.status') - th= t('diff') - th= t('activerecord.attributes.build_list.project_version') - th= t('activerecord.attributes.build_list.save_to_repository') - th= t('activerecord.attributes.build_list.arch_short') - th= t('activerecord.attributes.build_list.user') - th= t('activerecord.attributes.build_list.updated_at') - tbody - tr[ ng-repeat = 'last in newBuildCtrl.last_build_lists' ] - td - a[ ng-href = '{{ last.path }}' ] {{ last.id }} - br - a[ ng-click = 'newBuildCtrl.cloneBuildList(last.id)' href = '#new_build_list' ]= t 'layout.clone' - td[] {{ last.human_status }} - td - a[ ng-href = '{{ last.version.path }}' ] {{ last.version.name }} - td[] {{ last.version.release }} - td - a[ ng-href = '{{ last.save_to_repository.path }}' ] {{ last.save_to_repository.name }} - td[] {{ last.arch }} - td - a[ ng-href = '{{ last.user.path }}' ] {{ last.user.fullname }} - td - span[ am-time-ago = 'last.updated_at' - title = "{{ last.updated_at | amDateFormat:'ddd, LLL' }}" ] - -= angularjs_paginate( per_page: BuildList.per_page, - total_items: 'newBuildCtrl.total_items', - page: 'newBuildCtrl.page', - select_page: 'newBuildCtrl.goToPage(newBuildCtrl.page)' ) diff --git a/app/views/projects/build_lists/show.html.slim b/app/views/projects/build_lists/show.html.slim index 8abc9f21c..4889c0d47 100644 --- a/app/views/projects/build_lists/show.html.slim +++ b/app/views/projects/build_lists/show.html.slim @@ -1,202 +1,193 @@ - title = title_object(@build_list.project) - set_meta_tags title: [title, t('activerecord.models.build_list')] -- description = @build_list.packages.map(&:fullname) * ', ' -- title = t('activerecord.models.build_list') + ' - ' + title -- set_meta_tags og: { title: title, description: truncate(description, length: 255) } -- set_meta_tags twitter: { title: title, description: truncate(description, length: 200) } - -= render 'submenu' - -row[ ng-controller='BuildListController' +div[ ng-controller='BuildListController' ng-cloak =true ] - = hidden_field_tag :build_list_id, @build_list.id - .col-md-8.col-md-offset-2.alert.alert-info - .alert.pull-left.submenu ng-class='"alert-" + build_list.status_color' - p - | {{build_list.human_status | i18n}} + .row.top-space + = hidden_field_tag :build_list_id, @build_list.id + .col-md-12 + .alert.pull-left ng-class='"alert-" + build_list.status_color' + p + | {{build_list.human_status | i18n}} - p.alert.alert-info.pull-right.submenu title = '{{build_list.updated_at_utc}}' - | {{ build_list.updated_at | amDateFormat:'ddd, D MMM YYYY, HH:mm' }} ( - span am-time-ago = 'build_list.updated_at' - | ) + p.alert.alert-info.pull-right title = '{{build_list.updated_at_utc}}' + | {{ build_list.updated_at | amDateFormat:'ddd, D MMM YYYY, HH:mm' }} ( + span am-time-ago = 'build_list.updated_at' + | ) - .col-md-8.col-md-offset-2 - - = form_for @build_list, url: publish_build_list_path(@build_list) do |f| - - h3= t('layout.build_lists.main_data') - table.table.table-borderless.table-condensed - thead - tr - th.col-md-4 - th - tr - td= t('activerecord.attributes.build_list.container_path') - td - - url = container_url - = link_to url, url, - 'ng-show' => "build_list.container_status == #{ BuildList::BUILD_PUBLISHED }" - p ng-show="build_list.container_status == #{ BuildList::BUILD_PUBLISH }" - = t('layout.build_lists.creating') - - tr - td= t('activerecord.attributes.build_list.id') - td= @build_list.id - - tr - td= t('activerecord.attributes.build_list.user') - td= link_to @build_list.user.try(:fullname), @build_list.user - - tr - td= t('activerecord.attributes.build_list.publisher') - td ng-show='build_list.publisher' - a ng-href='{{build_list.publisher.path}}' - | {{build_list.publisher.fullname}} - - tr - td= t('activerecord.attributes.build_list.build_for_platform') - td - - if bfp = @build_list.build_for_platform - = link_to bfp.name, bfp - - else - = t('layout.build_lists.platform_deleted') - - tr - td= t('activerecord.attributes.build_list.save_to_repository') - td - = link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", - [@build_list.save_to_platform, @build_list.save_to_repository] - - tr - td= t('activerecord.attributes.build_list.include_testing_subrepository') - td= t("layout.#{@build_list.include_testing_subrepository?}_") - - tr - td= t('activerecord.attributes.build_list.include_repos') - td= Repository.where(id: @build_list.include_repos).pluck(:name).join(', ') - - tr - td= t('activerecord.attributes.build_list.auto_publish_status') - td= t("layout.build_lists.auto_publish_status.#{@build_list.auto_publish_status}") - - tr - td= t('activerecord.attributes.build_list.auto_create_container') - td= t("layout.#{@build_list.auto_create_container?}_") - - tr - td= t('activerecord.attributes.build_list.use_cached_chroot') - td= t("layout.#{@build_list.use_cached_chroot?}_") - - tr - td= t('activerecord.attributes.build_list.use_extra_tests') - td= t("layout.#{@build_list.use_extra_tests?}_") - - tr - td= t('activerecord.attributes.build_list.save_buildroot') - td= t("layout.#{@build_list.save_buildroot?}_") - - tr - td= t('activerecord.attributes.build_list.project_version') - -# td= link_to @build_list.project_version, tree_path(@build_list.project, @build_list.project_version) - - tr - td= t('diff') - td= build_list_version_link(@build_list) - - tr - td= t('activerecord.attributes.build_list.arch') - td= @build_list.arch.name - - tr - td= t('activerecord.attributes.build_list.hostname') - td= @build_list.hostname - - tr.bg-danger ng-show = 'build_list.fail_reason' - td= t('activerecord.attributes.build_list.fail_reason') - td - | {{build_list.fail_reason}} - - tr - td= t('activerecord.attributes.build_list.updated_at') - td - | {{build_list.updated_at_utc}} - - - if @build_list.external_nodes.present? - tr - td= t('activerecord.attributes.build_list.external_nodes') - td= I18n.t("layout.build_lists.external_nodes.#{@build_list.external_nodes}") - - tr - td= t('activerecord.attributes.build_list.builder') - td - a ng-href='{{build_list.builder.path}}' ng-show = 'build_list.builder' - | {{build_list.builder.fullname}} - - tr - td= t('activerecord.attributes.build_list.is_circle') - td= t("layout.#{@build_list.is_circle?}_") - - - if @build_list.extra_build_lists.present? || @build_list.extra_repositories.present? - tr - td= t('activerecord.attributes.build_list.extra_repositories') - td - - Repository.where(id: @build_list.extra_repositories).each do |repo| - p - = link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] - - BuildList.where(id: @build_list.extra_build_lists).each do |bl| - p - = link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl - - - if @build_list.extra_params.present? - tr - td= t('activerecord.attributes.build_list.extra_params.label') - td - - @build_list.extra_params.each do |k, v| + .row + .col-md-12 + rd-widget + rd-widget-header title=t('layout.build_lists.main_data') + rd-widget-body class="no-padding" + table.table.table-borderless.table-condensed tr + td= t('activerecord.attributes.build_list.container_path') td - i - = t("activerecord.attributes.build_list.extra_params.#{k}") + - url = container_url + = link_to url, url, + 'ng-show' => "build_list.container_status == #{ BuildList::BUILD_PUBLISHED }" + p ng-show="build_list.container_status == #{ BuildList::BUILD_PUBLISH }" + = t('layout.build_lists.creating') + + tr + td= t('activerecord.attributes.build_list.id') + td= @build_list.id + + tr + td= t('activerecord.attributes.build_list.user') + td= link_to @build_list.user.try(:fullname), @build_list.user + + tr ng-show='build_list.publisher' + td= t('activerecord.attributes.build_list.publisher') td - = v + a ng-href='{{build_list.publisher.path}}' + | {{build_list.publisher.fullname}} - - if @build_list.mass_build_id.present? - tr - td= t('activerecord.attributes.mass_build_id') - td - = link_to @build_list.mass_build.name, - platform_mass_build_path(@build_list.save_to_platform, @build_list.mass_build_id) + tr + td= t('activerecord.attributes.build_list.build_for_platform') + td + - if bfp = @build_list.build_for_platform + = link_to bfp.name, bfp + - else + = t('layout.build_lists.platform_deleted') - tr ng-show='build_list.human_duration' - td - td - | {{build_list.human_duration }} + tr + td= t('activerecord.attributes.build_list.save_to_repository') + td + = link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", + [@build_list.save_to_platform, @build_list.save_to_repository] - tr.alert.alert-danger ng-hide='build_list.extra_build_lists_published' - td colspan=2 - = t('layout.build_lists.publish_with_extra_fail') + tr + td= t('activerecord.attributes.build_list.include_testing_subrepository') + td= t("layout.#{@build_list.include_testing_subrepository?}_") - - unless @build_list.valid_branch_for_publish? - tr.alert.alert-danger - td colspan=2 - = t('layout.build_lists.wrong_branch_for_publish_html', - branch: @build_list.save_to_repository.publish_builds_only_from_branch) + tr + td= t('activerecord.attributes.build_list.include_repos') + td= Repository.where(id: @build_list.include_repos).pluck(:name).join(', ') - tr.alert.alert-danger ng-show='build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository' - td colspan=2 - = t('flash.build_list.not_all_build_lists_success') + tr + td= t('activerecord.attributes.build_list.auto_publish_status') + td= t("layout.build_lists.auto_publish_status.#{@build_list.auto_publish_status}") - hr - .row - = render 'buttons', build_list: @build_list + tr + td= t('activerecord.attributes.build_list.auto_create_container') + td= t("layout.#{@build_list.auto_create_container?}_") - .row.offset10 ng-show="build_list.status == #{BuildList::BUILD_STARTED}" - = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } + tr + td= t('activerecord.attributes.build_list.use_cached_chroot') + td= t("layout.#{@build_list.use_cached_chroot?}_") - hr + tr + td= t('activerecord.attributes.build_list.use_extra_tests') + td= t("layout.#{@build_list.use_extra_tests?}_") + + tr + td= t('activerecord.attributes.build_list.save_buildroot') + td= t("layout.#{@build_list.save_buildroot?}_") + + tr + td= t('activerecord.attributes.build_list.project_version') + td= @build_list.project_version + + tr + td= t('diff') + td= build_list_version_link(@build_list) + + tr + td= t('activerecord.attributes.build_list.arch') + td= @build_list.arch.name + + tr + td= t('activerecord.attributes.build_list.hostname') + td= @build_list.hostname + + tr.bg-danger ng-show = 'build_list.fail_reason' + td= t('activerecord.attributes.build_list.fail_reason') + td + | {{build_list.fail_reason}} + + tr + td= t('activerecord.attributes.build_list.updated_at') + td + | {{build_list.updated_at_utc}} + + - if @build_list.external_nodes.present? + tr + td= t('activerecord.attributes.build_list.external_nodes') + td= I18n.t("layout.build_lists.external_nodes.#{@build_list.external_nodes}") + + tr ng-show = 'build_list.builder' + td= t('activerecord.attributes.build_list.builder') + td + a ng-href='{{build_list.builder.path}}' + | {{build_list.builder.fullname}} + + tr + td= t('activerecord.attributes.build_list.is_circle') + td= t("layout.#{@build_list.is_circle?}_") + + - if @build_list.extra_build_lists.present? || @build_list.extra_repositories.present? + tr + td= t('activerecord.attributes.build_list.extra_repositories') + td + - Repository.where(id: @build_list.extra_repositories).each do |repo| + p + = link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] + - BuildList.where(id: @build_list.extra_build_lists).each do |bl| + p + = link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl + + - if @build_list.extra_params.present? + tr + td= t('activerecord.attributes.build_list.extra_params.label') + td + - @build_list.extra_params.each do |k, v| + tr + td + i + = t("activerecord.attributes.build_list.extra_params.#{k}") + td + = v + + - if @build_list.mass_build_id.present? + tr + td= t('activerecord.attributes.mass_build_id') + td + = link_to @build_list.mass_build.name, + platform_mass_build_path(@build_list.save_to_platform, @build_list.mass_build_id) + + tr ng-show='build_list.human_duration' + td + td + | {{build_list.human_duration }} + + tr.alert.alert-danger ng-hide='build_list.extra_build_lists_published' + td colspan=2 + = t('layout.build_lists.publish_with_extra_fail') + + - unless @build_list.valid_branch_for_publish? + tr.alert.alert-danger + td colspan=2 + = t('layout.build_lists.wrong_branch_for_publish_html', + branch: @build_list.save_to_repository.publish_builds_only_from_branch) + + tr.alert.alert-danger ng-show='build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository' + td colspan=2 + = t('flash.build_list.not_all_build_lists_success') + rd-widget-footer + = form_for @build_list, url: publish_build_list_path(@build_list), html: {class: :"form-inline"} do |f| + = render 'buttons', build_list: @build_list + + .row.top-space ng-show="build_list.status == #{BuildList::BUILD_STARTED}" + = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } + + .row.top-space + .col-md-12 = render 'item_groups' - = render 'packages' - .row - hr - = render 'shared/build_results', subject: @build_list + .row.top-space + .col-md-6 + = render 'packages' + .col-md-6 + = render 'shared/build_results', subject: @build_list \ No newline at end of file diff --git a/app/views/projects/projects/_aliases.html.slim b/app/views/projects/projects/_aliases.html.slim deleted file mode 100644 index 0f8b03029..000000000 --- a/app/views/projects/projects/_aliases.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -.col-sm-9.col-sm-offset-3 - - h3= t('.header') - - table.table.table-condensed.offset10 - thead - tr - th= t('.name') - tbody - - @project_aliases.each do |project| - tr - td - = fa_visibility_icon @project - = link_to project.name_with_owner, project_path(project) - = will_paginate @project_aliases diff --git a/app/views/projects/projects/_build_schedule.html.slim b/app/views/projects/projects/_build_schedule.html.slim index a31a6aadc..65736dc5b 100644 --- a/app/views/projects/projects/_build_schedule.html.slim +++ b/app/views/projects/projects/_build_schedule.html.slim @@ -1,28 +1,30 @@ -.col-sm-9.col-sm-offset-3[ ng-controller = 'ProjectScheduleController' - ng-init = "name_with_owner = '#{@project.name_with_owner}'" - ng-cloak = 'true' ] +.row.top-space + rd-widget + rd-widget-header title=t("layout.projects.build_schedule") + rd-widget-body + .row[ ng-controller = 'ProjectScheduleController' + ng-init = "name_with_owner = '#{@project.name_with_owner}'" + ng-cloak = 'true' ] - h3= t("layout.projects.build_schedule") + => t('activerecord.attributes.project.autostart_status') - => t('activerecord.attributes.project.autostart_status') + select[ ng-options = 'k as (v | i18n) for (k, v) in statuses' + ng-model = 'autostart_status' + ng-change = 'updateStatus()' + ng-init = "autostart_status = '#{@project.autostart_status}'" ] + option[ value = '' ] - select[ ng-options = 'k as (v | i18n) for (k, v) in statuses' - ng-model = 'autostart_status' - ng-change = 'updateStatus()' - ng-init = "autostart_status = '#{@project.autostart_status}'" ] - option[ value = '' ] - - table.table.table-condensed.offset10 - thead - tr - th= t('activerecord.attributes.repository.name') - th= t('activerecord.attributes.build_list.auto_publish_status') - th= t('activerecord.attributes.project_to_repository.enabled') - tbody[ ng-init = "items = #{available_project_to_repositories(@project)}" ] - tr[ ng-repeat = "item in items" ] - td - a[ ng-href = '{{item.repository_path}}' ] {{item.repository_name}} - td - input[ type = 'checkbox' ng-model = "item.auto_publish" ng-change = 'updateSchedule(item)' ] - td - input[ type = 'checkbox' ng-model = "item.enabled" ng-change = 'updateSchedule(item)' ] + table.table.table-condensed.offset10 + thead + tr + th= t('activerecord.attributes.repository.name') + th= t('activerecord.attributes.build_list.auto_publish_status') + th= t('activerecord.attributes.project_to_repository.enabled') + tbody[ ng-init = "items = #{available_project_to_repositories(@project)}" ] + tr[ ng-repeat = "item in items" ] + td + a[ ng-href = '{{item.repository_path}}' ] {{item.repository_name}} + td + input[ type = 'checkbox' ng-model = "item.auto_publish" ng-change = 'updateSchedule(item)' ] + td + input[ type = 'checkbox' ng-model = "item.enabled" ng-change = 'updateSchedule(item)' ] diff --git a/app/views/projects/projects/_filters.html.haml b/app/views/projects/projects/_filters.html.haml deleted file mode 100644 index 0b2c3dcbc..000000000 --- a/app/views/projects/projects/_filters.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- if current_user - %input.form-control{ name: 'search', size: '30', type: 'text', 'ng-model' => 'search', - placeholder: t('layout.find_project'), 'ng-change' => 'getProjects()' } - - if policy(:project).create? - %hr.offset10 - %p= link_to t('layout.projects.new'), new_project_path, class: 'btn btn-primary' - - if policy(:project).mass_import? - %p= link_to t('layout.projects.mass_import'), mass_import_projects_path, class: 'btn btn-primary' - - if policy(:project).mass_create? - %p= link_to t('layout.projects.mass_create'), mass_create_projects_path, class: 'btn btn-primary' - %hr.offset10 - %h3=t('layout.relations.filters') - %ul.nav.nav-pills.nav-stacked - - options_for_filters(@projects, @groups, @owners).each do |options| - %li{ 'ng-class' => "{active: #{options[:class_name]}_filter_#{options[:id]}_class}" } - %a{ href: '#', 'ng-click' => "change_#{options[:class_name]}_filter(#{options[:id]})" } - %span.badge.pull-right= options[:count] - = options[:uname] diff --git a/app/views/projects/projects/_form.html.slim b/app/views/projects/projects/_form.html.slim index 3ce2236a7..b8fbd9c09 100644 --- a/app/views/projects/projects/_form.html.slim +++ b/app/views/projects/projects/_form.html.slim @@ -1,5 +1,5 @@ - act = controller.action_name.to_sym -div ng-controller = 'ProjectFromController' ng-cloak = 'true' +div ng-controller = 'ProjectFormController' ng-cloak = 'true' = f.input :name = f.input :github_organization @@ -39,12 +39,13 @@ div ng-controller = 'ProjectFromController' ng-cloak = 'true' - if [:new, :create].include? act = f.input :srpm, as: :file - .col-sm-offset-3.col-sm-9 - = submit_button_tag + .form-group + .col-sm-offset-3.col-sm-9 + = submit_button_tag - content_for :additional_scripts do javascript: - RosaABF.controller('ProjectFromController', ['$scope', function($scope) { + RosaABF.controller('ProjectFormController', ['$scope', function($scope) { $scope.project = { is_package: #{@project.is_package}, publish_i686_into_x86_64: #{@project.publish_i686_into_x86_64} diff --git a/app/views/projects/projects/_project.html.haml b/app/views/projects/projects/_project.html.haml deleted file mode 100644 index f67a4424d..000000000 --- a/app/views/projects/projects/_project.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%tr{id: "Row#{project_counter}"} - %td - = link_to project do - .table-sort-left= image_tag visibility_icon(project.visibility) - .table-sort-right= link_to project.name_with_owner, project_path(project) - - alone_member = alone_member? project - %td - - c = participant_class(alone_member, project) - %span{class: c, title: t("layout.relations.#{c}")} - = t("layout.collaborators.role_names.#{current_user.best_role project}") - %td.td5 - - unless project.owner == current_user or !alone_member - = link_to remove_user_project_path(project), method: :delete, data: { confirm: t("layout.confirm") } do - %span.delete   diff --git a/app/views/projects/projects/_project.json.jbuilder b/app/views/projects/projects/_project.json.jbuilder deleted file mode 100644 index 18bf8b43a..000000000 --- a/app/views/projects/projects/_project.json.jbuilder +++ /dev/null @@ -1,18 +0,0 @@ -json.project do |proj| - proj.visibility project.visibility.to_s - - proj.name project.name_with_owner - proj.link project_path(project) - - proj.role t("layout.collaborators.role_names.#{current_user.best_role project}").force_encoding(Encoding::UTF_8) - - proj.leave_link remove_user_project_path(project) unless project.owner == current_user or !alone_member? project - proj.rights_class participant_class(alone_member?(project), project) - proj.title t("layout.relations.#{participant_class(alone_member?(project), project)}") - - proj.owner do |owner| - owner.name project.owner.uname - owner.type project.owner.class.to_s.underscore - owner.link project.owner.class == User ? user_path(project.owner) : group_path(project.owner) - end -end diff --git a/app/views/projects/projects/dashboard.html.slim b/app/views/projects/projects/dashboard.html.slim new file mode 100644 index 000000000..e36f7d88d --- /dev/null +++ b/app/views/projects/projects/dashboard.html.slim @@ -0,0 +1,147 @@ +.row.top-space + .col-md-6 + rd-widget + div ng-controller="ProjectsController" + rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" + input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") + ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] + rd-widget-body classes="medium no-padding" loading="requesting" + .table-responsive + table.table ng-cloak=true + thead + tr + th ng-show="search" = t 'dashboard.projects.name' + th ng-hide="search" = t 'dashboard.projects.last_projects' + th + th + tbody + tr ng-repeat = 'item in projects' + td + button[ ng-click = 'selectProject(item.name_with_owner)' + ng-disabled="ProjectSelectService.disable()" class="btn btn-xs btn-link"] {{::item.name_with_owner}} + td + a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' + td + a[ ng-href = '{{::item.edit_link}}' + ng-show='::item.edit_link' target='_blank'] = t 'project_menu.settings' + - if policy(:project).create? + rd-widget-footer + ul.nav.nav-justified + li + = link_to t('layout.projects.new'), new_project_path, target: '_blank' + .col-md-6 + rd-widget + div ng-controller="ProjectInfoController" + rd-widget-header title=(t('dashboard.project_info.title') + '{{widget_title}}') + rd-widget-body class="medium" loading="requesting" + div ng-hide="widget_title" + = t('dashboard.project_info.select') + div ng-show="widget_title" + div + a ng-href="{{project_info.html_url}}" target="_blank" + | {{project}} + div.bottom-space + | {{project_info.description}} + div + div.bottom-space ng-repeat="commit in project_info.commits" + div + span + | {{::commit.branch}} + span.pull-right + a ng-href="{{::commit.committer_url}}" target="_blank" + | {{::commit.committer_login}} + div + a ng-href="{{::commit.url}}" target="_blank" + | {{::commit.sha}} + div + | {{::commit.message}} + +.row.top-space + .col-md-12 + == render 'projects/build_lists/filter' + rd-widget + div ng-controller="BuildListsController" + rd-widget-header title="Build Lists{{widget_title}}" icon="fa-gears" + .form-inline ng-init="autoreload=true" + button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" + = t 'layout.autoreload_page' + button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" + | Filters + button [class="btn btn-default" ng-show="widget_title" + ng-click="clearProject()" ng-disabled="ProjectSelectService.disable()"] + | Clear selected project + rd-widget-body classes="large no-padding" loading="isRequest" + .row + table.table.table-condensed + thead + tr + th + th= t('activerecord.attributes.build_list.id') + th= t('activerecord.attributes.build_list.status') + th= t('activerecord.attributes.build_list.project') + th= t('diff') + th= t('activerecord.attributes.build_list.project_version') + th= t('activerecord.attributes.build_list.save_to_repository') + th= t('activerecord.attributes.build_list.arch_short') + th= t('activerecord.attributes.build_list.user') + th= t('activerecord.attributes.build_list.hostname') + th= t('activerecord.attributes.build_list.updated_at') + tbody + tr[ ng-repeat = 'bl in build_lists' + class = '{{::bl.status_color}}' + id = 'build-list-{{::bl.id}}' + ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" + ng-show = 'bl.show' ] + td.build-list-chevrons + a.expand ng-show = '::bl.hasRelated' + span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' + span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' + / id + td.build-list-statuses + + a[ ng-href = '{{::bl.url}}' ] {{::bl.id}} + div ng-show = '::bl.hasRelated' ng-bind-html="::bl.chevronHtml" + + / status + td + | {{::bl.human_status | i18n}} + br + time ng-show = '::bl.duration' + | {{::bl.duration}} + time ng-show = '::bl.average_build_time' + | /{{::bl.average_build_time}} + + / project + td.centered ng-hide = '::bl.project' colspan = 2 + = t('layout.projects.unexisted_project') + td ng-show = '::bl.project' + | {{::bl.project.name_with_owner}} + + / diff + td + a ng-href = '{{::bl.version_link_url}}' ng-show = '::bl.project' + | {{::bl.version_link_text}} + + / project_version + td[] {{::bl.version_release}} + + / save_to_repository + td + a[ ng-href = '{{::bl.save_to_repository_url}}' ] {{::bl.save_to_repository_name}} + + / arch_short + td[ ng-show = '::bl.arch' ] {{::bl.arch.name}} + td[ ng-hide = '::bl.arch' ]= t('layout.arches.unexisted_arch') + + / user + td + a[ ng-href = '{{::bl.user.url}}' ] {{::bl.user.fullname}} + + / hostname + td[] {{::bl.hostname}} + + / updated_at + td title = '{{::bl.updated_at_utc}}' + | {{::bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} + rd-widget-footer ng-show="total_items > per_page" + == angularjs_paginate( per_page: 'per_page' ) \ No newline at end of file diff --git a/app/views/projects/projects/edit.html.slim b/app/views/projects/projects/edit.html.slim index 8bad4555a..e27474301 100644 --- a/app/views/projects/projects/edit.html.slim +++ b/app/views/projects/projects/edit.html.slim @@ -1,20 +1,21 @@ -set_meta_tags title: [title_object(@project), t('layout.projects.edit')] -== render 'submenu' -.container.col-md-offset-2.col-md-8 - .row +.row.top-space + .col-md-offset-2.col-md-8 + rd-widget + rd-widget-header title=( title_object(@project) + ' | ' + t('layout.projects.edit') ) + rd-widget-body + = simple_form_for @project, html: { class: 'form-horizontal' }, + wrapper: :horizontal_form, + wrapper_mappings: { boolean: :horizontal_boolean } do |f| + == render "form", f: f - = simple_form_for @project, html: { class: 'form-horizontal' }, - wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean } do |f| - == render "form", f: f + .row + .col-sm-offset-3.col-sm-9 + => t("layout.projects.delete_warning") + - if policy(@project).destroy? + = link_to t("layout.delete"), project_path(@project), method: :delete, + data: { confirm: t("layout.projects.confirm_delete") }, + class: 'btn btn-danger' - == render 'build_schedule' - - hr.col-sm-12 - .col-sm-9.col-sm-offset-3 - => t("layout.projects.delete_warning") - - if policy(@project).destroy? - = link_to t("layout.delete"), project_path(@project), method: :delete, - data: { confirm: t("layout.projects.confirm_delete") }, - class: 'btn btn-danger' + == render 'build_schedule' \ No newline at end of file diff --git a/app/views/projects/projects/index.html.slim b/app/views/projects/projects/index.html.slim deleted file mode 100644 index 0ee3fb2ce..000000000 --- a/app/views/projects/projects/index.html.slim +++ /dev/null @@ -1,38 +0,0 @@ --set_meta_tags title: t('layout.projects.list_header') -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'ProjectsCtrl' - .row.offset10 - .col-md-3.col-sm-4== render 'filters' - .col-md-9.col-sm-8 - .toolbar - span - i.fa.fa-lg.fa-user.text-success.roffset5 - = t 'layout.relations.user_owner' - i.fa.fa-lg.fa-user.text-success.roffset5.loffset10 - = t 'layout.relations.group_owner' - i.fa.fa-lg.fa-group.text-primary.roffset5.loffset10 - = t 'layout.relations.user' - i.fa.fa-lg.fa-group.text-primary.roffset5.loffset10 - = t 'layout.relations.group' - - table.table.table-hover.offset10 ng-cloak = true - thead - tr - th - th= t 'activerecord.attributes.project.name' - th - th= t 'layout.projects.role' - th= t 'layout.projects.remove_user' - tbody - tr ng-repeat = 'item in projects' - td - i.fa ng-class = 'item.visibility_class' - td - a[ ng-href = '{{item.link}}' ] {{item.name_with_owner}} - td - i.fa.roffset5 ng-class = 'item.participant_class' - td[] {{item.user_role_name}} - td - span.fa.fa-lg.fa-times.text-danger[ confirmed-click = 'leave_project(item)' - ng-show = 'item.can_leave_project' ng-confirm-click = t('layout.confirm') ] - - = angularjs_paginate per_page: Project.per_page diff --git a/app/views/projects/projects/index.json.jbuilder b/app/views/projects/projects/index.json.jbuilder index dacd2cd57..b24875eac 100644 --- a/app/views/projects/projects/index.json.jbuilder +++ b/app/views/projects/projects/index.json.jbuilder @@ -1,16 +1,9 @@ json.projects do json.array!(@projects) do |item| - alone_member = alone_member?(item) - json.cache! item, expires_in: 10.minutes do - json.visibility_class fa_visibility_icon(item) - json.name_with_owner item.name_with_owner - json.link project_path(item) - json.participant_class participant_class(alone_member, item) - json.user_role_name t("layout.collaborators.role_names.#{current_user.best_role item}") - json.can_leave_project item.owner != current_user && alone_member + json.cache! item, expires_in: 1.minutes do + json.name_with_owner item.name_with_owner + json.new_build_list_link new_project_build_list_path(item.name_with_owner) + json.edit_link edit_project_path(item) if policy(item).update? end end -end - -json.page params[:page] -json.projects_count @projects_count +end \ No newline at end of file diff --git a/app/views/projects/projects/mass_create.html.slim b/app/views/projects/projects/mass_create.html.slim deleted file mode 100644 index 5253e1308..000000000 --- a/app/views/projects/projects/mass_create.html.slim +++ /dev/null @@ -1,20 +0,0 @@ -.container.col-md-offset-2.col-md-8 - h3 - = title t("layout.projects.mass_create") - .row ng-init="owner = 'me'" - = simple_form_for @project, url: run_mass_create_projects_path do |f| - = f.hidden_field :mass_create - = f.input :url - = f.input :add_to_repository_id, - as: :grouped_select, - collection: mass_import_repositories_for_group_select, - group_method: :last, - include_blank: false - - = render 'owner', f: f - - = f.input :visibility, - collection: project_visibility_options, - include_blank: false - - = f.button :submit, t('layout.add') diff --git a/app/views/projects/projects/mass_import.html.slim b/app/views/projects/projects/mass_import.html.slim deleted file mode 100644 index 1c94da5dc..000000000 --- a/app/views/projects/projects/mass_import.html.slim +++ /dev/null @@ -1,21 +0,0 @@ -.container.col-md-offset-2.col-md-8 - h3 - = title t("layout.projects.mass_import") - .row ng-init="owner = 'me'" - = simple_form_for @project, url: run_mass_import_projects_path do |f| - = f.hidden_field :mass_import - = f.input :url - = f.input :srpms_list, as: :text - = f.input :add_to_repository_id, - as: :grouped_select, - collection: mass_import_repositories_for_group_select, - group_method: :last, - include_blank: false - - = render 'owner', f: f - - = f.input :visibility, - collection: project_visibility_options, - include_blank: false - - = f.button :submit, t('layout.add') diff --git a/app/views/projects/projects/new.html.slim b/app/views/projects/projects/new.html.slim index 1e4cf9081..8cd089a80 100644 --- a/app/views/projects/projects/new.html.slim +++ b/app/views/projects/projects/new.html.slim @@ -1,11 +1,10 @@ -.container - .row - .col-md-offset-2.col-md-8 - = simple_form_for @project, html: { class: 'form-horizontal' }, - wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean, - file: :horizontal_file_input } do |f| - .col-sm-offset-3.col-sm-9 - h3 - = title t('layout.projects.new') - = render 'form', f: f +.row.top-space + .col-md-offset-2.col-md-8 + rd-widget + rd-widget-header title=(title t('layout.projects.new')) + rd-widget-body + = simple_form_for @project, html: { class: 'form-horizontal' }, + wrapper: :horizontal_form, + wrapper_mappings: { boolean: :horizontal_boolean, + file: :horizontal_file_input } do |f| + = render 'form', f: f diff --git a/app/views/projects/projects/preview.json.jbuilder b/app/views/projects/projects/preview.json.jbuilder deleted file mode 100644 index fb18c9a12..000000000 --- a/app/views/projects/projects/preview.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.html markdown(params[:text]) diff --git a/app/views/projects/projects/project_info.json.jbuilder b/app/views/projects/projects/project_info.json.jbuilder new file mode 100644 index 000000000..8eb028b05 --- /dev/null +++ b/app/views/projects/projects/project_info.json.jbuilder @@ -0,0 +1,7 @@ +json.project_info do |proj| + proj.(@github_basic_info, :html_url, :description) + + proj.commits @commits do |commit| + proj.(commit, :branch, :url, :sha, :message, :committer_login, :committer_url) + end +end \ No newline at end of file diff --git a/app/views/shared/_angularjs_paginate.html.slim b/app/views/shared/_angularjs_paginate.html.slim index 7f29b9c5c..a81009560 100644 --- a/app/views/shared/_angularjs_paginate.html.slim +++ b/app/views/shared/_angularjs_paginate.html.slim @@ -2,13 +2,13 @@ / $scope.goToPage = (number) -> / $location.search('page', number) -pagination[ boundary-links = 'true' - total-items = total_items - ng-model = page - previous-text = "‹" next-text = "›" - first-text = "«" last-text = "»" - items-per-page = per_page - max-size = 5 - rotate = 'false' - ng-show = "#{total_items} > #{per_page}" - ng-change = select_page ] +uib-pagination[ boundary-links = 'true' + total-items = total_items + ng-model = page + previous-text = "‹" next-text = "›" + first-text = "«" last-text = "»" + items-per-page = per_page + max-size = 5 + rotate = 'false' + ng-show = "#{total_items} > #{per_page}" + ng-change = select_page ] diff --git a/app/views/shared/_autocomplete_form.html.slim b/app/views/shared/_autocomplete_form.html.slim index 0e6d73792..ccc051fb7 100644 --- a/app/views/shared/_autocomplete_form.html.slim +++ b/app/views/shared/_autocomplete_form.html.slim @@ -32,7 +32,7 @@ h4 type = 'text' ng-model = "#{ctrl_as}selected_#{var_name}" placeholder = placeholder - typeahead = "extra.label for extra in #{ctrl_as}get#{field}($viewValue)" + uib-typeahead = "extra.label for extra in #{ctrl_as}get#{field}($viewValue)" typeahead-on-select = "#{ctrl_as}select#{func_name}($item, $model, $label)" ] .col-md-4 button[ class='btn btn-primary' type='button' diff --git a/app/views/shared/_build_results.html.slim b/app/views/shared/_build_results.html.slim index 215242507..17176f9cf 100644 --- a/app/views/shared/_build_results.html.slim +++ b/app/views/shared/_build_results.html.slim @@ -1,22 +1,15 @@ -h3 - = subject.class.human_attribute_name(subject.is_a?(BuildList) ? 'logs' : 'results') -h4 ng-hide='subject.results' - = t('layout.no_') -table.table.table-hover ng-show='subject.results' - thead - tr - th= t 'activerecord.attributes.product_build_list/results.file_name' - th= t 'activerecord.attributes.product_build_list/results.sha1' - th= t 'activerecord.attributes.product_build_list/results.size' - th= t 'activerecord.attributes.product_build_list/results.created_at' - tbody - tr ng-repeat='item in subject.results' - td - a ng-href='{{item.url}}' - | {{item.file_name}} - td - | {{item.sha1}} - td - | {{item.size}} - td - | {{item.created_at}} +rd-widget ng-show='subject.results' + rd-widget-header title=subject.class.human_attribute_name(subject.is_a?(BuildList) ? 'logs' : 'results') + rd-widget-body class="no-padding" + table.table.table-hover ng-show='subject.results' + thead + tr + th= t 'activerecord.attributes.product_build_list/results.file_name' + th= t 'activerecord.attributes.product_build_list/results.size' + tbody + tr ng-repeat='item in subject.results' + td + a ng-href='{{item.url}}' + | {{item.file_name}} + td + | {{item.size}} diff --git a/app/views/shared/_feed_commit.html.slim b/app/views/shared/_feed_commit.html.slim deleted file mode 100644 index 313c434c4..000000000 --- a/app/views/shared/_feed_commit.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -.pull-left.roffset5 - img alt='avatar' src=presenter.image -.pull-left - strong= presenter.header - =< datetime_moment(presenter.date, tag: :strong) - .clearfix - span=> presenter.caption - - if presenter.expandable? && presenter.content? - span.glyphicon.glyphicon-chevron-down.pointer[ - data-toggle = 'collapse' - data-target = "#commit_message_#{item_no}" ] -.clearfix -- if presenter.content? - .collapse id="commit_message_#{item_no}" - .well.well-sm== markdown(presenter.content) diff --git a/app/views/shared/_feed_message.html.slim b/app/views/shared/_feed_message.html.slim deleted file mode 100644 index 5a5b8389c..000000000 --- a/app/views/shared/_feed_message.html.slim +++ /dev/null @@ -1,29 +0,0 @@ --if presenter.is_reference_to_issue.nil? || presenter.reference_project.nil? || policy(presenter.reference_project).show? - .panel.panel-default[ id = (presenter.comment_id? ? presenter.comment_anchor : '') ] - .panel-body - .pull-left.roffset5 - img alt = 'avatar' src = presenter.image - - - if presenter.buttons? - .pull-right - => raw presenter.buttons.join(' ').html_safe - - .pull-left - strong= presenter.header - p= datetime_moment(presenter.date, tag: :strong) - - - if presenter.caption? - .clearfix - span= presenter.caption - - if presenter.expandable? and presenter.content? - span.data-expander.collapsed[ id = "expand#{item_no}"]   - - .clearfix - - if presenter.content? - .offset10 - =presenter.issue_referenced_state if presenter.issue_referenced_state? - .fulltext[ class = "#{presenter.expandable? ? "hidden" : ''} #{presenter.caption? ? "" : "alone"}" - id = (presenter.expandable? ? "content-expand#{item_no}" : '') ] - .md_and_cm[ class = (presenter.is_reference_to_issue ? '' : 'cm-s-default') ] - = presenter.is_reference_to_issue ? presenter.content : markdown(presenter.content) - .clearfix diff --git a/app/views/shared/_header.html.slim b/app/views/shared/_header.html.slim index bd2f86460..af9b33b2d 100644 --- a/app/views/shared/_header.html.slim +++ b/app/views/shared/_header.html.slim @@ -1,14 +1,14 @@ -link rel='canonical' href=facebook_meta_url +/ link rel='canonical' href=facebook_meta_url / meta property='og:title' content=facebook_meta_title -meta property='og:type' content='website' -meta property='og:url' content=facebook_meta_url -meta property='og:image' content=facebook_meta_image -meta property='og:site_name' content=facebook_site_name -meta property='fb:app_id' content=facebook_meta_app_id +/ meta property='og:type' content='website' +/ meta property='og:url' content=facebook_meta_url +/ meta property='og:image' content=facebook_meta_image +/ meta property='og:site_name' content=facebook_site_name +/ meta property='fb:app_id' content=facebook_meta_app_id / meta property='og:description' content=facebook_meta_description / meta name='Description' content=facebook_meta_description -meta property='twitter:card' content='summary' -meta property='twitter:site' content='@abf_io' -meta property='twitter:image' content=facebook_meta_image -meta property='twitter:url' content=facebook_meta_url +/ meta property='twitter:card' content='summary' +/ meta property='twitter:site' content='@abf_io' +/ meta property='twitter:image' content=facebook_meta_image +/ meta property='twitter:url' content=facebook_meta_url diff --git a/app/views/statistics/_filter.html.slim b/app/views/statistics/_filter.html.slim index 80f5e2988..4ff8178cc 100644 --- a/app/views/statistics/_filter.html.slim +++ b/app/views/statistics/_filter.html.slim @@ -1,11 +1,7 @@ - user ||= false .row .col-md-12 - - h3.text-info - = t('.header') - - form#statistics-form.form-inline.alert.alert-info.centered + form#statistics-form.form-inline.centered .form-group> label.control-label> = t('.range_label') @@ -20,8 +16,8 @@ size: 7, readonly: true, ng_disabled: 'loading', - datepicker_popup: 'yyyy-MM-dd', - datepicker_options: 'dateOptions', + uib_datepicker_popup: 'yyyy-MM-dd', + uib_datepicker_options: 'dateOptions', is_open: 'range_start_opened', show_button_bar: false @@ -43,8 +39,8 @@ size: 7, ng_disabled: 'loading', readonly: true, - datepicker_popup: 'yyyy-MM-dd', - datepicker_options: 'dateOptions', + uib_datepicker_popup: 'yyyy-MM-dd', + uib_datepicker_options: 'dateOptions', is_open: 'range_end_opened', show_button_bar: false diff --git a/app/views/statistics/index.html.slim b/app/views/statistics/index.html.slim index f98ef650b..5cdc96eb7 100644 --- a/app/views/statistics/index.html.slim +++ b/app/views/statistics/index.html.slim @@ -1,6 +1,10 @@ - set_meta_tags title: t('.header') -.container#manage-statistics ng-controller='StatisticsController' ng-init='init()' - - = render 'filter' - = render 'build_lists' \ No newline at end of file +.row.top-space + .col-md-8.col-md-offset-2 + rd-widget + rd-widget-header title=t('.header') + rd-widget-body + div#manage-statistics ng-controller='StatisticsController' ng-init='init()' + = render 'filter' + = render 'build_lists' \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index d1193cd41..5a2c80a29 100644 --- a/config/application.rb +++ b/config/application.rb @@ -68,4 +68,4 @@ module Rosa config.angular_templates.ignore_prefix = 'angularjs/templates/' end -end +end \ No newline at end of file diff --git a/config/initializers/github.rb b/config/initializers/github.rb index abea6ed25..0a4b18ba3 100644 --- a/config/initializers/github.rb +++ b/config/initializers/github.rb @@ -8,7 +8,7 @@ Octokit.configure do |c| end Octokit.middleware = Faraday::RackBuilder.new do |builder| store = ActiveSupport::Cache.lookup_store(:redis_store, ENV['REDIS_URL'].to_s + '/1') - builder.use Faraday::HttpCache, store: store, shared_cache: false + builder.use Faraday::HttpCache, store: store, shared_cache: false, serializer: Marshal builder.use Octokit::Response::RaiseError builder.adapter Faraday.default_adapter end \ No newline at end of file diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb index 9fc5e65e8..b3c076007 100644 --- a/config/initializers/redis.rb +++ b/config/initializers/redis.rb @@ -1,6 +1,6 @@ class Redis def self.connect! - url = ENV["REDIS_URL"] || "redis://localhost:6379/#{::Rails.env.test? ? 1 : 0}" + url = ENV["REDIS_URL"] || "redis://localhost:6379/#{::Rails.env.test? ? 2 : 0}" opts = { url: url } opts[:logger] = ::Rails.logger if ::Rails.application.config.log_redis @@ -10,3 +10,4 @@ class Redis end Redis.connect! +Redis::Semaphore.new(:job_shift_lock).delete! \ No newline at end of file diff --git a/config/locales/dashboard.en.yml b/config/locales/dashboard.en.yml new file mode 100644 index 000000000..524d9ecd3 --- /dev/null +++ b/config/locales/dashboard.en.yml @@ -0,0 +1,18 @@ +en: + dashboard: + dashboard_name: Projects/Build lists + filters: Filters + + projects: + title: Projects + last_projects: Projects you've worked with + name: Project name + search: Search + new_build: New build + + project_info: + title: Project information + select: Please select a project + + platforms: + title: Platforms \ No newline at end of file diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index 0b5c36ab9..e6878b3ff 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -5,8 +5,6 @@ en: products: Products top_menu: platforms: Platforms - projects: Projects - build_lists: Task monitoring groups: Groups statistics: Statistics bottom_menu: diff --git a/config/locales/menu.ru.yml b/config/locales/menu.ru.yml index 6d9264282..48c3af847 100644 --- a/config/locales/menu.ru.yml +++ b/config/locales/menu.ru.yml @@ -5,8 +5,6 @@ ru: personal_repository: Мой репозиторий top_menu: platforms: Платформы - projects: Проекты - build_lists: Мониторинг задач groups: Группы statistics: Статистика bottom_menu: diff --git a/config/routes.rb b/config/routes.rb index cd6183413..fc32ff166 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -121,14 +121,13 @@ Rails.application.routes.draw do get '/forbidden' => 'pages#forbidden', as: 'forbidden' get '/terms-of-service' => 'pages#tos', as: 'tos' + get '/activity.:format' => 'home#activity', as: 'activity_feeds', format: /json/ get '/activity_feeds.:format' => 'home#activity', as: 'atom_activity_feeds', format: /atom/ - get '/own_activity' => 'home#own_activity', as: 'own_activity' - get '/get_owners_list' => 'home#get_owners_list' - get '/get_project_names_list' => 'home#get_project_names_list' + get '/own_activity.:format' => 'home#own_activity', as: 'own_activity', format: /json/ if APP_CONFIG['anonymous_access'] authenticated do - root to: 'home#activity' + root to: 'home#index' end unauthenticated do root to: 'statistics#index', as: :unauthenticated_root @@ -137,7 +136,7 @@ Rails.application.routes.draw do #end end else - root to: 'home#activity' + root to: 'home#index' end scope module: 'platforms' do @@ -263,31 +262,23 @@ Rails.application.routes.draw do end end - resources :projects, only: [:index, :new, :create] do - collection do - post :run_mass_import - get :mass_import - post :run_mass_create - get :mass_create - end - end + get '/projects_dashboard' => 'projects#dashboard', as: :projects_dashboard + + resources :projects, only: [:index, :new, :create] + scope '*name_with_owner', name_with_owner: Project::OWNER_AND_NAME_REGEXP do # project scope as: 'project' do - resources :build_lists, only: [:index, :new, :create] do - get :list, on: :collection - end + resources :build_lists, only: [:index, :new, :create] put 'schedule' => 'projects#schedule' end # Resource + get '/project_info.:format' => 'projects#project_info', as: :project_info, format: /json/ get '/autocomplete_maintainers' => 'projects#autocomplete_maintainers', as: :autocomplete_maintainers get '/modify' => 'projects#edit', as: :edit_project - patch '/' => 'projects#update' + patch '/' => 'projects#update', as: :project delete '/' => 'projects#destroy' - # Member - delete '/remove_user' => 'projects#remove_user', as: :remove_user_project - get '/' => "projects#bl_redirect", as: :project get '/commit/:sha' => 'projects#commit', as: :commit get '/diff/:diff' => 'projects#diff', as: :diff, format: false, diff: /.*/ end