From 0299c069c67cace97afa147577eb35f3f6cfb086 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 25 Sep 2012 19:18:22 +0400 Subject: [PATCH 1/2] #90: style changes for header, increase performanse for #autocomplete_base_project action --- app/assets/stylesheets/design/custom.scss | 6 +++--- app/controllers/projects/pull_requests_controller.rb | 5 ++--- app/helpers/pull_request_helper.rb | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index 32d816e38..b86057250 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -1333,10 +1333,10 @@ hr.bootstrap { max-height: 280px; } -.label-bootstrap.label-info.font14 a { - color: #FFFFFF; +.label-bootstrap.label-info.font14 { + padding: 4px; + a { color: #FFFFFF; } } - .line_numbers a { color: #999999; } diff --git a/app/controllers/projects/pull_requests_controller.rb b/app/controllers/projects/pull_requests_controller.rb index a6abc4e99..c61cd190b 100644 --- a/app/controllers/projects/pull_requests_controller.rb +++ b/app/controllers/projects/pull_requests_controller.rb @@ -90,10 +90,9 @@ class Projects::PullRequestsController < Projects::BaseController def autocomplete_base_project #Maybe slow? ILIKE? - items = Project.accessible_by(current_ability, :membered) - items << @project.root + items = Project.accessible_by(current_ability, :membered).search(params[:term]) + items = items | [@project.root] items.select! {|e| Regexp.new(params[:term].downcase).match(e.name.downcase) && e.repo.branches.count > 0} - items.uniq! render :json => json_for_autocomplete_base(items) end diff --git a/app/helpers/pull_request_helper.rb b/app/helpers/pull_request_helper.rb index 333778287..7cf4c45e6 100644 --- a/app/helpers/pull_request_helper.rb +++ b/app/helpers/pull_request_helper.rb @@ -26,7 +26,7 @@ module PullRequestHelper #helper for helpers def show_ref pull, which, limit = 30 project, ref = pull.send("#{which}_project"), pull.send("#{which}_ref") - link_to "#{project.owner.uname.truncate limit}: #{ref.truncate limit}", ref_path(project, ref) + link_to "#{project.owner.uname.truncate limit}/#{project.name.truncate limit}: #{ref.truncate limit}", ref_path(project, ref) end def ref_path project, ref From d54a50e2e0c4fd40e17706cee63879f7e433db6f Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 25 Sep 2012 19:31:06 +0400 Subject: [PATCH 2/2] #90: added line-height style --- app/assets/stylesheets/design/custom.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index b86057250..eac1d3a0c 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -1335,6 +1335,7 @@ hr.bootstrap { .label-bootstrap.label-info.font14 { padding: 4px; + line-height: 1.8; a { color: #FFFFFF; } } .line_numbers a {