Commit fb36355f2ff6d4c5465158608c60e0d33cb552ee

Authored by Dmitriy Zaporozhets
1 parent 01be3204

Different search placeholder depdends on area

app/helpers/application_helper.rb
... ... @@ -226,4 +226,13 @@ module ApplicationHelper
226 226 content_tag :i, nil, class: 'icon-lock cgreen'
227 227 end
228 228  
  229 + def search_placeholder
  230 + if @project && @project.persisted?
  231 + "Search in this project"
  232 + elsif @group && @group.persisted?
  233 + "Search in this group"
  234 + else
  235 + "Search"
  236 + end
  237 + end
229 238 end
... ...
app/views/layouts/_search.html.haml
1 1 .search
2 2 = form_tag search_path, method: :get, class: 'navbar-form pull-left' do |f|
3   - = text_field_tag "search", nil, placeholder: "Search", class: "search-input"
  3 + = text_field_tag "search", nil, placeholder: search_placeholder, class: "search-input"
4 4 = hidden_field_tag :group_id, @group.try(:id)
5 5 - if @project && @project.persisted?
6 6 = hidden_field_tag :project_id, @project.id
... ...