ask for default site locale when creating the first site

This commit is contained in:
Didier Lafforgue 2012-02-07 01:29:33 +01:00
parent 112d61ac3b
commit f2467bbf42
5 changed files with 15 additions and 13 deletions

View File

@ -7,7 +7,7 @@ module Locomotive
before_filter :allow_installation? before_filter :allow_installation?
helper Locomotive::BaseHelper helper Locomotive::BaseHelper, Locomotive::SitesHelper
def show def show
request.get? ? self.handle_get : self.handle_post request.get? ? self.handle_get : self.handle_post

View File

@ -5,5 +5,11 @@ module Locomotive
current_site.locales + (Locomotive.config.site_locales - current_site.locales) current_site.locales + (Locomotive.config.site_locales - current_site.locales)
end end
def options_for_site_locales
Locomotive.config.site_locales.map do |locale|
[I18n.t("locomotive.locales.#{locale}"), locale]
end
end
end end
end end

View File

@ -15,16 +15,10 @@
- if multi_sites? - if multi_sites?
= f.input :subdomain, :required => true = f.input :subdomain, :required => true
- if Locomotive.default_site_template_present? %li{ :class => 'select optional', :id => 'default_site_locale' }
%li{ :class => 'question', :id => 'default_site_template_input' } %label{ :for => 'default_site_locale_input' }= t('.default_site_locale')
= check_box_tag 'default_site_template', '1', params[:default_site_template].blank? || params[:default_site_template] == '1' = select_tag 'site[locales][]', options_for_select(options_for_site_locales, @site.default_locale), :id => 'default_site_locale_input'
%label{ :for => 'default_site_template' }!= t('formtastic.labels.import.new.default_site_template') %p.inline-hints!= t('.default_site_locales_hints')
%li{ :class => 'string optional', :id => 'zipfile_input', :style => "#{'display: none' if Locomotive.default_site_template_present?}" }
%label{ :for => 'zipfile' }= t('formtastic.labels.import.new.source')
= file_field_tag 'zipfile'
- if Locomotive.default_site_template_present?
%p.inline-hints!= t('.back_to_default_template')
.footer .footer
= submit_tag t('.next') = submit_tag t('.next')

View File

@ -287,8 +287,9 @@ en:
next: Create account next: Create account
step_2: step_2:
title: "Step 2/2 — Create your first site" title: "Step 2/2 — Create your first site"
explanations: "If you already uploaded the default site template (see instructions), you can use it right away. Or you can upload a site template as a zip file (free available templates <a href=\"http://www.locomotivecms.com/support/themes\">here</a>)." explanations: "You are almost done. Please give a name to your first site and pick up the default locale."
back_to_default_template: "Click <a href='#'>here</a> to select the default site template instead" default_site_locale: Site locale
default_site_locales_hints: You can add more locales in the Settings panel later.
next: Create site next: Create site
public: public:

View File

@ -126,6 +126,7 @@ x missing custom_fields
- display by categories does not work when localized - display by categories does not work when localized
- disallow to click twice on the submit form button (spinner ?) - disallow to click twice on the submit form button (spinner ?)
- message to notify people if their browser is too old - message to notify people if their browser is too old
- weird behaviour when changing the default locale of a site
? install a site by default at the first installation (without asking) ? install a site by default at the first installation (without asking)