4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/helpers/bootstrap_panel_helper.rb', line 4
def panel(options={}, &block)
unless block_given?
raise 'Missing block'
end
panel_options = options.dup
panel_options[:class] = parse_html_classes_to_arr panel_options[:class]
panel_options[:class] << 'panel'
= panel_options.delete :header
title = panel_options.delete :title
= panel_options.delete :footer
context = panel_options.delete :context
unless %w(primary info success warning danger).include? context.to_s
context = :default
end
panel_options[:class] << "panel-#{context}"
content = []
content << ( || title)
content << panel_body(&block)
content << ()
content_tag :div, content.join("\n").html_safe, panel_options
end
|