Patch #30071 » 0002-Mark-current-project-when-filtering-project-jump-box.patch
| app/controllers/projects_controller.rb | ||
|---|---|---|
|
else
|
||
|
@projects = User.current.projects.to_a
|
||
|
end
|
||
|
if params[:current_project_id].present?
|
||
|
@selected = Project.find(params[:current_project_id])
|
||
|
end
|
||
|
}
|
||
|
end
|
||
|
end
|
||
| app/helpers/application_helper.rb | ||
|---|---|---|
|
text = @project.name_was
|
||
|
end
|
||
|
text ||= l(:label_jump_to_a_project)
|
||
|
url = autocomplete_projects_path(:format => 'js', :jump => current_menu_item)
|
||
|
url = autocomplete_projects_path(:format => 'js', :jump => current_menu_item, :current_project_id => @project.try(:id))
|
||
|
trigger = content_tag('span', text, :class => 'drdn-trigger')
|
||
|
q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => url}, :autocomplete => 'off')
|
||
| app/views/projects/autocomplete.js.erb | ||
|---|---|---|
|
<%
|
||
|
s = ''
|
||
|
if @projects.any?
|
||
|
s = render_projects_for_jump_box(@projects, params[:q])
|
||
|
s = render_projects_for_jump_box(@projects, params[:q], @selected)
|
||
|
elsif params[:q].present?
|
||
|
s = content_tag('span', l(:label_no_data))
|
||
|
end
|
||