15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'app/helpers/alchemy/admin/ajax_forms_helper.rb', line 15
def search_panel(options = {}, &block)
submit_button = options.fetch(:enable_submit, true)
klass = options.delete(:class) || []
content_tag(:div, class: "search_panel #{klass.join(" ")}", ** options) do
if @query
simple_form_for(@query, url: polymorphic_path([:admin, @query.klass]), method: :get) do |f|
sb = ActiveSupport::SafeBuffer.new
sb << content_tag(:div, class: "search_fields_group") do
search_fields = ActiveSupport::SafeBuffer.new
search_fields << f.input(resource_handler.search_field_name,
label: false,
input_html: {
class: 'search_input_field',
placeholder: Alchemy.t(:search)
},
wrapper_html: {
class: "full-width"
}
)
search_fields << capture do
block.call(f)
end
search_fields
end
if submit_button
sb << content_tag(:div, class: "action_buttons") do
f.submit(::I18n.t('alchemy_ajax_form.submit_search'))
end
end
sb
end
end
end
end
|