polish the content_locale picker + does not display the picker if less than 2 locales

This commit is contained in:
did 2012-01-14 02:08:03 +01:00
parent 0489bbe4c2
commit d191d2d783
4 changed files with 15 additions and 9 deletions

View File

@ -29,7 +29,7 @@
width: 20px;
height: 20px;
margin-right: 4px;
margin-right: 7px;
}
span.text {

View File

@ -4,7 +4,7 @@ class Locomotive::ContentLocalePickerCell < Cell::Base
site = args[:site]
locale = args[:locale].to_s
logger.debug "site.locales = #{site.locales.inspect}"
logger.debug "site.locales = #{site.locales.inspect} / #{site.locales.size}"
if site.locales.empty? || site.locales.size < 2
''

View File

@ -2,11 +2,12 @@
.action
= link_to content_tag(:em) + content_tag(:span, t('locomotive.content_types.index.new')), new_content_type_url, :class => 'button'
.action
= link_to '#', :id => 'content-locale-picker-link', :class => 'button' do
%span.hand
&nbsp;
- if current_site.locales.size > 1
.action
= link_to '#', :id => 'content-locale-picker-link', :class => 'button' do
%span.hand
&nbsp;
= image_tag "locomotive/icons/flags/#{current_content_locale}.png", :class => 'flag'
= image_tag "locomotive/icons/flags/#{current_content_locale}.png", :class => 'flag'
%span.text= current_content_locale
%span.text= current_content_locale

View File

@ -68,8 +68,13 @@ x edit my site
- custom_fields: use the appropriate icon to drag select options
- i18n
x add locales a site responds to
- locale switcher
x locale switcher
- back to default locale (if changed in settings)
- front
- inline editor
- remove inline-editor tag
- rack
- iframe
- disallow to click twice on the submit form button (spinner ?)
- message to notify people if their browser is too old