html reset
This commit is contained in:
@ -9,10 +9,8 @@
|
||||
</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> Add option </div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -12,10 +12,8 @@
|
||||
</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>Add option</div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -1,45 +1,44 @@
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: question} %>
|
||||
|
||||
<%= form_for question, url: action do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :quiz_id, 'Quiz' %>
|
||||
<%= form.select :quiz_id, options_for_select(@quizzes.map{ |q| [q.name, q.id] }, question.quiz_id), include_blank: (@quizzes.size > 1) %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :category, 'Category' %>
|
||||
<%= form.text_field :category %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :sort, 'Sort' %>
|
||||
<%= form.text_field :sort %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.check_box :active %>
|
||||
<%= form.label :active, 'Active' %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :question, "Question" %>
|
||||
<%= form.text_area :question %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :attachment, "Attachment URL" %>
|
||||
<%= form.text_field :attachment %>
|
||||
|
||||
<% if @question.attachment.present? %>
|
||||
<p><%= image_tag @question.attachment %></p>
|
||||
<% end %>
|
||||
<%= image_tag @question.attachment if @question.attachment.present? %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :input_type, 'Input Type' %>
|
||||
<%= form.select :input_type, question_type_options(question.input_type), { include_blank: false }, { data: { qid: question.id } } %>
|
||||
</div>
|
||||
|
||||
<div class="form-group" data-id="input-options-wrapper">
|
||||
<div>
|
||||
<%= fields_for @question do |fields| %>
|
||||
<% partial = question.input_type.blank? ? 'admin/question/text' : "admin/question/#{question.input_type}" %>
|
||||
<%= render partial: partial, locals: {question: question, fields: fields } %>
|
||||
|
@ -9,10 +9,8 @@
|
||||
</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>Add option</div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -1,21 +1,17 @@
|
||||
<strong>Radio Options</strong>
|
||||
|
||||
<ul data-id="input_option_list">
|
||||
<ul>
|
||||
<% 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>Add option</div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<td><%= question.input_type %></td>
|
||||
<td><%= question.category %></td>
|
||||
<td><%= question.active unless question.active? %></td>
|
||||
<td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: 'btn tertiary-btn' } %></td>
|
||||
<td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: "" } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
@ -4,4 +4,5 @@
|
||||
%>
|
||||
|
||||
<h1><%= @question.quiz.name %></h1>
|
||||
|
||||
<%= render partial: 'form', locals: {question: @question, action: admin_update_question_path } %>
|
||||
|
@ -7,5 +7,5 @@
|
||||
<% quizzes.each do |quiz, questions| %>
|
||||
<h1><%= quiz %></h1>
|
||||
<%= render partial: 'admin/question/table_list', locals: { questions: questions } %>
|
||||
<%= link_to('Edit Quiz', admin_quiz_path(questions.first.quiz.to_i), { class: 'btn' }) %>
|
||||
<%= link_to('Edit Quiz', admin_quiz_path(questions.first.quiz.to_i), { class: "" }) %>
|
||||
<% end %>
|
||||
|
@ -3,39 +3,30 @@
|
||||
content_for :title, "Question - Skills Assessment Admin"
|
||||
%>
|
||||
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th>Category</th>
|
||||
<td><%= @question.category %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<td><%= @question.input_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Sort</th>
|
||||
<td><%= @question.sort %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
|
||||
<%= label_tag 'question_active', 'Active' %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1><%= @question.quiz.name %></h1>
|
||||
|
||||
<strong>Question</strong>
|
||||
<p><%= @question.question %></p>
|
||||
<h2>Category</h2>
|
||||
<div><%= @question.category %></div>
|
||||
|
||||
<% if @question.attachment.present? %>
|
||||
<p><%= image_tag @question.attachment %></p>
|
||||
<% end %>
|
||||
<h2>Type</h2>
|
||||
<div><%= @question.input_type %></div>
|
||||
|
||||
<h2>Sort</h2>
|
||||
<div><%= @question.sort %></div>
|
||||
|
||||
<div>
|
||||
<%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
|
||||
<%= label_tag 'question_active', 'Active' %>
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Question</h2>
|
||||
<div><%= @question.question %></div>
|
||||
<div><%= image_tag @question.attachment if @question.attachment.present? %></div>
|
||||
|
||||
<%= fields_for @question do |fields| %>
|
||||
<%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: 'btn' }) %>
|
||||
|
||||
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: 'btn' }) %>
|
||||
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: "" }) %>
|
||||
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: "" }) %>
|
||||
|
Reference in New Issue
Block a user