summaryrefslogtreecommitdiff
path: root/chef-server-webui/app/views/nodes/_form.html.haml
blob: d150eb59a7c262907a1aa220744b34f907f2d218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.content
  .inner
    - if form_for != "edit"
      %div.group.form
        %label.label Name
        = text_field :id => "node_name", :name => "name", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @node.name 
        %span.description The name of the Node 

    %div.group.form
      %table.sortable
        %tr
          %td 
            %label.label Available Roles
          %td
            %label.label Run List 
        %tr
          %td
            %div.sortable
              %ul#node_available_roles.connectedSortable
                - @available_roles.each do |role|
                  %li{ :id => "role[#{role}]", :class => 'ui-state-highlight' }= h role 
          %td{:rowspan => 3}
            %div.sortable.run-list
              %ul#for_node.connectedSortable
                - @run_list.each do |entry|
                  - type, name, fname = @run_list.parse_entry(entry)
                  %li{ :id => h(fname), :class => type == 'role' ? 'ui-state-highlight' : 'ui-state-default' }= h name 
          %td.help
            %span.description
              Drag recipes from the list of Available Recipes section on the left, and drop them
              in the "Recipes for this node" section on the right.  Then sort the recipes for this node list to the order you would like to see the recipes applied.
        %tr
          %td
            %label.label Available Recipes
        %tr
          %td
            %div.sortable
              %ul#node_available_recipes.connectedSortable
                - @available_recipes.each do |recipe|
                  %li{ :id => "recipe[#{recipe}]", :class => 'ui-state-default' }= h recipe 


    %div.group.form
      %label.label Attributes 
      %div.editor
        %div#tree
        %div#jform
        %div.clear
        %script= "$(document).ready(function() { JSONeditor.start('tree', 'jform', #{@node.attribute.to_json}, false); });"
      %span.description A JSON hash for default attributes for nodes of this node.  These attributes will only be applied if the node does not already have a value for the attributes.

    = form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
      %div.group
        .actions-bar
          .actions= submit submit_name, :id => submit_id, :class => 'button'