-# frozen_string_literal: true
/ Begin _panel.html.haml
- classes = ['panel', 'hidden']
- if panel_counter == 0
- classes << ['first']
- if panel_counter == panels.length-1
- classes << 'last-panel'
- panel_id = "panel#{panel_counter}"
%fieldset{:id => panel_id, :class => classes}
.panel-action-links
= render :partial => "quby/v1/hotkey_dialog"
- if panel_counter == 0 && @questionnaire.allow_switch_to_bulk
= render :partial => "quby/v1/switch_to_bulk"
:javascript
panel_validations["panel#{panel_counter}"] = #{raw get_validation_json(panel.validations)};
= render :partial => 'quby/v1/shared/backbone_panel', :locals => {:panel => panel, |
:panel_id => panel_id, |
:answer => @answer} |
/.panel_index= panel_counter + 1
- if panel.title
%h1&= panel.title
= render :partial => "quby/v1/paged/item", :collection => panel.items
- if panels.length > 1
- current = panel_counter + 1
.progress-bar{ 'data-panel-number' => current, 'data-panel-length' => panels.length }
.progress-wrapper
.progress-slider{ class: "#{'long-list' if panels.length > 25}" }
- panels.length.times do |i|
- item = i + 1
- class_name = "step-#{item}"
- class_name << ' active' if item <= current
- class_name << ' first-child' if item == 1
- class_name << ' last-child' if item == panels.length
- class_name << ' current' if item == current
%span.progress-stop{ class: class_name }= i + 1
.progress-details
= translate('step_i_of_n', i: panel_counter + 1, n: panels.length)
.buttons
- if panel_counter == 0 and @questionnaire.enable_previous_questionnaire_button
.back
= submit_tag raw("← #{translate('previous_questionnaire')}"), :id => "back", :tabindex => "-1", name: 'previous_questionnaire'
- else
.prev
= submit_tag raw("← #{translate('previous')}"), :id => "prevButton#{panel_counter}", :tabindex => "-1", name: 'previous'
.abort
- if questionnaire.abortable
= submit_tag translate('abort'), :id => "abortButton#{panel_counter}", :tabindex => "-1", name: 'abort'
- else
- if panel_counter < panels.length - 1
.next
= submit_tag raw("#{translate('next')} →"), :id => "nextButton#{panel_counter}", name: 'next'
- else
.save
= submit_tag translate('done'), :id => "done-button", name: 'done'
- if panel_counter == panels.length - 1
= render :partial => 'quby/v1/shared/pdf_button'
/ End _panel.html.haml