Sha256: 66f0827aac12a3293e39162fcc01a54e33e9934a62a4a5567d445eba17454ddf

Contents?: true

Size: 1.78 KB

Versions: 6

Compression:

Stored size: 1.78 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 || 30), data: data
    %span.unit= raw question.unit

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
quby-4.0.1 app/views/quby/v1/paged/_item_question_number.html.haml
quby-4.0.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-3.2.2 app/views/quby/v1/paged/_item_question_number.html.haml
quby-3.2.1 app/views/quby/v1/paged/_item_question_number.html.haml
quby-3.2.0 app/views/quby/v1/paged/_item_question_number.html.haml
quby-3.2.0.pre.pre1 app/views/quby/v1/paged/_item_question_number.html.haml