world-flags 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +4 -0
- data/VERSION +1 -1
- data/lib/world_flags/view_helper.rb +19 -2
- data/world-flags.gemspec +1 -1
- metadata +2 -2
data/README.textile
CHANGED
@@ -108,6 +108,10 @@ The flag_title will render the following list item:
|
|
108
108
|
|
109
109
|
Note: The ` is needed in order for the background (flag icon) to have something to be displayed against.
|
110
110
|
|
111
|
+
The :title and :content can also be set to a string which is then displayed
|
112
|
+
|
113
|
+
= flag :ar, :title => 'Argentina is the best', :content => 'Argh!'
|
114
|
+
|
111
115
|
To also get content rendered for the <li>
|
112
116
|
|
113
117
|
= flags [:ar, :br, :gb], :content => true
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
@@ -42,8 +42,25 @@ module WorldFlags
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def flag code, name, options = {}
|
45
|
-
label = options[:content]
|
46
|
-
|
45
|
+
label = case options[:content]
|
46
|
+
when true
|
47
|
+
name
|
48
|
+
when String
|
49
|
+
options[:content]
|
50
|
+
else
|
51
|
+
' '
|
52
|
+
end
|
53
|
+
|
54
|
+
title = case options[:title]
|
55
|
+
when true
|
56
|
+
name
|
57
|
+
when String
|
58
|
+
options[:title]
|
59
|
+
else
|
60
|
+
nil
|
61
|
+
end
|
62
|
+
|
63
|
+
extra_options = title ? {:title => title } : {}
|
47
64
|
selected = flag_selected?(code, options) ? 'selected' : ''
|
48
65
|
content_tag :li, label.html_safe, {:class => "flag #{code} #{selected}", :'data-country' => name, :'data-cc' => code}.merge(options[:html] || {}).merge(extra_options)
|
49
66
|
end
|
data/world-flags.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: world-flags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
segments:
|
171
171
|
- 0
|
172
|
-
hash:
|
172
|
+
hash: 2339332565695935024
|
173
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
174
|
none: false
|
175
175
|
requirements:
|