@@ -358,20 +358,18 module ApplicationHelper | |||||
358 | # Renders the project quick-jump box |
|
358 | # Renders the project quick-jump box | |
359 | def render_project_jump_box |
|
359 | def render_project_jump_box | |
360 | projects = projects_for_jump_box(User.current) |
|
360 | projects = projects_for_jump_box(User.current) | |
361 | if projects.any? |
|
361 | text = @project.try(:name) || l(:label_jump_to_a_project) | |
362 | text = @project.try(:name) || l(:label_jump_to_a_project) |
|
362 | trigger = content_tag('span', text, :class => 'drdn-trigger') | |
363 | trigger = content_tag('span', text, :class => 'drdn-trigger') |
|
363 | q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => projects_path(:format => 'js')}) | |
364 | q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => projects_path(:format => 'js')}) |
|
364 | all = link_to(l(:label_project_all), projects_path(:jump => current_menu_item), :class => (@project.nil? && controller.class.main_menu ? 'selected' : nil)) | |
365 | all = link_to(l(:label_project_all), projects_path(:jump => current_menu_item), :class => (@project.nil? && controller.class.main_menu ? 'selected' : nil)) |
|
365 | content = content_tag('div', | |
366 | content = content_tag('div', |
|
366 | content_tag('div', q, :class => 'quick-search') + | |
367 | content_tag('div', q, :class => 'quick-search') + |
|
367 | content_tag('div', render_projects_for_jump_box(projects, @project), :class => 'drdn-items projects selection') + | |
368 |
|
|
368 | content_tag('div', all, :class => 'drdn-items all-projects selection'), | |
369 | content_tag('div', all, :class => 'drdn-items all-projects selection'), |
|
369 | :class => 'drdn-content' | |
370 | :class => 'drdn-content' |
|
370 | ) | |
371 | ) |
|
371 | ||
372 |
|
372 | content_tag('span', trigger + content, :id => "project-jump", :class => "drdn") | ||
373 | content_tag('span', trigger + content, :id => "project-jump", :class => "drdn") |
|
|||
374 | end |
|
|||
375 | end |
|
373 | end | |
376 |
|
374 | |||
377 | def project_tree_options_for_select(projects, options = {}) |
|
375 | def project_tree_options_for_select(projects, options = {}) |
@@ -202,6 +202,9 div + .drdn-items {border-top:1px solid #ccc;} | |||||
202 | .drdn-items.selection>*.selected:before { |
|
202 | .drdn-items.selection>*.selected:before { | |
203 | content:"\2713 "; |
|
203 | content:"\2713 "; | |
204 | } |
|
204 | } | |
|
205 | .drdn-items.selection:empty { | |||
|
206 | border: none; | |||
|
207 | } | |||
205 | .drdn-items>span {color:#999;} |
|
208 | .drdn-items>span {color:#999;} | |
206 |
|
209 | |||
207 | #project-jump.drdn {width:200px;display:inline-block;} |
|
210 | #project-jump.drdn {width:200px;display:inline-block;} |
General Comments 0
You need to be logged in to leave comments.
Login now