Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shared locale_picker partial tpl #1936

Merged
merged 1 commit into from
Sep 12, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.