Sha256: 6aa99114613ea4fdd544d353059f9e65c74cbcd7db9fbeb85572ca8c824a8b28

Contents?: true

Size: 1.95 KB

Versions: 31

Compression:

Stored size: 1.95 KB

Contents

- id = [workflow.to_s, task.to_s] * "__"
- action = to(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

31 entries across 31 versions & 1 rubygems

Version Path
rbbt-rest-1.6.26 share/views/form.haml
rbbt-rest-1.6.25 share/views/form.haml
rbbt-rest-1.6.24 share/views/form.haml
rbbt-rest-1.6.23 share/views/form.haml
rbbt-rest-1.6.22 share/views/form.haml
rbbt-rest-1.6.21 share/views/form.haml
rbbt-rest-1.6.20 share/views/form.haml
rbbt-rest-1.6.19 share/views/form.haml
rbbt-rest-1.6.18 share/views/form.haml
rbbt-rest-1.6.17 share/views/form.haml
rbbt-rest-1.6.16 share/views/form.haml
rbbt-rest-1.6.15 share/views/form.haml
rbbt-rest-1.6.14 share/views/form.haml
rbbt-rest-1.6.13 share/views/form.haml
rbbt-rest-1.6.12 share/views/form.haml
rbbt-rest-1.6.11 share/views/form.haml
rbbt-rest-1.6.10 share/views/form.haml
rbbt-rest-1.6.9 share/views/form.haml
rbbt-rest-1.6.8 share/views/form.haml
rbbt-rest-1.6.7 share/views/form.haml