tkh_menus 0.1.2 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.2
6
+
7
+ * Added language switcher partial
8
+ * Added language switcher for navbar partial
9
+
10
+
5
11
  ## 0.1.2
6
12
 
7
13
  * Debugged ordering of sub-menu items in navbar for pages
@@ -0,0 +1,26 @@
1
+ <% def full_language_name( lang = :en) %>
2
+ <% list = { :en => 'English',
3
+ :fr => 'Français',
4
+ :es => 'Español',
5
+ :de => 'Deutsch'
6
+ }
7
+ %>
8
+ <% list[lang] %>
9
+ <% end %>
10
+
11
+ <% if I18n.available_locales.size > 1 %>
12
+
13
+ <div class="btn-group">
14
+ <a class="btn btn-medium btn-primary btn-success dropdown-toggle" data-toggle="dropdown" href="#">
15
+ <%= full_language_name(I18n.locale) %>
16
+ <span class="caret"></span>
17
+ </a>
18
+ <ul class="dropdown-menu">
19
+ <% for loc in I18n.available_locales %>
20
+ <%= content_tag( :li, link_to( full_language_name(loc), :locale => loc )) unless loc.to_s == I18n.locale.to_s %>
21
+ <% end %>
22
+ </ul>
23
+ </div>
24
+
25
+ <% end -%>
26
+ <br />
@@ -0,0 +1,22 @@
1
+ <% if I18n.available_locales.size > 1 %>
2
+
3
+ <% def full_language_name( lang = :en) %>
4
+ <% list = { :en => 'English',
5
+ :fr => 'Français',
6
+ :es => 'Español',
7
+ :de => 'Deutsch'
8
+ }
9
+ %>
10
+ <% list[lang] %>
11
+ <% end %>
12
+
13
+ <li class="dropdown active">
14
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#"><%= full_language_name(I18n.locale) %><span class="caret"></span></a>
15
+ <ul class="dropdown-menu">
16
+ <% for loc in I18n.available_locales %>
17
+ <%= content_tag( :li, link_to( full_language_name(loc), :locale => loc )) unless loc.to_s == I18n.locale.to_s %>
18
+ <% end %>
19
+ </ul>
20
+ </li>
21
+
22
+ <% end -%>
@@ -40,4 +40,7 @@
40
40
  <% end -%>
41
41
  <% end %>
42
42
  <% end -%>
43
+
44
+ <%= render 'shared/language_switcher_for_navbar' %>
45
+
43
46
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module TkhMenus
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_menus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: '0.2'
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: 2013-01-11 00:00:00.000000000 Z
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -107,6 +107,8 @@ files:
107
107
  - app/views/menus/index.html.erb
108
108
  - app/views/menus/new.html.erb
109
109
  - app/views/shared/_context_menu.html.erb
110
+ - app/views/shared/_language_switcher.html.erb
111
+ - app/views/shared/_language_switcher_for_navbar.html.erb
110
112
  - app/views/shared/_menu_for_navbar.html.erb
111
113
  - app/views/shared/_menus.html.erb
112
114
  - config/routes.rb
@@ -169,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
171
  version: '0'
170
172
  segments:
171
173
  - 0
172
- hash: -4585053658739166797
174
+ hash: -3862957743566485703
173
175
  required_rubygems_version: !ruby/object:Gem::Requirement
174
176
  none: false
175
177
  requirements:
@@ -178,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
180
  version: '0'
179
181
  segments:
180
182
  - 0
181
- hash: -4585053658739166797
183
+ hash: -3862957743566485703
182
184
  requirements: []
183
185
  rubyforge_project:
184
186
  rubygems_version: 1.8.23