Sha256: a15d54e050d26c4335a387d34a6e06bb380c857bcb5e804f6120d8f03d128be4

Contents?: true

Size: 1.95 KB

Versions: 13

Compression:

Stored size: 1.95 KB

Contents

- id = [workflow.to_s, task.to_s] * "__"
- action = File.join('/', workflow.to_s, task.to_s)
- task_info = workflow.task_info(task)

.workflow_task(id=id)
  .title
    %h3
      %a(href="/#{workflow.to_s}")= workflow
      —
      =Misc.humanize task
  .description
    - if task_info[:description]
      %p.task_description
        :markdown
          #{task_info[:description]}

  .form
    = partial_render('partials/form', :id => id, :action => action, :method => 'post', 
      :enctype => "multipart/form-data", :info => task_info, :klass => 'workflow_task')

  - if workflow.libdir.examples[task.to_s].exists?
    .examples

      Click below to load example data:
        
      :javascript
        example_inputs = [];
      %ul
        - workflow.libdir.examples[task.to_s].glob('*').each do |example_dir|
          - name = File.basename(example_dir)
          - task_info = workflow.task_info task
          - inputs = Workflow.load_inputs(example_dir, task_info[:inputs], task_info[:input_types])
          - inputs.each{ |k,v| v.replace Open.read(v) if String === v and File.exists? v }
          :javascript
            example_inputs["#{ name }"] = #{inputs.to_json}
          %li
            %a.load_example(href="#" task=task name=name)= name

      :javascript
        defer(function(){
          var form = $('.workflow_task[id=#{id}] > .form > form')

          $("a.load_example").click(function(){
            var link = $(this);
            var name = $(link).attr('name');
            var inputs = example_inputs[name];
            form[0].reset()

            for (var input in inputs){
              var value = inputs[input]
              var input = form.find('[name=' + input + ']')
              if (input.is('[type=checkbox]')){
                input.prop('checked', value)
              }else{
                input.val(value)
              }
            }
            form.find('[name=jobname]').val(name)
            return false
          })
        })

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rbbt-rest-1.7.11 share/views/form.haml
rbbt-rest-1.7.10 share/views/form.haml
rbbt-rest-1.7.9 share/views/form.haml
rbbt-rest-1.7.8 share/views/form.haml
rbbt-rest-1.7.7 share/views/form.haml
rbbt-rest-1.7.6 share/views/form.haml
rbbt-rest-1.7.5 share/views/form.haml
rbbt-rest-1.7.4 share/views/form.haml
rbbt-rest-1.7.3 share/views/form.haml
rbbt-rest-1.7.2 share/views/form.haml
rbbt-rest-1.7.1 share/views/form.haml
rbbt-rest-1.7.0 share/views/form.haml
rbbt-rest-1.6.28 share/views/form.haml