twitter-bootstrap-helpers 0.0.2 → 0.0.3
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.
@@ -3,33 +3,33 @@ module TwitterBootstrapHelpers
|
|
3
3
|
def icon_for(icon_name)
|
4
4
|
content_tag :i, '', :class => "icon-#{icon_name}"
|
5
5
|
end
|
6
|
-
end
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
def alert_message(opts = {}, &block)
|
8
|
+
alert_classes = ["alert"]
|
9
|
+
alert_classes << "alert-#{opts[:type]}" if opts[:type]
|
10
|
+
alert_classes << opts[:class] if opts[:class]
|
12
11
|
|
13
|
-
|
12
|
+
contents = capture(&block)
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
if opts[:heading]
|
15
|
+
alert_classes << "alert-block"
|
16
|
+
contents = alert_heading_tag + contents
|
17
|
+
end
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
if opts[:show_close_button]
|
20
|
+
contents = alert_close_tag + contents
|
21
|
+
end
|
22
|
+
|
23
|
+
content_tag :div, contents, :class => alert_classes.join(' ')
|
22
24
|
end
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
+
def alert_close_tag
|
27
|
+
content_tag(:a, 'x', :class => 'close', :data => {:dismiss => 'alert'})
|
28
|
+
end
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
+
def alert_heading_tag(heading)
|
31
|
+
contents = content_tag(:h4, heading, :class => 'alert-heading')
|
32
|
+
end
|
30
33
|
|
31
|
-
def alert_heading_tag(heading)
|
32
|
-
contents = content_tag(:h4, heading, :class => 'alert-heading')
|
33
34
|
end
|
34
|
-
|
35
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.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-14 00:00:00.
|
12
|
+
date: 2012-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A set of Ruby on Rails view helpers to be used with Twitter Bootstrap
|
15
15
|
email:
|
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
version: '0'
|
49
49
|
requirements: []
|
50
50
|
rubyforge_project:
|
51
|
-
rubygems_version: 1.8.
|
51
|
+
rubygems_version: 1.8.24
|
52
52
|
signing_key:
|
53
53
|
specification_version: 3
|
54
54
|
summary: A set of Ruby on Rails view helpers to be used with Twitter Bootstrap
|