forked from saurabh/orbit4-5
fix form language tab order
This commit is contained in:
parent
1fe11bda6b
commit
460e6c82a7
|
@ -28,6 +28,9 @@ class ApplicationController < ActionController::Base
|
|||
session[:locale] = session[:locale].blank? ? I18n.default_locale : session[:locale]
|
||||
|
||||
I18n.locale = session[:locale]
|
||||
|
||||
@site_in_use_locales = [I18n.locale]+(in_use_locales-[I18n.locale])
|
||||
@site_valid_locales = [I18n.locale]+(current_site.valid_locales-[I18n.locale])
|
||||
end
|
||||
|
||||
def get_layout
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<td>
|
||||
<%= check_box_tag 'files[]', asset.id, false, :class => "checkbox_in_list" %>
|
||||
<input type="hidden" value="<%= asset.data.url %>" id="url_<%= asset.id %>" />
|
||||
<% @current_site.in_use_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.title_translations[locale] rescue nil %>" id="<%= locale %>_title_<%= asset.id %>" />
|
||||
<% end %>
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
<strong><%= t(:language) %></strong>
|
||||
</div>
|
||||
<ul class="nav nav-pills language-nav">
|
||||
<% @current_site.in_use_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 %>"><%= t(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<% @current_site.in_use_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="control-group input-title">
|
||||
<%= f.label :title , t('title'), :class=>"control-label muted" %>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<h4 class="modal-title" id="myModalLabel"><%= t(:new_category) %></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<% Site.first.in_use_locales.each do |locale| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<%= label_tag "name-#{locale}", "#{t(:name)} (#{t(locale)})" %>
|
||||
<input class="input-large" id="<%=locale%>" name="category[title_translations][<%=locale%>]" placeholder="<%=t(:name)%>" type="text">
|
||||
<br/><br/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<%= form_for :category, url: nil, remote: true do |f| %>
|
||||
<fieldset>
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% Site.first.in_use_locales.each do |locale| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<%= label_tag "name-#{locale}", "#{t(:name)} (#{t(locale)})" %>
|
||||
<%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %>
|
||||
<% end %>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<%#= f.error_messages %>
|
||||
|
||||
<%= f.fields_for :name_translations do |f| %>
|
||||
<% Site.first.in_use_locales.each do |locale| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<%= f.label :locale, "#{t(:name)} #{t(locale)}" %>
|
||||
<%= f.text_field locale, class: 'input-large', placeholder: "#{t(:name)} #{t(locale)}", value: (@tag.name_translations[locale] rescue nil), id: locale %>
|
||||
<% end %>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<div class="modal-body tags">
|
||||
<div class="clearfix">
|
||||
<%= f.fields_for :name_translations do |f| %>
|
||||
<% Site.first.in_use_locales.each do |locale| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<%= f.label :locale, "#{t(:name)} #{t(locale)}" %>
|
||||
<%= f.text_field locale, class: 'input-large', placeholder: "#{t(:name)} #{t(locale)}", id: locale %>
|
||||
<% end %>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<h4 class="modal-title" id="myModalLabel"><%= t(:new_tag) %></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<% Site.first.in_use_locales.each do |locale| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<%= label_tag "name-#{locale}", "#{t(:name)} (#{t(locale)})" %>
|
||||
<input class="input-large" id="<%=locale%>" name="tag[name_translations][<%=locale%>]" placeholder="<%=t(:name)%>" type="text">
|
||||
<br/><br/>
|
||||
|
|
|
@ -93,6 +93,9 @@ zh_tw:
|
|||
add_files: 新增檔案
|
||||
size: 大小
|
||||
edit_file: 編輯檔案
|
||||
save: 儲存
|
||||
page_content:
|
||||
page: 頁面
|
||||
|
||||
|
||||
site:
|
||||
|
|
Loading…
Reference in New Issue