Sha256: 816dc890be4edb4ef0a277ff0496282124e47de98091e649b703b502ac5952b7

Contents?: true

Size: 1.77 KB

Versions: 27

Compression:

Stored size: 1.77 KB

Contents

-# frozen_string_literal: true
= render :partial => "quby/v1/shared/main_label", :locals => {:question => question}
.description-and-fields
  .description
    - unless question.description.blank?
      = Quby::MarkdownParser.new(question.description).html_safe
  .fields{:id => question.html_id}
    - cls = [question.type]
    - cls << "subinput"  if subquestion
    - cls << question.as if question.as
    - data = question.input_data
    - data[:show_values] = question.show_values_in_mode? :paged
    - data['field-key'] = question.key
    - case question.as
    - when :slider
      - if question.default_position.is_a? Numeric
        - data[:default_position] = question.default_position
      = range_field :answer, question.key, autocomplete: question.autocomplete,
                                           class: cls,
                                           disabled: (disabled ? "" : nil),
                                           min: question.minimum,
                                           max: question.maximum,
                                           step: (question.type == :float ? 0.01 : 1),
                                           data: data
      - unless question.labels.blank?
        %div.labels
          - question.labels.each_with_index do |label, i|
            -# Remove class when ie8 is dropped.
            - lcls = (i == 0) ? 'first' : (i == question.labels.size-1) ? 'last' : ''
            - left = i * 100 / (question.labels.size - 1)
            %div{class: lcls, style: left != 100 ? "left: #{left}%" : ''}= transform_special_text(label).html_safe
    - else
      = text_field :answer, question.key, :autocomplete => question.autocomplete, :class => cls, :disabled => (disabled ? "" : nil), :size => question.size, data: data
    %span.unit= raw question.unit

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
quby-5.6.5 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.6.3 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.6.2 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.6.1 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.6.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.5.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.4.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.3.1 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.3.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.2.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.1.3 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.1.2 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.1.1 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.1.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.0.5 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.0.4 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.0.3 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.0.2 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.0.1 app/views/quby/v1/paged/_item_question_number.html.haml
quby-5.0.0 app/views/quby/v1/paged/_item_question_number.html.haml