Different search placeholder depdends on area
This commit is contained in:
parent
01be32043a
commit
fb36355f2f
|
@ -226,4 +226,13 @@ module ApplicationHelper
|
|||
content_tag :i, nil, class: 'icon-lock cgreen'
|
||||
end
|
||||
|
||||
def search_placeholder
|
||||
if @project && @project.persisted?
|
||||
"Search in this project"
|
||||
elsif @group && @group.persisted?
|
||||
"Search in this group"
|
||||
else
|
||||
"Search"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.search
|
||||
= form_tag search_path, method: :get, class: 'navbar-form pull-left' do |f|
|
||||
= text_field_tag "search", nil, placeholder: "Search", class: "search-input"
|
||||
= text_field_tag "search", nil, placeholder: search_placeholder, class: "search-input"
|
||||
= hidden_field_tag :group_id, @group.try(:id)
|
||||
- if @project && @project.persisted?
|
||||
= hidden_field_tag :project_id, @project.id
|
||||
|
|
Loading…
Reference in New Issue