tkh_admin_panel 0.0.4 → 0.0.5

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.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # TKH Admin Panel
2
2
 
3
3
 
4
+ ## 0.0.5
5
+
6
+ * Added language switcher
7
+
8
+
4
9
  ## 0.0.4
5
10
 
6
11
  * Admin layout doesn't blow up if SETTINGS constant is not initialized in host app
data/README.md CHANGED
@@ -16,7 +16,9 @@ And then execute:
16
16
 
17
17
  $ bundle
18
18
 
19
- And then of course restart your server!
19
+ And then of course restart your server! Typically:
20
+
21
+ $ rails s
20
22
 
21
23
 
22
24
  ## Usage
@@ -23,7 +23,6 @@
23
23
  <div class="container-fluid">
24
24
  <div class="row-fluid">
25
25
  <div class="span12">
26
- <p><b><%= I18n.locale == :en ? link_to('switch to Spanish', locale: :es) : link_to('switch to English', locale: :en) %></b></p>
27
26
  <h1>Admin Panel<%= " for #{SETTINGS['site_name']}" if defined?(SETTINGS) && SETTINGS['site_name'] %></h1>
28
27
 
29
28
  <% flash.each do |name, msg| %>
@@ -40,6 +39,7 @@
40
39
  <%= yield %>
41
40
  </div>
42
41
  <div id="sidebar" class="span3">
42
+ <%= render 'shared/language_switcher' %>
43
43
  <%= yield :admin_sidebar %>
44
44
  </div>
45
45
  </div><!--/row-->
@@ -0,0 +1,21 @@
1
+ <% def full_language_name( lang = :en) %>
2
+ <% list = {:en => 'English', :fr => 'Français', :es => 'Español'} %>
3
+ <% list[lang] %>
4
+ <% end %>
5
+
6
+ <% if I18n.available_locales.size > 1 %>
7
+
8
+ <div class="btn-group">
9
+ <a class="btn btn-medium btn-primary btn-success dropdown-toggle" data-toggle="dropdown" href="#">
10
+ <%= full_language_name(I18n.locale) %>
11
+ <span class="caret"></span>
12
+ </a>
13
+ <ul class="dropdown-menu">
14
+ <% for loc in I18n.available_locales %>
15
+ <%= link_to full_language_name(loc), :locale => loc %>
16
+ <% end %>
17
+ </ul>
18
+ </div>
19
+
20
+ <% end -%>
21
+ <br />
@@ -1,3 +1,3 @@
1
1
  module TkhAdminPanel
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_admin_panel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-07-26 00:00:00.000000000 Z
12
+ date: 2012-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -78,6 +78,7 @@ files:
78
78
  - app/assets/stylesheets/admin.css.scss
79
79
  - app/assets/stylesheets/bootstrap_and_overrides.css.scss
80
80
  - app/views/layouts/admin.html.erb
81
+ - app/views/shared/_language_switcher.html.erb
81
82
  - lib/tkh_admin_panel.rb
82
83
  - lib/tkh_admin_panel/version.rb
83
84
  - public/.DS_Store