From ad65691471269ecd1426869be2cd4d0bc15ea4b6 Mon Sep 17 00:00:00 2001 From: Wedge Date: Sat, 28 May 2016 22:59:35 +0300 Subject: [PATCH] Implement suggestions --- .../build_lists/build_lists_controller.js.erb | 2 +- .../angularjs/models/build_list.js.erb | 3 +- app/views/layouts/application.html.slim | 1 - app/views/layouts/menu/_new_top.html.slim | 34 ++++++---- .../platforms/mass_builds/show.html.slim | 2 +- .../product_build_lists/show.html.slim | 34 ++++++++++ .../repositories/_proj_ajax.json.jbuilder | 2 +- .../repositories/_proj_list.html.slim | 2 +- .../projects/build_lists/_filter.html.slim | 8 ++- .../projects/build_lists/index.html.slim | 7 ++- app/views/projects/build_lists/show.html.slim | 6 ++ config/locales/layout.en.yml | 2 + public/404.html | 62 ++----------------- 13 files changed, 88 insertions(+), 77 deletions(-) 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 000edd989..1774fd560 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 @@ -7,7 +7,7 @@ function($scope, BuildListsService, $location, $interval, $uibModal) { var selectedProject = ""; var refresh, is_autoreload_on; - var default_filters = {page: '1', per_page: '25', 'ownership': 'owned'}; + var default_filters = {page: '1', per_page: '25', 'ownership': 'everything'}; $scope.setAutoreload = function(autoreload) { is_autoreload_on = autoreload; diff --git a/app/assets/javascripts/angularjs/models/build_list.js.erb b/app/assets/javascripts/angularjs/models/build_list.js.erb index 34a0e8dd5..16ed077ac 100644 --- a/app/assets/javascripts/angularjs/models/build_list.js.erb +++ b/app/assets/javascripts/angularjs/models/build_list.js.erb @@ -36,7 +36,8 @@ 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_build_lists_path(self.project.name_with_owner); + console.log(self.project.url); } if (self.user) diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index e439485d3..f72a565d7 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -33,7 +33,6 @@ html == yield - script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js" type="text/javascript" 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.min.js" type="text/javascript" diff --git a/app/views/layouts/menu/_new_top.html.slim b/app/views/layouts/menu/_new_top.html.slim index ec214508d..9b088c223 100644 --- a/app/views/layouts/menu/_new_top.html.slim +++ b/app/views/layouts/menu/_new_top.html.slim @@ -2,16 +2,25 @@ li.sidebar-list div.form-inline.no-indent = form_tag search_index_path, method: 'get', role: 'search' do = text_field_tag 'query', @query, placeholder: t('layout.search.header'), class: 'form-control', ng_show: 'toggle' --if current_user - li.sidebar-title - span - = t 'top_menu_labels.navigation' - - (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) +li.sidebar-title + span + = t 'top_menu_labels.navigation' +- (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) +li.sidebar-list + a href="http://repoclosure.openmandriva.org" + | Repoclosure + span.menu-icon.fa.fa-circle-o +- if current_user.try(:admin?) + li.sidebar-list + a href=admin_users_path + = t('admins_menu_header') + span.menu-icon.fa.fa-lock +- if current_user li.sidebar-title span = t 'top_menu_labels.account' @@ -27,7 +36,10 @@ li.sidebar-list a href=destroy_user_session_path data-method='delete' = t('layout.logout') span.menu-icon.fa.fa-sign-out --else +- else + li.sidebar-title + span + = t 'top_menu_labels.account' li.sidebar-list a href=new_user_registration_path = t('layout.devise.shared_links.sign_up') diff --git a/app/views/platforms/mass_builds/show.html.slim b/app/views/platforms/mass_builds/show.html.slim index ab09c8e34..9021bb819 100644 --- a/app/views/platforms/mass_builds/show.html.slim +++ b/app/views/platforms/mass_builds/show.html.slim @@ -99,7 +99,7 @@ rd-widget-body class="no-padding" table.table.table-striped - MassBuild::COUNT_STATUSES.each do |status| - - path = build_lists_path+"#?#{{filter: {mass_build_id: @mass_build.id, ownership: 'everything'}.merge(status != :build_lists ? {status: BuildList.status_by_human(status)} : {})}.to_param}" + - path = build_lists_path+"#?#{{mass_build_id: @mass_build.id, ownership: 'everything'}.merge(status != :build_lists ? {status: BuildList.status_by_human(status)} : {}).to_param}" tr td = link_to t("layout.build_lists.statuses.#{status}") + ": ", path diff --git a/app/views/platforms/product_build_lists/show.html.slim b/app/views/platforms/product_build_lists/show.html.slim index 28274af22..fbb1913a0 100644 --- a/app/views/platforms/product_build_lists/show.html.slim +++ b/app/views/platforms/product_build_lists/show.html.slim @@ -122,4 +122,38 @@ div ng-init=("init("+pbl.id.to_s+")") ng-controller='ProductBuildListController' .col-md-12 = render 'shared/log', { build_started: true, get_log_path: log_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) } +.row.top-space + .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}} + - if policy(@repository).add_project? + a.btn.btn-primary href=add_project_platform_repository_path(@platform, @repository) + = t('layout.projects.add') + |   + - if policy(@repository).remove_project? + a.btn.btn-primary href=remove_project_platform_repository_path(@platform, @repository) + = t('layout.repositories.mass_delete') \ No newline at end of file diff --git a/app/views/platforms/repositories/_proj_ajax.json.jbuilder b/app/views/platforms/repositories/_proj_ajax.json.jbuilder index d193018cf..9855b7acb 100644 --- a/app/views/platforms/repositories/_proj_ajax.json.jbuilder +++ b/app/views/platforms/repositories/_proj_ajax.json.jbuilder @@ -2,7 +2,7 @@ json.projects @projects do |project| #json.visibility_class fa_visibility_icon(project) json.path project_build_lists_path(project.name_with_owner) json.name project.name_with_owner - json.add_path url_for(controller: :repositories, action: :add_project, project_id: project.id) + json.add_path add_project_platform_repository_path @platform.name, @repository.name, project_id: project.id end json.total_items @total_items \ No newline at end of file diff --git a/app/views/platforms/repositories/_proj_list.html.slim b/app/views/platforms/repositories/_proj_list.html.slim index 5d6f5aaf2..62070ff62 100644 --- a/app/views/platforms/repositories/_proj_list.html.slim +++ b/app/views/platforms/repositories/_proj_list.html.slim @@ -21,7 +21,7 @@ div ng-controller='RepositoryProjectsController' ng-init=("init("+(controller.ac a ng-href='{{project.path}}' | {{project.name}} td - a ng-href='{{project.add_path}}' ng-show='project.add_path' + a ng-href='{{project.add_path}}' data-method="put" ng-show='project.add_path' = t('layout.add') a.pointer[ng-href = '' ng-show = 'project.remove_path' diff --git a/app/views/projects/build_lists/_filter.html.slim b/app/views/projects/build_lists/_filter.html.slim index 0741171a5..240868430 100644 --- a/app/views/projects/build_lists/_filter.html.slim +++ b/app/views/projects/build_lists/_filter.html.slim @@ -1,6 +1,6 @@ script type="text/ng-template" id="build_list_filters.html" .modal-header - | Bleh + = t 'layout.build_lists.filters' .modal-body .row - html_options = { class: 'form-control' } @@ -52,6 +52,12 @@ script type="text/ng-template" id="build_list_filters.html" '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 = 'project_name' + size = '30' + type = 'text' + ng-model = 'params.project_name' + disabled = @project.present? ] .modal-footer button.btn.btn-primary type = 'button' ng-click = 'apply()' diff --git a/app/views/projects/build_lists/index.html.slim b/app/views/projects/build_lists/index.html.slim index 727eb6bfe..c30667b47 100644 --- a/app/views/projects/build_lists/index.html.slim +++ b/app/views/projects/build_lists/index.html.slim @@ -4,6 +4,10 @@ rd-widget rd-widget-header title="Build Lists {{::widgetTitle}}" icon="fa-gears" .form-inline.pull-right ng-init="autoreload=true" + - if @project + a.btn.btn-default [ href=("https://github.com/" + @project.github_get_organization + "/" + @project.name) + target="_blank" ] + = t('menu.project_menu.github') - if @project and policy(@project.build_lists.build).create? a.btn.btn-default href=new_project_build_list_path(@project) = t('layout.build_lists.new_header') @@ -55,7 +59,8 @@ td.centered ng-hide = '::bl.project' colspan = 2 = t('layout.projects.unexisted_project') td ng-show = '::bl.project' - | {{::bl.project.name_with_owner}} + a ng-href='{{::bl.project.url}}' + | {{::bl.project.name_with_owner}} / diff td diff --git a/app/views/projects/build_lists/show.html.slim b/app/views/projects/build_lists/show.html.slim index 34a0e49fe..910359ab1 100644 --- a/app/views/projects/build_lists/show.html.slim +++ b/app/views/projects/build_lists/show.html.slim @@ -40,6 +40,12 @@ div[ ng-controller='BuildListController' p ng-show="build_list.container_status == #{ BuildList::BUILD_PUBLISH }" = t('layout.build_lists.creating') + tr + td= t('activerecord.attributes.build_list.project') + td + a href=project_build_lists_path(@build_list.project.name_with_owner) + = @build_list.project.name_with_owner + tr td= t('activerecord.attributes.build_list.id') td= @build_list.id diff --git a/config/locales/layout.en.yml b/config/locales/layout.en.yml index eceb18d95..e659a0b17 100644 --- a/config/locales/layout.en.yml +++ b/config/locales/layout.en.yml @@ -8,6 +8,8 @@ en: turned_on: on turned_off: off + for: for + list: List year: year diff --git a/public/404.html b/public/404.html index f143c25d9..afbf17510 100644 --- a/public/404.html +++ b/public/404.html @@ -1,39 +1,12 @@ 404 - - + + - @@ -41,10 +14,6 @@
-
- -
-

Error 404

Page not found

@@ -53,31 +22,8 @@

-
- - \ No newline at end of file