survey/app/views/admin/surveys/_selectable_question.erb

29 lines
1.7 KiB
Plaintext

<div class="select_trigger hide" for="7" data-parent=".control-group" data-trigger=".type-selector">
<% SurveysHelper::QuestionTypeMap.each_with_index do |key,i| %>
<label for="${_question_type[2]}_<%= key %>" class="radio">
<input type="radio" id="${_question_type[2]}_<%= key %>" name="${_question_type[0]}" value="<%= i %>"
{{if _question_type[1]===<%= i %> || (_question_type[1]==='' && <%= i %> === 1 )}}checked{{/if}}>
<%= t("survey_question_type.#{key}") %></label>
<% end %>
</div>
<div class="select_trigger hide" for="2|3" data-parent=".control-group" data-trigger=".type-selector">
<% SurveysHelper::OptionLayoutTypeMap.each_with_index do |key,i| %>
<label for="${_option_layout_type[2]}_<%= key %>" class="radio">
<input type="radio" id="${_option_layout_type[2]}_<%= key %>" name="${_option_layout_type[0]}" value="<%= i %>"
{{if _option_layout_type[1]===<%= i %> || (_option_layout_type[1]==='' && <%= i %> === 0 )}}checked{{/if}}>
<%= t("option_layout_type.#{key}") %></label>
<% end %>
</div>
<%= label_tag :selectable_question, :for => nil, :class => 'float-right' do %>
<input data-div="selectable_question_div" name="${_selectable_question[0]}" type="checkbox" value="1" {{if _selectable_question[1]}}checked{{/if}}>
<%= t('survey_question.selectable_question') %>
<% end %>
<div class="selectable_question_div hide">
<select name="${_selectable_question_type[0]}">
<% SurveysHelper::SelectableQuestionTypeMap.each_with_index do |key,i| %>
<option value="<%= i %>" {{if _selectable_question_type[1] == <%= i %>}}selected="selected"{{/if}}>
<%= t("selectable_question_type.#{key}") %>
</option>
<% end %>
</select>
</div>