twitter-bootstrap-helpers 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module TwitterBootstrapHelpers
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -4,4 +4,32 @@ module TwitterBootstrapHelpers
4
4
  content_tag :i, '', :class => "icon-#{icon_name}"
5
5
  end
6
6
  end
7
+
8
+ def alert_message(opts = {}, &block)
9
+ alert_classes = ["alert"]
10
+ alert_classes << "alert-#{opts[:type]}" if opts[:type]
11
+ alert_classes << opts[:class] if opts[:class]
12
+
13
+ contents = capture(&block)
14
+
15
+ if opts[:heading]
16
+ alert_classes << "alert-block"
17
+ contents = alert_heading_tag + contents
18
+ end
19
+
20
+ if opts[:show_close_button]
21
+ contents = alert_close_tag + contents
22
+ end
23
+
24
+ content_tag :div, contents, :class => alert_classes.join(' ')
25
+ end
26
+
27
+ def alert_close_tag
28
+ content_tag(:a, 'x', :class => 'close', :data => {:dismiss => 'alert'})
29
+ end
30
+
31
+ def alert_heading_tag(heading)
32
+ contents = content_tag(:h4, heading, :class => 'alert-heading')
33
+ end
34
+
7
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: