Sha256: 488989397a67d4316a4522c510102c74b80e57577419c259f9ee8296cb545cc0

Contents?: true

Size: 1.55 KB

Versions: 20

Compression:

Stored size: 1.55 KB

Contents

- id      = nil unless defined? id
- action  = nil unless defined? action
- klass   = nil unless defined? klass
- method  = 'post' unless defined? method
- enctype = 'multipart/form-data' unless defined? enctype
- info    = {} unless defined? info

- klass = "#{klass} custom"

- if defined?(description) and description
  .form_description
    =description
  %hr

%form.ui.form(class=klass action=action method=method id=id enctype=enctype)

  - inputs       = consume_parameter(:inputs, info) || []
  - types        = consume_parameter(:input_types, info) || {}
  - defaults     = consume_parameter(:input_defaults, info) || {}
  - descriptions = consume_parameter(:input_descriptions, info) || {}
  - options      = consume_parameter(:input_options, info) || {}
  - values       = consume_parameter(:values, info) || {}

  - inputs.each do |input|
    - input_id = id.nil? ? nil : id + "__" << input.to_s
    - hide = (options[input] != nil and options[input][:hide])
    %div(class="field #{types[input]} #{input} #{hide ? 'hide' : ''}")
      - input_options = options[input]
      - input_options = input_options.dup unless input_options.nil?
      !~ form_input(input, types[input], defaults[input], values[input], descriptions[input], input_id, input_options)


  .input.field.submit
    %input.ui.submit.button(type="submit")
    - if klass =~ /workflow_task/
      %input.jobname(type='text' name='jobname' placeholder='optional job name')
      %select.format(name="_format")
        - [:html, :json, :raw, :binary].each do |format|
          %option(value=format)= format.to_s

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rbbt-rest-1.8.16 share/views/partials/form.haml
rbbt-rest-1.8.15 share/views/partials/form.haml
rbbt-rest-1.8.14 share/views/partials/form.haml
rbbt-rest-1.8.13 share/views/partials/form.haml
rbbt-rest-1.8.12 share/views/partials/form.haml
rbbt-rest-1.8.11 share/views/partials/form.haml
rbbt-rest-1.8.10 share/views/partials/form.haml
rbbt-rest-1.8.9 share/views/partials/form.haml
rbbt-rest-1.8.8 share/views/partials/form.haml
rbbt-rest-1.8.7 share/views/partials/form.haml
rbbt-rest-1.8.6 share/views/partials/form.haml
rbbt-rest-1.8.5 share/views/partials/form.haml
rbbt-rest-1.8.4 share/views/partials/form.haml
rbbt-rest-1.8.3 share/views/partials/form.haml
rbbt-rest-1.8.2 share/views/partials/form.haml
rbbt-rest-1.8.1 share/views/partials/form.haml
rbbt-rest-1.8.0 share/views/partials/form.haml
rbbt-rest-1.7.20 share/views/partials/form.haml
rbbt-rest-1.7.19 share/views/partials/form.haml
rbbt-rest-1.7.18 share/views/partials/form.haml