Skip to content

Commit

Permalink
Merge pull request #1936 from keram/locale_picker
Browse files Browse the repository at this point in the history
shared locale_picker partial tpl
  • Loading branch information
ugisozols committed Sep 12, 2012
2 parents fb2bff0 + 983b97e commit 0a82ec5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
11 changes: 11 additions & 0 deletions core/app/views/refinery/admin/_locale_picker.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<input type="hidden" name="switch_locale" id="switch_locale" value="<%= local_assigns[:current_locale] %>" />
<% if (locales ||= Refinery::I18n.frontend_locales).present? and locales.many? %>
<ul id="switch_locale_picker" class="clearfix">
<% locales.each do |locale| %>
<li<%= %Q{ class=selected} if locale.to_s == local_assigns[:current_locale].to_s %>>
<%= link_to refinery_icon_tag(%Q{flags/#{locale}.png}, :size => '32x22'),
refinery.url_for(:switch_locale => locale) %>
</li>
<% end %>
</ul>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
:include_object_name => true %>

<% if localized? -%>
<%%= render "locale_picker",
:current_locale => Globalize.locale if Refinery.i18n_enabled? -%>

<%%= render '/refinery/admin/locale_picker',
:current_locale => Globalize.locale if Refinery.i18n_enabled? %>
<% end -%>
<% attributes.each_with_index do |attribute, index| -%>
<% if attribute.type.to_s == 'image' -%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ module Refinery
directory "admin" do
directory "rspec_product_tests" do
file "_form.html.erb"
file "_locale_picker.html.erb"
file "_sortable_list.html.erb"
file "edit.html.erb"
file "index.html.erb"
Expand Down
2 changes: 1 addition & 1 deletion pages/app/views/refinery/admin/pages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render '/refinery/admin/error_messages', :object => @page, :include_object_name => true %>
<%= render 'locale_picker', :current_locale => Globalize.locale if Refinery.i18n_enabled? %>
<%= render '/refinery/admin/locale_picker', :current_locale => Globalize.locale if Refinery.i18n_enabled? %>

<div class="field">
<%= f.label :title %>
Expand Down
11 changes: 0 additions & 11 deletions pages/app/views/refinery/admin/pages/_locale_picker.html.erb

This file was deleted.

0 comments on commit 0a82ec5

Please sign in to comment.