8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/spurs/modal/builder.rb', line 8
def build_modal(modal_id, content, options={ })
if !options[:class] then
options[:class] = ""
end
options[:class].concat(" modal fade #{modal_id}")
c = String.new
if options[:header]
= options.delete(:header)
if [:title]
c.concat(build_modal_title([:title], [:icon]))
end
end
c.concat(content_tag(:div, content, :class => "modal-body"))
if options[:actions]
actions_options = options.delete(:actions)
c.concat((actions_options).html_safe)
end
content_tag(:div, c.html_safe, :class => options[:class], 'data-modal-id' => "#{modal_id}")
end
|