#90: style changes for header, increase performanse for #autocomplete_base_project action

This commit is contained in:
Vokhmin Alexey V 2012-09-25 19:18:22 +04:00
parent dfbf8a8d58
commit 0299c069c6
3 changed files with 6 additions and 7 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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