Sha256: 78bb28adf836995c45380d5c4f49f32272814c37099e12a07ea4d5ccb75e9489

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

<%- if ['question_pages', 'question_sheets', 'elements'].include?(controller.controller_name) -%>
  <div class="droppable" data-url="<%= drop_fe_admin_question_sheet_page_element_path(@page.question_sheet_id, @page.id, yes_no.id) %>">
    <%= render 'fe/questions/fe/yes_no_field', :yes_no => yes_no %>
  	<ul class="questions" id="questions_list_<%= yes_no.id %>" data-sortable="true" data-sortable-url="<%= reorder_fe_admin_question_sheet_page_elements_path(@page.question_sheet_id, @page.id) %>" data-sortable-handle=".handle">
      <%= render :partial => 'fe/admin/question_pages/element', :collection => yes_no.elements, :locals => {:in_grid => true} %>
    </ul>
  </div>
<% else %>
  <%= render 'fe/questions/fe/yes_no_field', :yes_no => yes_no %>
  <ul class="questions" id="questions_list_<%= yes_no.id %>" style="<%= yes_no.has_answer?(1,@answer_sheet) ? '' : 'display:none' %>">
    <%= render :partial => 'fe/answer_pages/element', :collection => yes_no.elements, :locals => {:in_grid => false, :in_conditional => true} %>
  </ul>
  <script type="text/javascript" charset="utf-8">
    $(document).on('click', '#<%= dom_id(yes_no) %>_1', function() {$('#questions_list_<%= yes_no.id %>').show(); $('input', '#questions_list_<%= yes_no.id %>').addClass('required'); });
    $(document).on('click', '#<%= dom_id(yes_no) %>_0', function() {$('#questions_list_<%= yes_no.id %>').hide(); $('input', '#questions_list_<%= yes_no.id %>').removeClass('required'); });
  </script>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fe-1.0.0 app/views/fe/questions/fe/_yes_no.html.erb
fe-0.0.4 app/views/fe/questions/fe/_yes_no.html.erb