class Formbuilder::Views::EntryDl

Public Instance Methods

content() click to toggle source
# File lib/formbuilder/views/entry_dl.rb, line 10
def content
  dl(class: 'entry-dl') {
    response_fields.each do |rf|
      value = @entry.response_value(rf)

      dt {
        text rf.label
        blind_label if rf.blind?
        admin_only_label if rf.admin_only?
      }

      dd {
        if (x = rf.render_entry(value, entry: @entry))
          rawtext x
        else
          no_response
        end
      }
    end
  }
end

Private Instance Methods

admin_only_label() click to toggle source
# File lib/formbuilder/views/entry_dl.rb, line 38
def admin_only_label
  text ' '
  span.label 'Admin only'
end
blind_label() click to toggle source
# File lib/formbuilder/views/entry_dl.rb, line 33
def blind_label
  text ' '
  span.label 'Blind'
end
no_response() click to toggle source
# File lib/formbuilder/views/entry_dl.rb, line 43
def no_response
  span 'No response', class: 'no-response'
end
response_fields() click to toggle source
# File lib/formbuilder/views/entry_dl.rb, line 47
def response_fields
  return_array = @form.input_fields
  return_array.reject! { |rf| rf.blind? } unless @show_blind
  return_array.reject! { |rf| rf.admin_only? } unless @show_admin_only
  return_array
end