Fix added option field to sync with primary locale

This commit is contained in:
Bernie Chiu 2013-12-31 11:27:49 +08:00 committed by saurabhbhatia
parent c62b8d4d37
commit 14b742b022
2 changed files with 8 additions and 4 deletions

View File

@ -22,6 +22,8 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
def new
@survey = ::Survey.new
@primary_locale = I18n.locale.to_s
@secondary_locale = (I18n.locale == :zh_tw) ? "en" : "zh_tw"
respond_to do |format|
format.html # new.html.erb
@ -47,6 +49,8 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
end
def edit
@primary_locale = I18n.locale.to_s
@secondary_locale = (I18n.locale == :zh_tw) ? "en" : "zh_tw"
@survey = ::Survey.find(params[:id])
@sqs = []
@survey.survey_questions.each do |sq|

View File

@ -165,8 +165,8 @@
</div>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<a class="btn active" href="${'#'+_radiogroups[2]+'en'}" data-toggle="tab">English</a>
<a class="btn" href="${'#'+_radiogroups[2]+'zh_tw'}" data-toggle="tab">Chinese</a>
<a class="btn active" href="${'#'+_radiogroups[2]+'<%= @primary_locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(@primary_locale) %></a>
<a class="btn" href="${'#'+_radiogroups[2]+'<%= @secondary_locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(@secondary_locale) %></a>
<a href="#" class="btn remove-input">
<i class="icon-trash"></i>
</a>
@ -187,8 +187,8 @@
</div>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<a class="btn active" href="${'#'+_option[2]+'en'}" data-toggle="tab">English</a>
<a class="btn" href="${'#'+_option[2]+'zh_tw'}" data-toggle="tab">Chinese</a>
<a class="btn active" href="${'#'+_option[2]+'<%= @primary_locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(@primary_locale) %></a>
<a class="btn" href="${'#'+_option[2]+'<%= @secondary_locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(@secondary_locale) %></a>
<a href="#" class="btn remove-input">
<i class="icon-trash"></i>
</a>