Changed Site Valid Locales to In Use Locales

This commit is contained in:
saurabhbhatia 2013-11-27 17:50:33 +08:00
parent 9509bdd55f
commit 6d5dd4a80f
165 changed files with 289 additions and 267 deletions

View File

@ -37,7 +37,7 @@ class Admin::LinksController < Admin::ItemsController
link = Link.find(params[:id]) link = Link.find(params[:id])
m = {} m = {}
m["public"] = link.is_published ? 1 : 0 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] 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 end
render json: JSON.pretty_generate(m) render json: JSON.pretty_generate(m)

View File

@ -73,7 +73,7 @@ class Admin::PagesController < Admin::ItemsController
m["category"] = page.category.present? ? page.category.map{|c| c.to_s} : [] 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["tags"] = page.tag.present? ? page.tag.map{|c| c.to_s} : []
m["public"] = page.is_published ? 1 : 0 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] 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 end
m["count"] = page.frontend_data_count m["count"] = page.frontend_data_count

View File

@ -21,6 +21,7 @@ class Admin::SitesController < OrbitBackendController
end end
def update def update
params[:site][:defalut_locale] = "zh_tw" if params[:site][:default_locale].blank?
@site.update_attributes(params[:site]) @site.update_attributes(params[:site])
redirect_to :back redirect_to :back
end end
@ -71,6 +72,13 @@ class Admin::SitesController < OrbitBackendController
end end
def reset_default_locale
@site.defalut_locale = params[:default_locale]
if @site.save
render :nothing => true
end
end
def change_design def change_design
design = Design.find(params[:site_id]) rescue nil design = Design.find(params[:site_id]) rescue nil
update_design(design) if design update_design(design) if design

View File

@ -2,7 +2,7 @@ module Admin::AssetsHelper
def show_all_fields(asset, field) def show_all_fields(asset, field)
a = [] a = []
@site_valid_locales.each do |locale| @site_in_use_locales.each do |locale|
a << asset.send("#{field}_translations")[locale] rescue nil a << asset.send("#{field}_translations")[locale] rescue nil
end end
a.join(' - ') a.join(' - ')

View File

@ -6,7 +6,7 @@ module Admin::TagsHelper
end end
def show_names_slash(tag) 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") names << content_tag(:span, tag.name_translations[locale], class: "tag")
end end
span_names.join(" / ").html_safe span_names.join(" / ").html_safe

View File

@ -59,7 +59,8 @@ class User
validates :user_id, validates :user_id,
:presence => { :message => I18n.t("users.user_id_not_null") } , :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? def email_required?
false false

View File

@ -166,7 +166,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -176,7 +176,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -11,7 +11,7 @@
</ul> </ul>
</div> </div>
</td> </td>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<td><%= asset_category.title_translations[locale] rescue nil %></td> <td><%= asset_category.title_translations[locale] rescue nil %></td>
<% end %> <% end %>
</tr> </tr>

View File

@ -11,7 +11,7 @@
<div id="widget-title"> <div id="widget-title">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "name-#{locale}", "#{t(:name)}-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "name-#{locale}", "#{t(:name)}-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -8,7 +8,7 @@
<thead> <thead>
<tr> <tr>
<th class="span2"><%= t(:key) %></th> <th class="span2"><%= t(:key) %></th>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th class="span2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th> <th class="span2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %> <% end %>
</tr> </tr>
@ -23,7 +23,7 @@
<thead> <thead>
<tr> <tr>
<th class="span2"></th> <th class="span2"></th>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th class="span2"></th> <th class="span2"></th>
<% end %> <% end %>
</tr> </tr>

View File

@ -2,7 +2,7 @@
<td> <td>
<%= check_box_tag 'files[]', asset.id, false, :class => "checkbox_in_list" %> <%= check_box_tag 'files[]', asset.id, false, :class => "checkbox_in_list" %>
<input type="hidden" value="<%= asset.data.url %>" id="url_<%= asset.id %>" /> <input type="hidden" value="<%= asset.data.url %>" id="url_<%= asset.id %>" />
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<input type="hidden" value="<%= asset.description_translations[locale] rescue nil %>" id="<%= locale %>_desc_<%= asset.id %>" /> <input type="hidden" value="<%= asset.description_translations[locale] rescue nil %>" id="<%= locale %>_desc_<%= asset.id %>" />
<input type="hidden" value="<%= asset.title_translations[locale] rescue nil %>" id="<%= locale %>_title_<%= asset.id %>" /> <input type="hidden" value="<%= asset.title_translations[locale] rescue nil %>" id="<%= locale %>_title_<%= asset.id %>" />
<% end %> <% end %>

View File

@ -1,10 +1,10 @@
<div class="control-group"> <div class="control-group">
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="control-group input-title"> <div class="control-group input-title">
<%= f.label :title , t('asset.title'), :class=>"control-label muted" %> <%= f.label :title , t('asset.title'), :class=>"control-label muted" %>

View File

@ -16,7 +16,7 @@
<div class="controls"> <div class="controls">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<div> <div>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= content_tag :label do -%> <%= content_tag :label do -%>
<div> <div>
<%= I18nVariable.from_locale(locale) %> <%= I18nVariable.from_locale(locale) %>
@ -33,7 +33,7 @@
<div class="controls"> <div class="controls">
<%= f.fields_for :description_translations do |f| %> <%= f.fields_for :description_translations do |f| %>
<div> <div>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= content_tag :label do -%> <%= content_tag :label do -%>
<div> <div>
<%= I18nVariable.from_locale(locale) %> <%= I18nVariable.from_locale(locale) %>

View File

@ -4,7 +4,7 @@
<%= f.check_box :locale %> <%= f.check_box :locale %>
</td> </td>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<td><%= f.text_field locale, :style => "width:130px", :value => (attribute_field.title_translations[locale] rescue nil) %></td> <td><%= f.text_field locale, :style => "width:130px", :value => (attribute_field.title_translations[locale] rescue nil) %></td>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -30,7 +30,7 @@
</div> </div>
</div> </div>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label> <label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>"> <input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>">

View File

@ -1,5 +1,5 @@
<tr class="<%= 'disable' if category.disable %>"> <tr class="<%= 'disable' if category.disable %>">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<td> <td>
<%= category.title_translations[locale] %> <%= category.title_translations[locale] %>
<% if i == 0 %> <% if i == 0 %>

View File

@ -2,7 +2,7 @@
<%= f.error_messages %> <%= f.error_messages %>
<%= f.fields_for :title_translations do |f| %> <%= 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)})" %> <%= 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 %> <%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %>
<% end %> <% end %>

View File

@ -1,7 +1,7 @@
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr class="sort-header"> <tr class="sort-header">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<th class="<%= 'span50-percent' if i==0 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th> <th class="<%= 'span50-percent' if i==0 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
<% end %> <% end %>
</tr> </tr>

View File

@ -7,7 +7,7 @@
<%= f.text_field :name, class: 'input-xlarge', placeholder: t(:name), id: 'name' %> <%= f.text_field :name, class: 'input-xlarge', placeholder: t(:name), id: 'name' %>
<span class="help-block"><%= t("front_page.name_field_helper") %></span> <span class="help-block"><%= t("front_page.name_field_helper") %></span>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %> <%= 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 %> <%= f.text_field locale, class: 'input-xlarge', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
@ -31,7 +31,7 @@
<div class="link-options checkbox-groups hide"> <div class="link-options checkbox-groups hide">
<label><%= t(:activation_link) %></label> <label><%= t(:activation_link) %></label>
<% @site_valid_locales.each do |valid_locale| %> <% @site_in_use_locales.each do |valid_locale| %>
<div class="active-link <%= valid_locale %>"> <div class="active-link <%= valid_locale %>">
<label class="checkbox"> <label class="checkbox">
<%= check_box_tag 'link[enabled_for][]', valid_locale, false, class: "lang-enable" %> <%= I18nVariable.from_locale(valid_locale) %> <%= check_box_tag 'link[enabled_for][]', valid_locale, false, class: "lang-enable" %> <%= I18nVariable.from_locale(valid_locale) %>

View File

@ -8,7 +8,7 @@
<span class="help-block"><%= t("front_page.name_field_helper") %></span> <span class="help-block"><%= t("front_page.name_field_helper") %></span>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %> <%= 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 %> <%= f.text_field locale, class: 'input-xlarge', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
<% end %> <% end %>
@ -67,7 +67,7 @@
<div class="link-options checkbox-groups hide"> <div class="link-options checkbox-groups hide">
<label><%= t(:activation_link) %></label> <label><%= t(:activation_link) %></label>
<% @site_valid_locales.each do |valid_locale| %> <% @site_in_use_locales.each do |valid_locale| %>
<div class="active-link <%= valid_locale %>"> <div class="active-link <%= valid_locale %>">
<label class="checkbox"> <label class="checkbox">
<%= check_box_tag 'page[enabled_for][]', valid_locale, false, class: "lang-enable" %> <%= I18nVariable.from_locale(valid_locale) %> <%= check_box_tag 'page[enabled_for][]', valid_locale, false, class: "lang-enable" %> <%= I18nVariable.from_locale(valid_locale) %>

View File

@ -30,7 +30,7 @@
</div> </div>
</div> </div>
<div class="item-info pull-right"> <div class="item-info pull-right">
<% @site_valid_locales.each do |valid_locale| %> <% @site_in_use_locales.each do |valid_locale| %>
<% if node.enabled_for && node.enabled_for.include?(valid_locale) %> <% if node.enabled_for && node.enabled_for.include?(valid_locale) %>
<span class="label label-warning"><%= I18nVariable.from_locale(valid_locale) %></span> <span class="label label-warning"><%= I18nVariable.from_locale(valid_locale) %></span>

View File

@ -14,9 +14,9 @@
<li title="Site Info"><%= link_to admin_site_site_info_path(@site), :class => active_for_action('sites', 'site_info') do %><span><i class="icons-browser"></i></span><%end%></li> <li title="Site Info"><%= link_to admin_site_site_info_path(@site), :class => active_for_action('sites', 'site_info') do %><span><i class="icons-browser"></i></span><%end%></li>
<li title="Site Mobile"><%= link_to admin_site_responsive_setting_path(@site), :class => active_for_action('sites', 'responsive') do %><span><i class="icons-mobile"></i></span><%end%></li> <li title="Site Mobile"><%= link_to admin_site_responsive_setting_path(@site), :class => active_for_action('sites', 'responsive_setting') do %><span><i class="icons-mobile"></i></span><%end%></li>
<li title="Search Engine"><%= link_to admin_site_search_engine_path(@site), :class => active_for_action('sites', 'site_info') do %><span><i class="icons-search"></i></span><%end%></li> <li title="Search Engine"><%= link_to admin_site_search_engine_path(@site), :class => active_for_action('sites', 'search_engine') do %><span><i class="icons-search"></i></span><%end%></li>
<li title="Preference"><%= link_to admin_site_preference_path(@site), :class => active_for_action('sites', 'preference') do %><span><i class="icons-cog"></i></span><%end%></li> <li title="Preference"><%= link_to admin_site_preference_path(@site), :class => active_for_action('sites', 'preference') do %><span><i class="icons-cog"></i></span><%end%></li>

View File

@ -10,7 +10,7 @@
<%= f.text_field :url, :class => 'input-xlarge', placeholder: t(:url) %> <%= f.text_field :url, :class => 'input-xlarge', placeholder: t(:url) %>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %> <%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %>
<%= f.text_field locale, class: 'input-xlarge', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", value: (@item.title_translations[locale] rescue nil) %> <%= f.text_field locale, class: 'input-xlarge', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", value: (@item.title_translations[locale] rescue nil) %>
<% end %> <% end %>
@ -30,7 +30,7 @@
<%= f.label :menu_enabled_for, "#{t('front_page.menu_enable_lang')}:" %> <%= f.label :menu_enabled_for, "#{t('front_page.menu_enable_lang')}:" %>
<p> <p>
<% @site_valid_locales.each do |valid_locale| %> <% @site_in_use_locales.each do |valid_locale| %>
<label class="checkbox inline"> <label class="checkbox inline">
<%= check_box_tag 'link[menu_enabled_for][]', valid_locale, (@item.menu_enabled_for.nil? ? true : @item.menu_enabled_for.include?(valid_locale)) %> <%= check_box_tag 'link[menu_enabled_for][]', valid_locale, (@item.menu_enabled_for.nil? ? true : @item.menu_enabled_for.include?(valid_locale)) %>
<%= I18nVariable.from_locale(valid_locale) %> <%= I18nVariable.from_locale(valid_locale) %>

View File

@ -1,6 +1,6 @@
<%= form_for :tag, :url => admin_module_tags_path, :remote => true, :html => {:id => 'tag_form'} do |f| %> <%= form_for :tag, :url => admin_module_tags_path, :remote => true, :html => {:id => 'tag_form'} do |f| %>
<%= f.fields_for :name_translations do |f| %> <%= f.fields_for :name_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %> <%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -31,14 +31,14 @@
<strong><%= t(:language) %></strong> <strong><%= t(:language) %></strong>
</div> </div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
<% end %> <% end %>
</ul> </ul>
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= locale %> <%= 'active in' if i == 0 %>"> <div class="tab-pane fade <%= locale %> <%= 'active in' if i == 0 %>">
<div class="control-group input-content"> <div class="control-group input-content">
<label class="control-label muted"><%= t(:content) %></label> <label class="control-label muted"><%= t(:content) %></label>
@ -76,7 +76,7 @@
</div> </div>
<div id="module_widget" class="tab-pane fade in"> <div id="module_widget" class="tab-pane fade in">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group input-content"> <div class="control-group input-content">
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %> <%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
<div class="controls"> <div class="controls">

View File

@ -65,7 +65,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -75,7 +75,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -6,7 +6,7 @@
<%= f.text_field :key, :class=>"input-large" %> <%= f.text_field :key, :class=>"input-large" %>
<%= f.fields_for :title_translations do |f| %> <%= 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)})" %> <%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %>
<%= f.text_field locale, :class => 'input-large', :value => (@role_filter.title_translations[locale] rescue ''), placeholder: t(:name) %> <%= f.text_field locale, :class => 'input-large', :value => (@role_filter.title_translations[locale] rescue ''), placeholder: t(:name) %>
<% end %> <% end %>

View File

@ -2,7 +2,7 @@
<thead> <thead>
<tr class="sort-header"> <tr class="sort-header">
<th class="span3 active"><a href="#">Key<b class="icons-arrow-down-4"></b></a></th> <th class="span3 active"><a href="#">Key<b class="icons-arrow-down-4"></b></a></th>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th> <th><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %> <% end %>
<th class="span1"></th> <th class="span1"></th>

View File

@ -2,7 +2,7 @@
<tr id="<%= dom_id role_filter %>" class="<%= role_filter.disable ? 'disable' : '' %>"> <tr id="<%= dom_id role_filter %>" class="<%= role_filter.disable ? 'disable' : '' %>">
<td><span class="label label-info"><%= role_filter.key %></span></td> <td><span class="label label-info"><%= role_filter.key %></span></td>
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<td> <td>
<%= role_filter.title_translations[locale] rescue nil %> <%= role_filter.title_translations[locale] rescue nil %>
<% if i == 0 %> <% if i == 0 %>

View File

@ -8,7 +8,7 @@
<div><%= @sub_attribute.key%></div> <div><%= @sub_attribute.key%></div>
<% end %> <% end %>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label> <label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>"> <input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>">

View File

@ -8,7 +8,7 @@
<div><%= @attribute.key%></div> <div><%= @attribute.key%></div>
<% end %> <% end %>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label> <label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>" value="<%= @attribute.title_translations[locale] rescue nil %>"> <input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>" value="<%= @attribute.title_translations[locale] rescue nil %>">

View File

@ -8,7 +8,7 @@
<div><%= @sub_attribute.key%></div> <div><%= @sub_attribute.key%></div>
<% end %> <% end %>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label> <label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>" value="<%= @sub_attribute.title_translations[locale] rescue nil %>"> <input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>" value="<%= @sub_attribute.title_translations[locale] rescue nil %>">

View File

@ -9,7 +9,7 @@
<div><%= @attribute.key%></div> <div><%= @attribute.key%></div>
<% end %> <% end %>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label> <label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>"> <input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>">

View File

@ -146,14 +146,14 @@
<label class="control-label muted">Enable User Language Detection <label class="control-label muted">Enable User Language Detection
</label> </label>
<div class="controls"> <div class="controls">
<%= 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} %>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label muted">Enable Language</label> <label class="control-label muted">Enable Language</label>
<div class="controls"> <div class="controls">
<% @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" %> <%= 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 %> <% end %>
</div> </div>
@ -259,3 +259,16 @@ var locales = <%= @site.in_use_locales.to_json.html_safe %>;
}) })
delete locales; delete locales;
</script> </script>
<% content_for :page_specific_javascript do %>
<script>
$(document).ready(function(){
$(document).on('change', '.reset_default_locale', function(){
var control_group = $(this).closest(".control-group").parent().find(".control-group:eq(2)");
if ( $(this).is(":checked") ){
control_group.find(".togglebox").addClass("disabled");
control_group.find("input[type=radio]").removeAttr("checked");
}
});
});
</script>
<% end %>

View File

@ -49,11 +49,11 @@
<div class="controls"> <div class="controls">
<div class="tab-content textarea-lang"> <div class="tab-content textarea-lang">
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
</div> </div>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade in <%= ( i == 0 ) ? "active" : '' %>" id="textarea_<%= locale %>_0"> <div class="tab-pane fade in <%= ( i == 0 ) ? "active" : '' %>" id="textarea_<%= locale %>_0">
<%= f.fields_for :keywords do |f| %> <%= 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" %> <%= f.text_area locale, :class=>'resizable', :value => (@site.keywords(locale) rescue nil), :placeholder => I18nVariable.from_locale(locale), :rows=>"3" %>
@ -69,11 +69,11 @@
<div class="controls"> <div class="controls">
<div class="tab-content textarea-lang"> <div class="tab-content textarea-lang">
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#textarea_<%= locale %>_0" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
</div> </div>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade in <%= ( i == 0 ) ? "active" : '' %>" id="textarea_<%= locale %>_0"> <div class="tab-pane fade in <%= ( i == 0 ) ? "active" : '' %>" id="textarea_<%= locale %>_0">
<%= f.fields_for :description do |f| %> <%= 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" %> <%= f.text_area locale, :class=>'resizable', :value => (@site.description(locale) rescue nil), :placeholder => I18nVariable.from_locale(locale), :rows=>"3" %>

View File

@ -23,8 +23,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong>Language</strong></div> <div class="nav-name"><strong>Language</strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each do |locale|%> <% @site_in_use_locales.each do |locale|%>
<%#= raise @site_valid_locales.inspect %>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %> <%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %>
<% end %> <% end %>
</ul> </ul>
@ -32,7 +31,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @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 %> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group input-title"> <div class="control-group input-title">
<label class="control-label muted"><%= t 'site.title' %></label> <label class="control-label muted"><%= t 'site.title' %></label>
@ -56,7 +55,7 @@
<hr> <hr>
<!-- CKeditor Site Header --> <!-- CKeditor Site Header -->
<% @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 %> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted"><%= t('site.header')%></label> <label class="control-label muted"><%= t('site.header')%></label>
<div class="controls"> <div class="controls">
@ -81,7 +80,7 @@
<hr> <hr>
<!-- CKeditor Site Footer --> <!-- CKeditor Site Footer -->
<% @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 %> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted"><%= t('site.footer')%></label> <label class="control-label muted"><%= t('site.footer')%></label>
<div class="controls"> <div class="controls">
@ -105,7 +104,7 @@
</div> </div>
<!-- CKeditor Site Footer --> <!-- CKeditor Site Footer -->
<% @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 %> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted"><%= t('site.default_terms_of_use')%></label> <label class="control-label muted"><%= t('site.default_terms_of_use')%></label>
<div class="controls"> <div class="controls">

View File

@ -14,7 +14,7 @@
<% end %> <% end %>
<div id="sitemap"> <div id="sitemap">
<ul id="map-tree-language" class="nav nav-pills"> <ul id="map-tree-language" class="nav nav-pills">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>> <li <%= ( i == 0 ) ? "class=active" : '' %>>
<a data-toggle="tab" href="#<%= locale %>"> <a data-toggle="tab" href="#<%= locale %>">
<%= I18nVariable.from_locale(locale) %> <%= I18nVariable.from_locale(locale) %>
@ -25,7 +25,7 @@
<div class="tab-content map-tree-content"> <div class="tab-content map-tree-content">
<div class="line"></div> <div class="line"></div>
<% @site_valid_locales.each_with_index do |temp_locale, i| %> <% @site_in_use_locales.each_with_index do |temp_locale, i| %>
<ul id="<%= temp_locale %>" class="map-tree tab-pane fade in <%= ( i == 0 ) ? "in active" : '' %>"> <ul id="<%= temp_locale %>" class="map-tree tab-pane fade in <%= ( i == 0 ) ? "in active" : '' %>">
<%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %> <%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
</ul> </ul>

View File

@ -2,7 +2,7 @@
<%= f.error_messages %> <%= f.error_messages %>
<%= f.fields_for :name_translations do |f| %> <%= f.fields_for :name_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= f.label :locale, "#{t(:name)} #{I18nVariable.from_locale(locale)}" %> <%= f.label :locale, "#{t(:name)} #{I18nVariable.from_locale(locale)}" %>
<%= f.text_field locale, class: 'input-large', placeholder: "#{t(:name)} #{I18nVariable.from_locale(locale)}", value: (@tag.name_translations[locale] rescue nil), id: locale %> <%= f.text_field locale, class: 'input-large', placeholder: "#{t(:name)} #{I18nVariable.from_locale(locale)}", value: (@tag.name_translations[locale] rescue nil), id: locale %>
<% end %> <% end %>

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="modal-body tags"> <div class="modal-body tags">
<div class="clearfix"> <div class="clearfix">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= label_tag :locale, I18nVariable.from_locale(locale) %> <%= label_tag :locale, I18nVariable.from_locale(locale) %>
<%= text_field_tag "name[#{locale}]", nil, class: 'new-tags-name', placeholder: t('tag.new_name') %> <%= text_field_tag "name[#{locale}]", nil, class: 'new-tags-name', placeholder: t('tag.new_name') %>
<% end %> <% end %>

View File

@ -27,7 +27,7 @@
<div class="tab-content"> <div class="tab-content">
<% VALID_LOCALES.collect do |locale| %> <% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<div class="tab-pane fade <%= active %> in" id="${roleType+'_text_language_<%= locale %>_'+appendIndex}"> <div class="tab-pane fade <%= active %> in" id="${roleType+'_text_language_<%= locale %>_'+appendIndex}">
<input type="text" name="${'user[<%= @fname %>]['+nameNumber+'][value][][<%= locale %>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>" value=""> <input type="text" name="${'user[<%= @fname %>]['+nameNumber+'][value][][<%= locale %>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>" value="">
@ -38,7 +38,7 @@
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% VALID_LOCALES.collect do |locale| %> <% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+roleType+'_text_language_<%= locale %>_'+appendIndex}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= active %>" href="${'#'+roleType+'_text_language_<%= locale %>_'+appendIndex}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a> <a href="#" class="btn remove-input"><i class="icon-trash"></i></a>

View File

@ -27,7 +27,7 @@
<div class="tab-content"> <div class="tab-content">
<% VALID_LOCALES.collect do |locale| %> <% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<div class="tab-pane fade <%= active %> in" id="${roleType+'_text_language_<%= locale %>_'+appendIndex}"> <div class="tab-pane fade <%= active %> in" id="${roleType+'_text_language_<%= locale %>_'+appendIndex}">
<input type="text" name="${'user[<%= @fname %>]['+nameNumber+'][value][][<%= locale %>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>" value=""> <input type="text" name="${'user[<%= @fname %>]['+nameNumber+'][value][][<%= locale %>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>" value="">
@ -38,7 +38,7 @@
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% VALID_LOCALES.collect do |locale| %> <% VALID_LOCALES.collect do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+roleType+'_text_language_<%= locale %>_'+appendIndex}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= active %>" href="${'#'+roleType+'_text_language_<%= locale %>_'+appendIndex}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a> <a href="#" class="btn remove-input"><i class="icon-trash"></i></a>

View File

@ -42,7 +42,7 @@
<div class="add-target"> <div class="add-target">
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="first_name_<%= locale %>"> <div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="first_name_<%= locale %>">
<%= f.fields_for :first_name_translations do |f| %> <%= f.fields_for :first_name_translations do |f| %>
<%= f.text_field locale, :value => (@user.first_name_translations[locale] rescue nil), :placeholder=>"#{t("users.first_name")}" %> <%= f.text_field locale, :value => (@user.first_name_translations[locale] rescue nil), :placeholder=>"#{t("users.first_name")}" %>
@ -51,7 +51,7 @@
<% end %> <% end %>
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#first_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#first_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a> <a href="#" class="btn remove-input"><i class="icon-trash"></i></a>
@ -68,7 +68,7 @@
<div class="add-target"> <div class="add-target">
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="last_name_<%= locale %>"> <div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="last_name_<%= locale %>">
<%= f.fields_for :last_name_translations do |f| %> <%= f.fields_for :last_name_translations do |f| %>
<%= f.text_field locale, :value => (@user.last_name_translations[locale] rescue nil), :placeholder=>"#{t("users.last_name")}" %> <%= f.text_field locale, :value => (@user.last_name_translations[locale] rescue nil), :placeholder=>"#{t("users.last_name")}" %>
@ -77,7 +77,7 @@
<% end %> <% end %>
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#last_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#last_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
<a href="#" class="btn remove-input"><i class="icon-trash"></i></a> <a href="#" class="btn remove-input"><i class="icon-trash"></i></a>

View File

@ -39,7 +39,7 @@
<div class="add-target"> <div class="add-target">
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="first_name_<%= locale %>"> <div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="first_name_<%= locale %>">
<%= f.fields_for :first_name_translations do |f| %> <%= f.fields_for :first_name_translations do |f| %>
<%= f.text_field locale, :value => (@user.first_name_translations[locale] rescue nil), :placeholder=>"#{t("users.first_name")}" %> <%= f.text_field locale, :value => (@user.first_name_translations[locale] rescue nil), :placeholder=>"#{t("users.first_name")}" %>
@ -48,7 +48,7 @@
<% end %> <% end %>
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#first_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#first_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
@ -65,7 +65,7 @@
<div class="add-target"> <div class="add-target">
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="last_name_<%= locale %>"> <div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="last_name_<%= locale %>">
<%= f.fields_for :last_name_translations do |f| %> <%= f.fields_for :last_name_translations do |f| %>
<%= f.text_field locale, :value => (@user.last_name_translations[locale] rescue nil), :placeholder=>"#{t("users.last_name")}" %> <%= f.text_field locale, :value => (@user.last_name_translations[locale] rescue nil), :placeholder=>"#{t("users.last_name")}" %>
@ -74,7 +74,7 @@
<% end %> <% end %>
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#last_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#last_name_<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>

View File

@ -21,16 +21,16 @@
<div class="controls"> <div class="controls">
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<div class="tab-pane <%= active %> fade in" id="${_title_translations[0]+'_<%= locale%>'}"> <div class="tab-pane <%= active %> fade in" id="${_title_translations[0]+'_<%= locale%>'}">
<input type="text" data-type="lang_<%= locale%>" name="${_title_translations[1]+'[<%= locale%>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>"> <input type="text" data-type="lang_<%= locale%>" name="${_title_translations[1]+'[<%= locale%>]'}" placeholder="<%= I18nVariable.from_locale(locale) %>">
</div> </div>
<% end %> <% end %>
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+_title_translations[0]+'_<%= locale%>'}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= active %>" href="${'#'+_title_translations[0]+'_<%= locale%>'}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
</div> </div>
@ -79,8 +79,8 @@
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<div class="tab-pane <%= active %> fade in" id="${_placeholder[0]+'_<%= locale %>'}"> <div class="tab-pane <%= active %> fade in" id="${_placeholder[0]+'_<%= locale %>'}">
<input type="text" data-type="lang_<%= locale %>" placeholder="<%= I18nVariable.from_locale(locale) %>" name="${_placeholder[1]+'[<%= locale %>]'}"> <input type="text" data-type="lang_<%= locale %>" placeholder="<%= I18nVariable.from_locale(locale) %>" name="${_placeholder[1]+'[<%= locale %>]'}">
@ -91,8 +91,8 @@
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href="${'#'+_placeholder[0]+'_<%= locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a class="btn <%= active %>" href="${'#'+_placeholder[0]+'_<%= locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
<% end %> <% end %>
@ -141,8 +141,8 @@
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<div class="tab-pane <%= active %> fade in" id= <div class="tab-pane <%= active %> fade in" id=
{{if templateType == 'typeB'}} {{if templateType == 'typeB'}}
@ -165,8 +165,8 @@
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<a class="btn <%= active %>" href= <a class="btn <%= active %>" href=
{{if templateType == 'typeB'}} {{if templateType == 'typeB'}}
@ -190,8 +190,8 @@
<div class="controls add-input"> <div class="controls add-input">
<div class="add-target single"> <div class="add-target single">
<%= content_tag :div,:class=>"input-append" do%> <%= content_tag :div,:class=>"input-append" do%>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_valid_locales.last ? true : false) %> <% last = (locale == @site_in_use_locales.last ? true : false) %>
<input type="text" data-type="${_option_list[2]+'_<%= locale %>' }" id="${_option_list[0]+'_<%= locale %>'}" name="${_option_list[1]+'[<%= locale %>]'}" class="input-medium" placeholder="<%= I18nVariable.from_locale(locale) %>"> <input type="text" data-type="${_option_list[2]+'_<%= locale %>' }" id="${_option_list[0]+'_<%= locale %>'}" name="${_option_list[1]+'[<%= locale %>]'}" class="input-medium" placeholder="<%= I18nVariable.from_locale(locale) %>">
<% if last %> <% if last %>
<a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a> <a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a>
@ -246,8 +246,8 @@
<script id="template-input-append" type="text/x-tmpl"> <script id="template-input-append" type="text/x-tmpl">
<%= content_tag :div,:class=>"input-append" do%> <%= content_tag :div,:class=>"input-append" do%>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_valid_locales.last ? true : false) %> <% last = (locale == @site_in_use_locales.last ? true : false) %>
<input type="text" data-type="${_option_list[2]+'_<%= locale %>' }" id="${_option_list[0]+'_<%= locale %>'}" name="${_option_list[1]+'[<%= locale %>]'}" class="input-medium" placeholder="<%= I18nVariable.from_locale(locale) %>"> <input type="text" data-type="${_option_list[2]+'_<%= locale %>' }" id="${_option_list[0]+'_<%= locale %>'}" name="${_option_list[1]+'[<%= locale %>]'}" class="input-medium" placeholder="<%= I18nVariable.from_locale(locale) %>">
<% if last %> <% if last %>
<a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a> <a href="#" class="btn remove-input"> <i class="icon-trash"></i> </a>

View File

@ -8,8 +8,8 @@
<%if values.blank? %> <%if values.blank? %>
<%= content_tag :div,:class=>"input-append" do%> <%= content_tag :div,:class=>"input-append" do%>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_valid_locales.last ? true : false) %> <% last = (locale == @site_in_use_locales.last ? true : false) %>
<% p_value = value[locale.to_s] rescue nil%> <% p_value = value[locale.to_s] rescue nil%>
<%= text_field("#{field_name}[0]", locale,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium",:data=>{:type=>"option_lang_0_#{locale}"}) %> <%= text_field("#{field_name}[0]", locale,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium",:data=>{:type=>"option_lang_0_#{locale}"}) %>
<% if last %> <% if last %>
@ -21,8 +21,8 @@
<%values.each do |index,value|%> <%values.each do |index,value|%>
<%= content_tag :div,:class=>"input-append" do%> <%= content_tag :div,:class=>"input-append" do%>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_valid_locales.last ? true : false) %> <% last = (locale == @site_in_use_locales.last ? true : false) %>
<% p_value = value[locale.to_s] rescue nil%> <% p_value = value[locale.to_s] rescue nil%>
<%= text_field("#{field_name}[#{index}]", locale,:value=>p_value,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium", :data=>{:type=>"option_lang_#{index}_#{locale}"}) %> <%= text_field("#{field_name}[#{index}]", locale,:value=>p_value,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium", :data=>{:type=>"option_lang_#{index}_#{locale}"}) %>
<% if last %> <% if last %>

View File

@ -4,8 +4,8 @@
<div class="controls"> <div class="controls">
<div class="input-append"> <div class="input-append">
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active in" : "'") %> <% active = (locale == @site_in_use_locales.first ? "active in" : "'") %>
<%= content_tag :div,:class=>"tab-pane fade #{active}",:id=>"#{name_to_id(field_name)}_#{locale}" do%> <%= content_tag :div,:class=>"tab-pane fade #{active}",:id=>"#{name_to_id(field_name)}_#{locale}" do%>
<% locale_value = values[locale.to_s] rescue nil%> <% locale_value = values[locale.to_s] rescue nil%>
<%= text_field(field_name, locale,:value=>locale_value,:placeholder=>I18nVariable.from_locale(locale),:data=>{:type=>"lang_#{locale}"}) %> <%= text_field(field_name, locale,:value=>locale_value,:placeholder=>I18nVariable.from_locale(locale),:data=>{:type=>"lang_#{locale}"}) %>
@ -14,8 +14,8 @@
</div> </div>
<div class="btn-group" data-toggle="buttons-radio"> <div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_valid_locales.first ? "active" : "") %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<%= link_to I18nVariable.from_locale(locale),"##{name_to_id(field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%> <%= link_to I18nVariable.from_locale(locale),"##{name_to_id(field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
<% end %> <% end %>
</div> </div>

View File

@ -207,6 +207,7 @@ Orbit::Application.routes.draw do
get 'system_info' get 'system_info'
get 'ui_theme' get 'ui_theme'
get 'change_design' get 'change_design'
get 'reset_default_locale'
get 'preference' get 'preference'
end end

View File

@ -151,7 +151,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -161,7 +161,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -133,7 +133,7 @@
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<%# @site_valid_locales.each_with_index do |locale, i| %> <%# @site_valid_locales.each_with_index do |locale, i| %>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? " class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li <%= ( i == 0 ) ? " class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -141,7 +141,7 @@
<div class="tab-content"> <div class="tab-content">
<%# @site_valid_locales.each_with_index do |locale, i| %> <%# @site_valid_locales.each_with_index do |locale, i| %>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -21,7 +21,7 @@
</label> </label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span> <span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
@ -31,7 +31,7 @@
</span> </span>
<span class="add-on icons-pencil" title='<%= t(:description) %>'></span> <span class="add-on icons-pencil" title='<%= t(:description) %>'></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :description_translations do |f| %> <%= f.fields_for :description_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_file.description_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_file.description_translations[locale] rescue nil) %>

View File

@ -3,7 +3,7 @@
<%= f.text_field :url, class: "input-large", placeholder: t(:url) %> <%= f.text_field :url, class: "input-large", placeholder: t(:url) %>
<span class="add-on icons-pencil" title="<%= t(:url_alt) %>"></span> <span class="add-on icons-pencil" title="<%= t(:url_alt) %>"></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %>

View File

@ -14,7 +14,7 @@
</ul> </ul>
</div> </div>
</td> </td>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<td><%= archive_file_category.title_translations[locale] rescue nil %></td> <td><%= archive_file_category.title_translations[locale] rescue nil %></td>
<% end %> <% end %>
</tr> </tr>

View File

@ -11,7 +11,7 @@
<div id="widget-title"> <div id="widget-title">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -6,7 +6,7 @@
<thead> <thead>
<tr> <tr>
<th class="span1-2"><%= t('archive_file_category.key') %></th> <th class="span1-2"><%= t('archive_file_category.key') %></th>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th> <th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %> <% end %>
</tr> </tr>

View File

@ -102,7 +102,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -112,7 +112,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -21,7 +21,7 @@
</label> </label>
<span class="add-on icons-pencil" title="<%= t('file.name') %>"></span> <span class="add-on icons-pencil" title="<%= t('file.name') %>"></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :file_title_translations do |f| %> <%= f.fields_for :file_title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t('file.name'), :value => (form_file.file_title_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-medium", placeholder: t('file.name'), :value => (form_file.file_title_translations[locale] rescue nil) %>
@ -38,7 +38,7 @@
<span class="add-on btn-group btn" title="<%= t('archive.show_lang') %>"> <span class="add-on btn-group btn" title="<%= t('archive.show_lang') %>">
<i class="icons-earth"></i> <span class="caret"></span> <i class="icons-earth"></i> <span class="caret"></span>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<li> <li>
<label class="checkbox"> <label class="checkbox">
<%= check_box_tag "archive_file[archive_file_multiples_attributes][#{( form_file.new_record? ? 'new_archive_file_multiples' : "#{i}" )}][choose_lang][]", locale, (form_file.choose_lang.nil? ? true : form_file.choose_lang.include?(locale)) %> <%= check_box_tag "archive_file[archive_file_multiples_attributes][#{( form_file.new_record? ? 'new_archive_file_multiples' : "#{i}" )}][choose_lang][]", locale, (form_file.choose_lang.nil? ? true : form_file.choose_lang.include?(locale)) %>

View File

@ -11,7 +11,7 @@
</div> </div>
<% end -%> <% end -%>
</td> </td>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<td><%= ask_category.name_translations[locale] rescue nil %></td> <td><%= ask_category.name_translations[locale] rescue nil %></td>
<% end %> <% end %>
</tr> </tr>

View File

@ -9,7 +9,7 @@
<div id="widget-title"> <div id="widget-title">
<%= f.fields_for :name_translations do |f| %> <%= f.fields_for :name_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "name-#{locale}", "#{t(:name)}-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "name-#{locale}", "#{t(:name)}-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -20,7 +20,7 @@
<thead> <thead>
<tr> <tr>
<th class="span1-2"></th> <th class="span1-2"></th>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th class="span1-2"></th> <th class="span1-2"></th>
<% end %> <% end %>
</tr> </tr>

View File

@ -89,14 +89,14 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong>Language</strong></div> <div class="nav-name"><strong>Language</strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="control-group input-title"> <div class="control-group input-title">
<%= f.label :title , t('faq.question'), :class=>"control-label muted" %> <%= f.label :title , t('faq.question'), :class=>"control-label muted" %>

View File

@ -21,7 +21,7 @@
</label> </label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span> <span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_qa_file.title_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_qa_file.title_translations[locale] rescue nil) %>
@ -31,7 +31,7 @@
</span> </span>
<span class="add-on icons-pencil" title='<%= t(:description) %>'></span> <span class="add-on icons-pencil" title='<%= t(:description) %>'></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :description_translations do |f| %> <%= f.fields_for :description_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_qa_file.description_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_qa_file.description_translations[locale] rescue nil) %>

View File

@ -3,7 +3,7 @@
<%= f.text_field :url, class: "input-large", placeholder: t(:url) %> <%= f.text_field :url, class: "input-large", placeholder: t(:url) %>
<span class="add-on icons-pencil" title="<%= t(:url_alt) %>"></span> <span class="add-on icons-pencil" title="<%= t(:url_alt) %>"></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-large", placeholder: t(:url_alt), :value => (form_link.title_translations[locale] rescue nil) %>

View File

@ -62,7 +62,7 @@
</div> </div>
<div class="nav-name"><strong>Language</strong></div> <div class="nav-name"><strong>Language</strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= (i == 0 ? 'class=active' : '') %>> <li <%= (i == 0 ? 'class=active' : '') %>>
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a> <a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -72,7 +72,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>"> <div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
<div class="control-group input-title"> <div class="control-group input-title">

View File

@ -124,9 +124,9 @@
<input type="checkbox" value="<%= tag.id.to_s %>"> <input type="checkbox" value="<%= tag.id.to_s %>">
</p> </p>
<a> <a>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tag"><%= tag.name_translations[locale] %></span> <span class="tag"><%= tag.name_translations[locale] %></span>
<% if @site_valid_locales.count-1 != i %> <% if @site_in_use_locales.count-1 != i %>
/ /
<% end %> <% end %>
<% end %> <% end %>
@ -148,7 +148,7 @@
<form for="description" method="post" data-remote="true" action="/panel/gallery/back_end/update_image"> <form for="description" method="post" data-remote="true" action="/panel/gallery/back_end/update_image">
<fieldset> <fieldset>
<legend>Description</legend> <legend>Description</legend>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<label><%= I18nVariable.from_locale(locale) %></label> <label><%= I18nVariable.from_locale(locale) %></label>
<textarea rows="10" name="album_image[description_translations][<%= locale %>]" for="<%= locale %>"></textarea> <textarea rows="10" name="album_image[description_translations][<%= locale %>]" for="<%= locale %>"></textarea>
<% end %> <% end %>

View File

@ -7,7 +7,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -16,7 +16,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Title--> <!-- Title-->
<div class="control-group input-title"> <div class="control-group input-title">

View File

@ -12,7 +12,7 @@
<div id="widget-title"> <div id="widget-title">
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -8,7 +8,7 @@
</div> </div>
<div id="widget-title"> <div id="widget-title">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -13,7 +13,7 @@
</div> </div>
</td> </td>
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<td><%= writing_book_category.title_translations[locale] rescue nil %></td> <td><%= writing_book_category.title_translations[locale] rescue nil %></td>
<% end %> <% end %>
<% else %> <% else %>

View File

@ -8,7 +8,7 @@
<tr> <tr>
<th class="span1-2"><%= t('writing_book_category.key') %></th> <th class="span1-2"><%= t('writing_book_category.key') %></th>
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th> <th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %> <% end %>
<% else %> <% else %>

View File

@ -15,7 +15,7 @@
</div> </div>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -186,7 +186,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -196,7 +196,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -21,7 +21,7 @@
</label> </label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span> <span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>

View File

@ -15,7 +15,7 @@
</div> </div>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -11,7 +11,7 @@
<div class="sdm_t hh1 ">Language</div> <div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select"> <div class="admbg sdm_o language_select">
<ul> <ul>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -24,7 +24,7 @@
<div class="overview" content-layout="simple" base-width="420"> <div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true"> <ul class="s_form" isotope="true">
<li class="s_grid_row" > <li class="s_grid_row" >
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>

View File

@ -13,7 +13,7 @@
<% end %> <% end %>
</div> </div>
</td> </td>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>
<td <%= style %> <%= data %>> <td <%= style %> <%= data %>>

View File

@ -7,7 +7,7 @@
<div class="sdm_t hh1 ">Language</div> <div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select"> <div class="admbg sdm_o language_select">
<ul> <ul>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -36,7 +36,7 @@
</ul> </ul>
</div> </div>
</li> </li>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>> <li class="s_grid_row" <%= style %> <%= data %>>

View File

@ -59,7 +59,7 @@
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -71,7 +71,7 @@
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title"> <div class="title">

View File

@ -13,7 +13,7 @@
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %> <%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %>

View File

@ -12,7 +12,7 @@
<div id="widget-title"> <div id="widget-title">
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -8,7 +8,7 @@
</div> </div>
<div id="widget-title"> <div id="widget-title">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -13,7 +13,7 @@
</div> </div>
</td> </td>
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<td><%= writing_conference_category.title_translations[locale] rescue nil %></td> <td><%= writing_conference_category.title_translations[locale] rescue nil %></td>
<% end %> <% end %>
<% else %> <% else %>

View File

@ -8,7 +8,7 @@
<tr> <tr>
<th class="span1-2"><%= t('writing_conference_category.key') %></th> <th class="span1-2"><%= t('writing_conference_category.key') %></th>
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th> <th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %> <% end %>
<% else %> <% else %>

View File

@ -15,7 +15,7 @@
</div> </div>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -191,7 +191,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -201,7 +201,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -21,7 +21,7 @@
</label> </label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span> <span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content"> <span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>"> <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %> <%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>

View File

@ -15,7 +15,7 @@
</div> </div>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -10,7 +10,7 @@
<div class="sdm_t hh1 ">Language</div> <div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select"> <div class="admbg sdm_o language_select">
<ul> <ul>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -32,7 +32,7 @@
<div class="overview" content-layout="simple" base-width="420"> <div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true"> <ul class="s_form" isotope="true">
<li class="s_grid_row" > <li class="s_grid_row" >
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>
<div class="form_fix" <%= style %> <%= data %>> <div class="form_fix" <%= style %> <%= data %>>

View File

@ -13,7 +13,7 @@
<% end %> <% end %>
</div> </div>
</td> </td>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>
<td <%= style %> <%= data %>> <td <%= style %> <%= data %>>

View File

@ -7,7 +7,7 @@
<div class="sdm_t hh1 ">Language</div> <div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select"> <div class="admbg sdm_o language_select">
<ul> <ul>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -36,7 +36,7 @@
</ul> </ul>
</div> </div>
</li> </li>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>> <li class="s_grid_row" <%= style %> <%= data %>>

View File

@ -70,7 +70,7 @@
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -87,7 +87,7 @@
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title"> <div class="title">

View File

@ -13,7 +13,7 @@
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %> <%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %>

View File

@ -140,7 +140,7 @@
<!-- Language Tabs --> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div> <div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav"> <ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>"> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li> </li>
@ -150,7 +150,7 @@
<!-- Language --> <!-- Language -->
<div class="tab-content language-area"> <div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -11,7 +11,7 @@
<div class="sdm_t hh1 ">Language</div> <div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select"> <div class="admbg sdm_o language_select">
<ul> <ul>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -34,7 +34,7 @@
<%= f.date_select :end_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %> <%= f.date_select :end_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
</li> </li>
<li class="s_grid_row"> <li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>
<div class="form_fix" <%= style %> <%= data %>> <div class="form_fix" <%= style %> <%= data %>>

View File

@ -7,7 +7,7 @@
<div class="sdm_t hh1 ">Language</div> <div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select"> <div class="admbg sdm_o language_select">
<ul> <ul>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
@ -36,7 +36,7 @@
</ul> </ul>
</div> </div>
</li> </li>
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %> <% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %> <% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>> <li class="s_grid_row" <%= style %> <%= data %>>

View File

@ -42,14 +42,14 @@
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %> <% end %>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">

View File

@ -13,7 +13,7 @@
</div> </div>
</td> </td>
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<td><%= writing_book_category.title_translations[locale] rescue nil %></td> <td><%= writing_book_category.title_translations[locale] rescue nil %></td>
<% end %> <% end %>
<% else %> <% else %>

View File

@ -12,7 +12,7 @@
<div id="widget-title"> <div id="widget-title">
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -8,7 +8,7 @@
</div> </div>
<div id="widget-title"> <div id="widget-title">
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

View File

@ -8,7 +8,7 @@
<tr> <tr>
<th class="span1-2"><%= t('writing_book_category.key') %></th> <th class="span1-2"><%= t('writing_book_category.key') %></th>
<% if @types.is_localized?(:title) %> <% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th> <th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %> <% end %>
<% else %> <% else %>

View File

@ -15,7 +15,7 @@
</div> </div>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<div class="control-group"> <div class="control-group">
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls"> <div class="controls">

Some files were not shown because too many files have changed in this diff Show More