introduce check_other and radio_other question types
completes issue #48
This commit is contained in:
21
app/views/admin/question/_checkbox_other.html.erb
Normal file
21
app/views/admin/question/_checkbox_other.html.erb
Normal file
@ -0,0 +1,21 @@
|
||||
<strong>Checkbox Options</strong>
|
||||
|
||||
<ul data-id="input_option_list">
|
||||
<% question.input_options.each do | option | %>
|
||||
<li>
|
||||
<%= text_field_tag 'question[multi_choice][]', option, { disabled: (disable ||= false), data: { last: option } } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Other: <input type="text" disabled="disabled" /></li>
|
||||
</ul>
|
||||
|
||||
<% unless (disable ||= false) %>
|
||||
<div class="form-group">
|
||||
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
|
||||
<li style="display: none;">
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</li>
|
||||
</div>
|
||||
<% end %>
|
21
app/views/admin/question/_radio_other.html.erb
Normal file
21
app/views/admin/question/_radio_other.html.erb
Normal file
@ -0,0 +1,21 @@
|
||||
<strong>Radio Options</strong>
|
||||
|
||||
<ul data-id="input_option_list">
|
||||
<% question.input_options.each do | option | %>
|
||||
<li>
|
||||
<%= text_field_tag 'question[multi_choice][]', option, { disabled: (disable ||= false), data: { last: option } } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Other: <input type="text" disabled="disabled" /></li>
|
||||
</ul>
|
||||
|
||||
<% unless (disable ||= false) %>
|
||||
<div class="form-group">
|
||||
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
|
||||
<li style="display: none;">
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</li>
|
||||
</div>
|
||||
<% end %>
|
Reference in New Issue
Block a user