Fix added option field to sync with primary locale
This commit is contained in:
parent
c62b8d4d37
commit
14b742b022
|
@ -22,6 +22,8 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@survey = ::Survey.new
|
@survey = ::Survey.new
|
||||||
|
@primary_locale = I18n.locale.to_s
|
||||||
|
@secondary_locale = (I18n.locale == :zh_tw) ? "en" : "zh_tw"
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.erb
|
format.html # new.html.erb
|
||||||
|
@ -47,6 +49,8 @@ class Panel::Survey::BackEnd::SurveysController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@primary_locale = I18n.locale.to_s
|
||||||
|
@secondary_locale = (I18n.locale == :zh_tw) ? "en" : "zh_tw"
|
||||||
@survey = ::Survey.find(params[:id])
|
@survey = ::Survey.find(params[:id])
|
||||||
@sqs = []
|
@sqs = []
|
||||||
@survey.survey_questions.each do |sq|
|
@survey.survey_questions.each do |sq|
|
||||||
|
|
|
@ -165,8 +165,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group" data-toggle="buttons-radio">
|
<div class="btn-group" data-toggle="buttons-radio">
|
||||||
<a class="btn active" href="${'#'+_radiogroups[2]+'en'}" data-toggle="tab">English</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]+'zh_tw'}" data-toggle="tab">Chinese</a>
|
<a class="btn" href="${'#'+_radiogroups[2]+'<%= @secondary_locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(@secondary_locale) %></a>
|
||||||
<a href="#" class="btn remove-input">
|
<a href="#" class="btn remove-input">
|
||||||
<i class="icon-trash"></i>
|
<i class="icon-trash"></i>
|
||||||
</a>
|
</a>
|
||||||
|
@ -187,8 +187,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group" data-toggle="buttons-radio">
|
<div class="btn-group" data-toggle="buttons-radio">
|
||||||
<a class="btn active" href="${'#'+_option[2]+'en'}" data-toggle="tab">English</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]+'zh_tw'}" data-toggle="tab">Chinese</a>
|
<a class="btn" href="${'#'+_option[2]+'<%= @secondary_locale %>'}" data-toggle="tab"><%= I18nVariable.from_locale(@secondary_locale) %></a>
|
||||||
<a href="#" class="btn remove-input">
|
<a href="#" class="btn remove-input">
|
||||||
<i class="icon-trash"></i>
|
<i class="icon-trash"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
Reference in New Issue