From 6d5dd4a80f59c28027a65e15c3150d4573f2ada1 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Wed, 27 Nov 2013 17:50:33 +0800 Subject: [PATCH] Changed Site Valid Locales to In Use Locales --- app/controllers/admin/links_controller.rb | 2 +- app/controllers/admin/pages_controller.rb | 2 +- app/controllers/admin/sites_controller.rb | 8 +++++ app/helpers/admin/assets_helper.rb | 2 +- app/helpers/admin/tags_helper.rb | 2 +- app/models/user/user.rb | 3 +- app/views/admin/ad_images/_form.html.erb | 4 +-- .../asset_categories/_asset_category.html.erb | 2 +- .../admin/asset_categories/_form.html.erb | 2 +- .../admin/asset_categories/index.html.erb | 4 +-- app/views/admin/assets/_asset.html.erb | 2 +- app/views/admin/assets/_form.html.erb | 4 +-- app/views/admin/assets/file_upload.html.erb | 4 +-- .../attributes/_attribute_field.html.erb | 2 +- app/views/admin/attributes/new.html.erb | 2 +- app/views/admin/categories/_category.html.erb | 2 +- app/views/admin/categories/_form.html.erb | 2 +- app/views/admin/categories/_index.html.erb | 2 +- app/views/admin/items/_form_link.html.erb | 4 +-- app/views/admin/items/_form_page.html.erb | 4 +-- app/views/admin/items/_node.html.erb | 2 +- app/views/admin/items/_site_bar.html.erb | 4 +-- app/views/admin/links/_form.html.erb | 4 +-- app/views/admin/module_tags/_add.html.erb | 2 +- app/views/admin/page_parts/edit.html.erb | 6 ++-- .../personal_plugin_intros/index.html.erb | 4 +-- app/views/admin/role_filters/_form.html.erb | 2 +- app/views/admin/role_filters/_index.html.erb | 2 +- .../admin/role_filters/_role_filter.html.erb | 2 +- app/views/admin/roles/add_sub_role.html.erb | 2 +- app/views/admin/roles/edit.html.erb | 2 +- app/views/admin/roles/edit_sub_role.html.erb | 2 +- app/views/admin/roles/new.html.erb | 2 +- app/views/admin/sites/preference.html.erb | 19 +++++++++-- app/views/admin/sites/search_engine.html.erb | 8 ++--- app/views/admin/sites/site_info.html.erb | 11 +++---- app/views/admin/sites/sitemap.html.erb | 4 +-- app/views/admin/tags/_form.html.erb | 2 +- app/views/admin/tags/_merge_modal.html.erb | 2 +- .../admin/users_new_interface/_form.html.erb | 4 +-- .../_form_user_data.html.erb | 4 +-- .../users_new_interface/_user_basic.html.erb | 8 ++--- app/views/basic_infos/_form_page.html.erb | 8 ++--- app/views/js/_support_member_form_js.erb | 32 +++++++++---------- .../attribute_field/_list_block.html.erb | 8 ++--- .../_placeholder_block.html.erb | 8 ++--- config/routes.rb | 1 + .../back_end/bulletins/_form.html.erb | 4 +-- .../back_end/bulletins/_form_back.html.erb | 4 +-- .../back_end/bulletins/_form_file.html.erb | 4 +-- .../back_end/bulletins/_form_link.html.erb | 2 +- .../_archive_file_category.html.erb | 2 +- .../archive_file_categorys/_form.html.erb | 2 +- .../archive_file_categorys/index.html.erb | 2 +- .../back_end/archive_files/_form.html.erb | 4 +-- .../archive_files/_form_file.html.erb | 4 +-- .../ask_categories/_ask_category.html.erb | 2 +- .../back_end/ask_categories/_form.html.erb | 2 +- .../back_end/ask_categories/index.html.erb | 2 +- .../panel/faq/back_end/qas/_form.html.erb | 4 +-- .../faq/back_end/qas/_form_qa_file.html.erb | 4 +-- .../faq/back_end/qas/_form_qa_link.html.erb | 2 +- .../gallery/back_end/albums/_form.html.erb | 4 +-- .../gallery/back_end/albums/show.html.erb | 6 ++-- .../back_end/page_contexts/_form.html.erb | 4 +-- .../writing_book_categorys/_form.html.erb | 2 +- .../_quick_edit_qe.html.erb | 2 +- .../_writing_book_category.html.erb | 2 +- .../writing_book_categorys/index.html.erb | 2 +- .../writing_books/_author_type_qe.html.erb | 2 +- .../back_end/writing_books/_form.html.erb | 4 +-- .../writing_books/_form_file.html.erb | 2 +- .../writing_books/_paper_type_qe.html.erb | 2 +- .../desktop/personal_books/_form.html.erb | 4 +-- .../personal_books/_form_file.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/writing_books/_form.html.erb | 4 +-- .../plugin/writing_books/_form_file.html.erb | 2 +- .../_form.html.erb | 2 +- .../_quick_edit_qe.html.erb | 2 +- .../_writing_conference_category.html.erb | 2 +- .../index.html.erb | 2 +- .../_author_type_qe.html.erb | 2 +- .../writing_conferences/_form.html.erb | 4 +-- .../writing_conferences/_form_file.html.erb | 2 +- .../_paper_type_qe.html.erb | 2 +- .../desktop/conference_pages/_form.html.erb | 4 +-- .../conference_pages/_form_file.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/writing_conferences/_form.html.erb | 4 +-- .../writing_conferences/_form_file.html.erb | 2 +- .../back_end/diplomas/_form.html.erb | 4 +-- .../desktop/personal_diplomas/_form.html.erb | 4 +-- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/diplomas/_form.html.erb | 4 +-- .../_experience_category.html.erb | 2 +- .../experience_categorys/_form.html.erb | 2 +- .../_quick_edit_qe.html.erb | 2 +- .../experience_categorys/index.html.erb | 2 +- .../experiences/_experience_type_qe.html.erb | 2 +- .../back_end/experiences/_form.html.erb | 4 +-- .../personal_experiences/_form.html.erb | 4 +-- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/experiences/_form.html.erb | 4 +-- .../back_end/honors/_honor_type_qe.html.erb | 2 +- .../desktop/personal_honors/_form.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../writing_journal_categorys/_form.html.erb | 2 +- .../_quick_edit_qe.html.erb | 2 +- .../_writing_journal_category.html.erb | 2 +- .../writing_journal_categorys/index.html.erb | 2 +- .../writing_journals/_author_type_qe.html.erb | 2 +- .../back_end/writing_journals/_form.html.erb | 4 +-- .../writing_journals/_form_file.html.erb | 2 +- .../writing_journals/_level_type_qe.html.erb | 2 +- .../desktop/journal_pages/_form.html.erb | 4 +-- .../desktop/journal_pages/_form_file.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/writing_journals/_form.html.erb | 4 +-- .../writing_journals/_form_file.html.erb | 2 +- .../personal_lab/back_end/labs/_form.html.erb | 4 +-- .../back_end/labs/_form_file.html.erb | 2 +- .../desktop/personal_labs/_form.html.erb | 4 +-- .../desktop/personal_labs/_form_file.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../personal_lab/plugin/labs/_form.html.erb | 4 +-- .../plugin/labs/_form_file.html.erb | 2 +- .../writing_patent_categorys/_form.html.erb | 2 +- .../_quick_edit_qe.html.erb | 2 +- .../_writing_book_category.html.erb | 2 +- .../writing_patent_categorys/index.html.erb | 2 +- .../back_end/writing_patents/_form.html.erb | 4 +-- .../writing_patents/_form_file.html.erb | 2 +- .../writing_patents/_patent_type_qe.html.erb | 2 +- .../desktop/personal_patents/_form.html.erb | 4 +-- .../personal_patents/_form_file.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/writing_patents/_form.html.erb | 4 +-- .../writing_patents/_form_file.html.erb | 2 +- .../back_end/project_categorys/_form.html.erb | 2 +- .../_project_category.html.erb | 2 +- .../back_end/project_categorys/index.html.erb | 2 +- .../back_end/projects/_form.html.erb | 4 +-- .../back_end/projects/_form_file.html.erb | 2 +- .../projects/_project_type_qe.html.erb | 2 +- .../desktop/personal_projects/_form.html.erb | 4 +-- .../personal_projects/_form_file.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/projects/_form.html.erb | 4 +-- .../plugin/projects/_form_file.html.erb | 2 +- .../back_end/researchs/_form.html.erb | 4 +-- .../back_end/researchs/_form_file.html.erb | 2 +- .../desktop/personal_researchs/_form.html.erb | 4 +-- .../personal_researchs/_form_file.html.erb | 2 +- .../desktop/plugin_intros/_form.html.erb | 4 +-- .../plugin/researchs/_form.html.erb | 4 +-- .../plugin/researchs/_form_file.html.erb | 2 +- .../survey/back_end/surveys/_form.html.erb | 8 ++--- .../surveys/_form_survey_question.html.erb | 2 +- .../_form_survey_question_option.html.erb | 2 +- .../_form_survey_question_radiogroup.html.erb | 2 +- .../web_link_categorys/_form.html.erb | 2 +- .../_web_link_category.html.erb | 2 +- .../web_link_categorys/index.html.erb | 4 +-- .../back_end/web_links/_form.html.erb | 4 +-- 165 files changed, 289 insertions(+), 267 deletions(-) diff --git a/app/controllers/admin/links_controller.rb b/app/controllers/admin/links_controller.rb index 63744182..ad146fc5 100644 --- a/app/controllers/admin/links_controller.rb +++ b/app/controllers/admin/links_controller.rb @@ -37,7 +37,7 @@ class Admin::LinksController < Admin::ItemsController link = Link.find(params[:id]) m = {} m["public"] = link.is_published ? 1 : 0 - m["link"] = @site_valid_locales.inject([]) do |result, locale| + m["link"] = @site_in_use_locales.inject([]) do |result, locale| result << [locale, (link.enabled_for && link.enabled_for.include?(locale)) ? 1 : 0, (link.menu_enabled_for && link.menu_enabled_for[locale].eql?("true")) ? 1 :0] end render json: JSON.pretty_generate(m) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index ef16c878..7f3ecde4 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -73,7 +73,7 @@ class Admin::PagesController < Admin::ItemsController m["category"] = page.category.present? ? page.category.map{|c| c.to_s} : [] m["tags"] = page.tag.present? ? page.tag.map{|c| c.to_s} : [] m["public"] = page.is_published ? 1 : 0 - m["link"] = @site_valid_locales.inject([]) do |link, locale| + m["link"] = @site_in_use_locales.inject([]) do |link, locale| link << [locale, (page.enabled_for && page.enabled_for.include?(locale)) ? 1 : 0, (page.menu_enabled_for && page.menu_enabled_for[locale].eql?('true')) ? 1 :0] end m["count"] = page.frontend_data_count diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 96088f42..50d399a9 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -21,6 +21,7 @@ class Admin::SitesController < OrbitBackendController end def update + params[:site][:defalut_locale] = "zh_tw" if params[:site][:default_locale].blank? @site.update_attributes(params[:site]) redirect_to :back end @@ -71,6 +72,13 @@ class Admin::SitesController < OrbitBackendController end + def reset_default_locale + @site.defalut_locale = params[:default_locale] + if @site.save + render :nothing => true + end + end + def change_design design = Design.find(params[:site_id]) rescue nil update_design(design) if design diff --git a/app/helpers/admin/assets_helper.rb b/app/helpers/admin/assets_helper.rb index 9a2fd0a3..acc65c11 100644 --- a/app/helpers/admin/assets_helper.rb +++ b/app/helpers/admin/assets_helper.rb @@ -2,7 +2,7 @@ module Admin::AssetsHelper def show_all_fields(asset, field) a = [] - @site_valid_locales.each do |locale| + @site_in_use_locales.each do |locale| a << asset.send("#{field}_translations")[locale] rescue nil end a.join(' - ') diff --git a/app/helpers/admin/tags_helper.rb b/app/helpers/admin/tags_helper.rb index a9c48c3a..4d195e63 100644 --- a/app/helpers/admin/tags_helper.rb +++ b/app/helpers/admin/tags_helper.rb @@ -6,7 +6,7 @@ module Admin::TagsHelper end def show_names_slash(tag) - span_names = @site_valid_locales.inject([]) do |names, locale| + span_names = @site_in_use_locales.inject([]) do |names, locale| names << content_tag(:span, tag.name_translations[locale], class: "tag") end span_names.join(" / ").html_safe diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 2bfc4eeb..88760a32 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -59,7 +59,8 @@ class User validates :user_id, :presence => { :message => I18n.t("users.user_id_not_null") } , - :length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") } + :length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") }, + :uniqueness => true def email_required? false diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index 71d6dbf4..1ddecf8b 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -166,7 +166,7 @@ - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <%= asset_category.title_translations[locale] rescue nil %> <% end %> diff --git a/app/views/admin/asset_categories/_form.html.erb b/app/views/admin/asset_categories/_form.html.erb index 12a4693b..81c8973f 100644 --- a/app/views/admin/asset_categories/_form.html.erb +++ b/app/views/admin/asset_categories/_form.html.erb @@ -11,7 +11,7 @@
<%= f.fields_for :title_translations do |f| %> - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %>
<%= label_tag "name-#{locale}", "#{t(:name)}-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
diff --git a/app/views/admin/asset_categories/index.html.erb b/app/views/admin/asset_categories/index.html.erb index 0ca08b7b..9725a43e 100644 --- a/app/views/admin/asset_categories/index.html.erb +++ b/app/views/admin/asset_categories/index.html.erb @@ -8,7 +8,7 @@ <%= t(:key) %> - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> <% end %> @@ -23,7 +23,7 @@ - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <% end %> diff --git a/app/views/admin/assets/_asset.html.erb b/app/views/admin/assets/_asset.html.erb index b7c30fe9..fd76be26 100644 --- a/app/views/admin/assets/_asset.html.erb +++ b/app/views/admin/assets/_asset.html.erb @@ -2,7 +2,7 @@ <%= check_box_tag 'files[]', asset.id, false, :class => "checkbox_in_list" %> - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> <% end %> diff --git a/app/views/admin/assets/_form.html.erb b/app/views/admin/assets/_form.html.erb index 1e080678..830b8e19 100644 --- a/app/views/admin/assets/_form.html.erb +++ b/app/views/admin/assets/_form.html.erb @@ -1,10 +1,10 @@
- <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %>
">
<%= f.label :title , t('asset.title'), :class=>"control-label muted" %> diff --git a/app/views/admin/assets/file_upload.html.erb b/app/views/admin/assets/file_upload.html.erb index ddb0c1b0..bded6944 100644 --- a/app/views/admin/assets/file_upload.html.erb +++ b/app/views/admin/assets/file_upload.html.erb @@ -16,7 +16,7 @@
<%= f.fields_for :title_translations do |f| %>
- <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <%= content_tag :label do -%>
<%= I18nVariable.from_locale(locale) %> @@ -33,7 +33,7 @@
<%= f.fields_for :description_translations do |f| %>
- <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <%= content_tag :label do -%>
<%= I18nVariable.from_locale(locale) %> diff --git a/app/views/admin/attributes/_attribute_field.html.erb b/app/views/admin/attributes/_attribute_field.html.erb index 15e0d0e7..23f8f6e8 100644 --- a/app/views/admin/attributes/_attribute_field.html.erb +++ b/app/views/admin/attributes/_attribute_field.html.erb @@ -4,7 +4,7 @@ <%= f.check_box :locale %> <%= f.fields_for :title_translations do |f| %> - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <%= f.text_field locale, :style => "width:130px", :value => (attribute_field.title_translations[locale] rescue nil) %> <% end %> <% end %> diff --git a/app/views/admin/attributes/new.html.erb b/app/views/admin/attributes/new.html.erb index 404a2db5..2ecf57a7 100644 --- a/app/views/admin/attributes/new.html.erb +++ b/app/views/admin/attributes/new.html.erb @@ -30,7 +30,7 @@
- <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> "> diff --git a/app/views/admin/categories/_category.html.erb b/app/views/admin/categories/_category.html.erb index bab1a194..fca22a5d 100644 --- a/app/views/admin/categories/_category.html.erb +++ b/app/views/admin/categories/_category.html.erb @@ -1,5 +1,5 @@ - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> <%= category.title_translations[locale] %> <% if i == 0 %> diff --git a/app/views/admin/categories/_form.html.erb b/app/views/admin/categories/_form.html.erb index b741a24f..510f8de3 100644 --- a/app/views/admin/categories/_form.html.erb +++ b/app/views/admin/categories/_form.html.erb @@ -2,7 +2,7 @@ <%= f.error_messages %> <%= f.fields_for :title_translations do |f| %> - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %> <%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %> <% end %> diff --git a/app/views/admin/categories/_index.html.erb b/app/views/admin/categories/_index.html.erb index efd77dc8..6687692d 100644 --- a/app/views/admin/categories/_index.html.erb +++ b/app/views/admin/categories/_index.html.erb @@ -1,7 +1,7 @@ - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> <% end %> diff --git a/app/views/admin/items/_form_link.html.erb b/app/views/admin/items/_form_link.html.erb index 57069624..2d3c546c 100644 --- a/app/views/admin/items/_form_link.html.erb +++ b/app/views/admin/items/_form_link.html.erb @@ -7,7 +7,7 @@ <%= f.text_field :name, class: 'input-xlarge', placeholder: t(:name), id: 'name' %> <%= t("front_page.name_field_helper") %> - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <%= f.fields_for :title_translations do |f| %> <%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %> <%= f.text_field locale, class: 'input-xlarge', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %> @@ -31,7 +31,7 @@ - <% @site_valid_locales.each do |locale| %> + <% @site_in_use_locales.each do |locale| %> <% end %> diff --git a/app/views/admin/role_filters/_role_filter.html.erb b/app/views/admin/role_filters/_role_filter.html.erb index a2a9d733..47fe438a 100644 --- a/app/views/admin/role_filters/_role_filter.html.erb +++ b/app/views/admin/role_filters/_role_filter.html.erb @@ -2,7 +2,7 @@ <% if @types.is_localized?(:title) %> - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %>
<%= t(:_locale, :locale => locale) %>
Key<%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
<%= role_filter.key %> <%= role_filter.title_translations[locale] rescue nil %> <% if i == 0 %> diff --git a/app/views/admin/roles/add_sub_role.html.erb b/app/views/admin/roles/add_sub_role.html.erb index 305281c1..3f7f111f 100644 --- a/app/views/admin/roles/add_sub_role.html.erb +++ b/app/views/admin/roles/add_sub_role.html.erb @@ -8,7 +8,7 @@
<%= @sub_attribute.key%>
<% end %> - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> "> diff --git a/app/views/admin/roles/edit.html.erb b/app/views/admin/roles/edit.html.erb index ece8ccc8..93211673 100644 --- a/app/views/admin/roles/edit.html.erb +++ b/app/views/admin/roles/edit.html.erb @@ -8,7 +8,7 @@
<%= @attribute.key%>
<% end %> - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> " value="<%= @attribute.title_translations[locale] rescue nil %>"> diff --git a/app/views/admin/roles/edit_sub_role.html.erb b/app/views/admin/roles/edit_sub_role.html.erb index 1ac50570..7700f6a9 100644 --- a/app/views/admin/roles/edit_sub_role.html.erb +++ b/app/views/admin/roles/edit_sub_role.html.erb @@ -8,7 +8,7 @@
<%= @sub_attribute.key%>
<% end %> - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> " value="<%= @sub_attribute.title_translations[locale] rescue nil %>"> diff --git a/app/views/admin/roles/new.html.erb b/app/views/admin/roles/new.html.erb index 6d48013f..e50684ce 100644 --- a/app/views/admin/roles/new.html.erb +++ b/app/views/admin/roles/new.html.erb @@ -9,7 +9,7 @@
<%= @attribute.key%>
<% end %> - <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> "> diff --git a/app/views/admin/sites/preference.html.erb b/app/views/admin/sites/preference.html.erb index fd4b8525..45d5c37b 100644 --- a/app/views/admin/sites/preference.html.erb +++ b/app/views/admin/sites/preference.html.erb @@ -146,14 +146,14 @@
- <%= f.check_box :enable_language_detection, :class => "toggle-check", data: {disabled: true} %> + <%= f.check_box :enable_language_detection, :class => "toggle-check reset_default_locale", data: {disabled: true} %>
- <% @site_valid_locales.each do |valid_locale| %> + <% @site_in_use_locales.each do |valid_locale| %> <%= check_box_tag "site[in_use_locales][]", valid_locale, @site.in_use_locales.include?(valid_locale), :class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(valid_locale)}", disabled: true }, "data-deploy"=>"inline" %> <% end %>
@@ -258,4 +258,17 @@ var locales = <%= @site.in_use_locales.to_json.html_safe %>; }) }) delete locales; - \ No newline at end of file + +<% content_for :page_specific_javascript do %> + +<% end %> \ No newline at end of file diff --git a/app/views/admin/sites/search_engine.html.erb b/app/views/admin/sites/search_engine.html.erb index 5a8f6261..e7e79a95 100644 --- a/app/views/admin/sites/search_engine.html.erb +++ b/app/views/admin/sites/search_engine.html.erb @@ -49,11 +49,11 @@
- <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> " href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %> <% end %>
- <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %>
" id="textarea_<%= locale %>_0"> <%= f.fields_for :keywords do |f| %> <%= f.text_area locale, :class=>'resizable', :value => (@site.keywords(locale) rescue nil), :placeholder => I18nVariable.from_locale(locale), :rows=>"3" %> @@ -69,11 +69,11 @@
- <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %> " href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %> <% end %>
- <% @site_valid_locales.each_with_index do |locale, i| %> + <% @site_in_use_locales.each_with_index do |locale, i| %>
" id="textarea_<%= locale %>_0"> <%= f.fields_for :description do |f| %> <%= f.text_area locale, :class=>'resizable', :value => (@site.description(locale) rescue nil), :placeholder => I18nVariable.from_locale(locale), :rows=>"3" %> diff --git a/app/views/admin/sites/site_info.html.erb b/app/views/admin/sites/site_info.html.erb index 0e5ef848..588fdcaa 100644 --- a/app/views/admin/sites/site_info.html.erb +++ b/app/views/admin/sites/site_info.html.erb @@ -23,8 +23,7 @@ @@ -32,7 +31,7 @@
- <% @site_valid_locales.each do |locale|%> + <% @site_in_use_locales.each do |locale|%> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
@@ -56,7 +55,7 @@
- <% @site_valid_locales.each do |locale|%> + <% @site_in_use_locales.each do |locale|%> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
@@ -81,7 +80,7 @@
- <% @site_valid_locales.each do |locale|%> + <% @site_in_use_locales.each do |locale|%> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
@@ -105,7 +104,7 @@
- <% @site_valid_locales.each do |locale|%> + <% @site_in_use_locales.each do |locale|%> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
diff --git a/app/views/admin/sites/sitemap.html.erb b/app/views/admin/sites/sitemap.html.erb index 499f707f..575913c7 100644 --- a/app/views/admin/sites/sitemap.html.erb +++ b/app/views/admin/sites/sitemap.html.erb @@ -14,7 +14,7 @@ <% end %>