chef-server-webui 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. data/LICENSE +201 -0
  2. data/README.rdoc +135 -0
  3. data/Rakefile +62 -0
  4. data/app/controllers/application.rb +281 -0
  5. data/app/controllers/clients.rb +120 -0
  6. data/app/controllers/cookbook_attributes.rb +41 -0
  7. data/app/controllers/cookbook_definitions.rb +41 -0
  8. data/app/controllers/cookbook_files.rb +39 -0
  9. data/app/controllers/cookbook_libraries.rb +41 -0
  10. data/app/controllers/cookbook_recipes.rb +40 -0
  11. data/app/controllers/cookbook_templates.rb +57 -0
  12. data/app/controllers/cookbooks.rb +78 -0
  13. data/app/controllers/databag_items.rb +102 -0
  14. data/app/controllers/databags.rb +83 -0
  15. data/app/controllers/exceptions.rb +19 -0
  16. data/app/controllers/main.rb +7 -0
  17. data/app/controllers/nodes.rb +138 -0
  18. data/app/controllers/openid_consumer.rb +154 -0
  19. data/app/controllers/roles.rb +144 -0
  20. data/app/controllers/search.rb +62 -0
  21. data/app/controllers/search_entries.rb +64 -0
  22. data/app/controllers/status.rb +39 -0
  23. data/app/controllers/users.rb +186 -0
  24. data/app/helpers/application_helper.rb +171 -0
  25. data/app/helpers/cookbook_attributes_helper.rb +7 -0
  26. data/app/helpers/cookbook_definitions_helper.rb +8 -0
  27. data/app/helpers/cookbook_files_helper.rb +8 -0
  28. data/app/helpers/cookbook_libraries_helper.rb +7 -0
  29. data/app/helpers/cookbook_recipes_helper.rb +8 -0
  30. data/app/helpers/cookbook_templates_helper.rb +8 -0
  31. data/app/helpers/exceptions_helper.rb +6 -0
  32. data/app/helpers/global_helpers.rb +35 -0
  33. data/app/helpers/nodes_helper.rb +41 -0
  34. data/app/helpers/openid_consumer_helper.rb +8 -0
  35. data/app/helpers/openid_register_helper.rb +8 -0
  36. data/app/helpers/openid_server_helper.rb +6 -0
  37. data/app/helpers/openid_server_helpers.rb +29 -0
  38. data/app/helpers/roles_helper.rb +5 -0
  39. data/app/helpers/search_entries_helper.rb +8 -0
  40. data/app/helpers/search_helper.rb +38 -0
  41. data/app/helpers/status_helper.rb +26 -0
  42. data/app/views/clients/_form.html.haml +22 -0
  43. data/app/views/clients/_navigation.html.haml +9 -0
  44. data/app/views/clients/edit.html.haml +6 -0
  45. data/app/views/clients/index.html.haml +21 -0
  46. data/app/views/clients/new.html.haml +6 -0
  47. data/app/views/clients/show.html.haml +20 -0
  48. data/app/views/cookbooks/index.html.haml +10 -0
  49. data/app/views/cookbooks/show.html.haml +40 -0
  50. data/app/views/databag_items/_form.html.haml +14 -0
  51. data/app/views/databag_items/_navigation.html.haml +9 -0
  52. data/app/views/databag_items/edit.html.haml +6 -0
  53. data/app/views/databag_items/index.html.haml +0 -0
  54. data/app/views/databag_items/new.html.haml +6 -0
  55. data/app/views/databag_items/show.html.haml +9 -0
  56. data/app/views/databags/_form.html.haml +12 -0
  57. data/app/views/databags/_item_navigation.html.haml +8 -0
  58. data/app/views/databags/_navigation.html.haml +9 -0
  59. data/app/views/databags/edit.html.haml +6 -0
  60. data/app/views/databags/index.html.haml +19 -0
  61. data/app/views/databags/new.html.haml +6 -0
  62. data/app/views/databags/show.html.haml +19 -0
  63. data/app/views/exceptions/bad_request.json.erb +1 -0
  64. data/app/views/exceptions/internal_server_error.html.erb +216 -0
  65. data/app/views/exceptions/not_acceptable.html.erb +63 -0
  66. data/app/views/exceptions/not_found.html.erb +47 -0
  67. data/app/views/exceptions/standard_error.html.erb +217 -0
  68. data/app/views/layout/_jsonedit.html.haml +82 -0
  69. data/app/views/layout/chef_server_webui.html.haml +56 -0
  70. data/app/views/layout/login.html.haml +36 -0
  71. data/app/views/main/index.html.erb +1 -0
  72. data/app/views/nodes/_action.html.haml +13 -0
  73. data/app/views/nodes/_form.html.haml +53 -0
  74. data/app/views/nodes/_navigation.html.haml +9 -0
  75. data/app/views/nodes/_resource.html.haml +22 -0
  76. data/app/views/nodes/edit.html.haml +7 -0
  77. data/app/views/nodes/index.html.haml +25 -0
  78. data/app/views/nodes/new.html.haml +6 -0
  79. data/app/views/nodes/show.html.haml +60 -0
  80. data/app/views/openid_consumer/index.html.haml +28 -0
  81. data/app/views/openid_consumer/start.html.haml +4 -0
  82. data/app/views/openid_login/index.html.haml +5 -0
  83. data/app/views/openid_register/index.html.haml +19 -0
  84. data/app/views/openid_register/show.html.haml +7 -0
  85. data/app/views/roles/_form.html.haml +53 -0
  86. data/app/views/roles/_navigation.html.haml +9 -0
  87. data/app/views/roles/edit.html.haml +6 -0
  88. data/app/views/roles/index.html.haml +21 -0
  89. data/app/views/roles/new.html.haml +6 -0
  90. data/app/views/roles/show.html.haml +54 -0
  91. data/app/views/search/_search_form.html.haml +6 -0
  92. data/app/views/search/index.html.haml +8 -0
  93. data/app/views/search/show.html.haml +13 -0
  94. data/app/views/search_entries/index.html.haml +8 -0
  95. data/app/views/search_entries/show.html.haml +7 -0
  96. data/app/views/status/index.html.haml +90 -0
  97. data/app/views/users/_form.html.haml +39 -0
  98. data/app/views/users/_navigation.html.haml +9 -0
  99. data/app/views/users/edit.html.haml +6 -0
  100. data/app/views/users/index.html.haml +20 -0
  101. data/app/views/users/login.html.haml +16 -0
  102. data/app/views/users/new.html.haml +27 -0
  103. data/app/views/users/show.html.haml +13 -0
  104. data/app/views/users/start.html.haml +4 -0
  105. data/config.ru +84 -0
  106. data/config/init.rb +49 -0
  107. data/config/router.rb +6 -0
  108. data/lib/chef-server-webui.rb +155 -0
  109. data/lib/chef-server-webui/merbtasks.rb +103 -0
  110. data/lib/chef-server-webui/slicetasks.rb +20 -0
  111. data/lib/chef-server-webui/spectasks.rb +53 -0
  112. data/public/facebox/README.txt +4 -0
  113. data/public/facebox/b.png +0 -0
  114. data/public/facebox/bl.png +0 -0
  115. data/public/facebox/br.png +0 -0
  116. data/public/facebox/closelabel.gif +0 -0
  117. data/public/facebox/facebox.css +95 -0
  118. data/public/facebox/facebox.js +319 -0
  119. data/public/facebox/loading.gif +0 -0
  120. data/public/facebox/tl.png +0 -0
  121. data/public/facebox/tr.png +0 -0
  122. data/public/images/avatar.png +0 -0
  123. data/public/images/black_big.png +0 -0
  124. data/public/images/indicator.gif +0 -0
  125. data/public/images/jsonedit/add2.png +0 -0
  126. data/public/images/jsonedit/build-button.png +0 -0
  127. data/public/images/jsonedit/bullet.gif +0 -0
  128. data/public/images/jsonedit/bullet_orange.png +0 -0
  129. data/public/images/jsonedit/cross.png +0 -0
  130. data/public/images/jsonedit/delete.png +0 -0
  131. data/public/images/jsonedit/deleted.png +0 -0
  132. data/public/images/jsonedit/json.jpg +0 -0
  133. data/public/images/jsonedit/label.gif +0 -0
  134. data/public/images/jsonedit/minus.gif +0 -0
  135. data/public/images/jsonedit/pixel.gif +0 -0
  136. data/public/images/jsonedit/plus.gif +0 -0
  137. data/public/images/jsonedit/saved.png +0 -0
  138. data/public/images/jsonedit/table_refresh.png +0 -0
  139. data/public/images/jsonedit/value.gif +0 -0
  140. data/public/images/merb.jpg +0 -0
  141. data/public/images/toggle-collapse-dark.png +0 -0
  142. data/public/images/toggle-collapse-light.png +0 -0
  143. data/public/images/toggle-collapse.gif +0 -0
  144. data/public/images/toggle-expand-dark.png +0 -0
  145. data/public/images/toggle-expand-light.png +0 -0
  146. data/public/images/toggle-expand.gif +0 -0
  147. data/public/images/treeBuilderImages/Thumbs.db +0 -0
  148. data/public/images/treeBuilderImages/doc.gif +0 -0
  149. data/public/images/treeBuilderImages/docNode.gif +0 -0
  150. data/public/images/treeBuilderImages/docNodeLast.gif +0 -0
  151. data/public/images/treeBuilderImages/docNodeLastFirst.gif +0 -0
  152. data/public/images/treeBuilderImages/folder.gif +0 -0
  153. data/public/images/treeBuilderImages/folderNode.gif +0 -0
  154. data/public/images/treeBuilderImages/folderNodeFirst.gif +0 -0
  155. data/public/images/treeBuilderImages/folderNodeLast.gif +0 -0
  156. data/public/images/treeBuilderImages/folderNodeLastFirst.gif +0 -0
  157. data/public/images/treeBuilderImages/folderNodeOpen.gif +0 -0
  158. data/public/images/treeBuilderImages/folderNodeOpenFirst.gif +0 -0
  159. data/public/images/treeBuilderImages/folderNodeOpenLast.gif +0 -0
  160. data/public/images/treeBuilderImages/folderNodeOpenLastFirst.gif +0 -0
  161. data/public/images/treeBuilderImages/folderOpen.gif +0 -0
  162. data/public/images/treeBuilderImages/vertLine.gif +0 -0
  163. data/public/javascripts/chef.js +160 -0
  164. data/public/javascripts/jquery-1.3.2.min.js +19 -0
  165. data/public/javascripts/jquery-ui-1.7.1.custom.min.js +65 -0
  166. data/public/javascripts/jquery.editinline.js +108 -0
  167. data/public/javascripts/jquery.jeditable.mini.js +30 -0
  168. data/public/javascripts/jquery.livequery.js +250 -0
  169. data/public/javascripts/jquery.localscroll.js +104 -0
  170. data/public/javascripts/jquery.scrollTo.js +150 -0
  171. data/public/javascripts/jquery.tools.min.js +17 -0
  172. data/public/javascripts/jquery.treeTable.min.js +165 -0
  173. data/public/javascripts/json.js +153 -0
  174. data/public/javascripts/jsonedit_main.js +675 -0
  175. data/public/javascripts/yetii-min.js +1 -0
  176. data/public/stylesheets/base.css +336 -0
  177. data/public/stylesheets/chef.css +157 -0
  178. data/public/stylesheets/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png +0 -0
  179. data/public/stylesheets/images/ui-bg_diagonals-thick_15_444444_40x40.png +0 -0
  180. data/public/stylesheets/images/ui-bg_glass_100_f0f0f0_1x400.png +0 -0
  181. data/public/stylesheets/images/ui-bg_glass_50_99c2ff_1x400.png +0 -0
  182. data/public/stylesheets/images/ui-bg_glass_55_fbf5d0_1x400.png +0 -0
  183. data/public/stylesheets/images/ui-bg_glass_80_e6e6e6_1x400.png +0 -0
  184. data/public/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  185. data/public/stylesheets/images/ui-bg_highlight-hard_100_f9f9f9_1x100.png +0 -0
  186. data/public/stylesheets/images/ui-bg_highlight-soft_100_e7eef3_1x100.png +0 -0
  187. data/public/stylesheets/images/ui-icons_222222_256x240.png +0 -0
  188. data/public/stylesheets/images/ui-icons_2694e8_256x240.png +0 -0
  189. data/public/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
  190. data/public/stylesheets/images/ui-icons_72a7cf_256x240.png +0 -0
  191. data/public/stylesheets/images/ui-icons_888888_256x240.png +0 -0
  192. data/public/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
  193. data/public/stylesheets/images/ui-icons_ffffff_256x240.png +0 -0
  194. data/public/stylesheets/jquery-ui-1.7.1.custom.css +404 -0
  195. data/public/stylesheets/jquery.treeTable.css +43 -0
  196. data/public/stylesheets/jsonedit_main.css +280 -0
  197. data/public/stylesheets/themes/bec-green/style.css +290 -0
  198. data/public/stylesheets/themes/bec/style.css +301 -0
  199. data/public/stylesheets/themes/blue/style.css +280 -0
  200. data/public/stylesheets/themes/default/style.css +267 -0
  201. data/public/stylesheets/themes/djime-cerulean/style.css +298 -0
  202. data/public/stylesheets/themes/kathleene/style.css +272 -0
  203. data/public/stylesheets/themes/orange/style.css +263 -0
  204. data/public/stylesheets/themes/reidb-greenish/style.css +301 -0
  205. data/stubs/app/controllers/application.rb +2 -0
  206. data/stubs/app/controllers/main.rb +2 -0
  207. metadata +399 -0
@@ -0,0 +1,36 @@
1
+ !!! XML
2
+ !!!
3
+ %html
4
+ %head
5
+ %meta{ "http-equiv" => "content-type", :content => "text/html; charset=utf-8" }
6
+ %title Chef Server
7
+ = css_include_tag "base", "themes/djime-cerulean/style", "chef", "/facebox/facebox.css", "jquery-ui-1.7.1.custom", "jquery.treeTable"
8
+ = js_include_tag "jquery-1.3.2.min", "jquery.jeditable.mini", "jquery.livequery", "jquery.localscroll", "jquery.scrollTo", "jquery.tools.min"
9
+ = js_include_tag "/facebox/facebox.js"
10
+ = js_include_tag "jquery-ui-1.7.1.custom.min"
11
+ = js_include_tag "jquery.treeTable.min"
12
+ = js_include_tag "chef"
13
+
14
+ %body
15
+ #container
16
+ #header
17
+ %h1= link_to "Chef Server", slice_url(:top)
18
+ #wrapper
19
+ #main
20
+ - unless message.empty?
21
+ .block#block-messages
22
+ .content
23
+ %h2.title Messages
24
+ .inner
25
+ .flash
26
+ - message.each do |type, msg|
27
+ %div{:class => "message #{type}"}
28
+ %p= msg
29
+ = catch_content :for_layout
30
+ #footer
31
+ .block
32
+ %p Copyright © 2009 Opscode
33
+ #sidebar
34
+ .block.notice#sidebar_block_notice= catch_content :sidebar_block_notice
35
+ .block#sidebar_block= catch_content :sidebar_block
36
+ .clear
@@ -0,0 +1 @@
1
+ <strong><%= slice.description %></strong> (v. <%= slice.version %>)
@@ -0,0 +1,13 @@
1
+ %table
2
+ - actions.each do |action, resource_hash|
3
+ %tr
4
+ %td.action_name= action.to_s
5
+ %td.action_resources
6
+ %table
7
+ - resource_hash.keys.sort{ |a,b| a.to_s <=> b.to_s }.each do |rk|
8
+ %tr
9
+ %td.action_when= rk.to_s
10
+ %td
11
+ - resource_hash[rk].each do |resource|
12
+ = partial(:resource, :resource => resource)
13
+
@@ -0,0 +1,53 @@
1
+ .content
2
+ .inner
3
+ - if form_for != "edit"
4
+ %div.group.form
5
+ %label.label Name
6
+ = text_field :id => "node_name", :name => "name", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @node.name
7
+ %span.description The name of the Node
8
+
9
+ %div.group.form
10
+ %table.sortable
11
+ %tr
12
+ %td
13
+ %label.label Available Roles
14
+ %td
15
+ %label.label Run List
16
+ %tr
17
+ %td
18
+ %div.sortable
19
+ %ul#node_available_roles.connectedSortable
20
+ - @available_roles.each do |role|
21
+ %li{ :id => "role[#{role}]", :class => 'ui-state-highlight' }= h role
22
+ %td{:rowspan => 3}
23
+ %div.sortable.run-list
24
+ %ul#for_node.connectedSortable
25
+ - @run_list.each do |entry|
26
+ - type, name, fname = @run_list.parse_entry(entry)
27
+ %li{ :id => h(fname), :class => type == 'role' ? 'ui-state-highlight' : 'ui-state-default' }= h name
28
+ %td.help
29
+ %span.description
30
+ Drag recipes from the list of Available Recipes section on the left, and drop them
31
+ 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.
32
+ %tr
33
+ %td
34
+ %label.label Available Recipes
35
+ %tr
36
+ %td
37
+ %div.sortable
38
+ %ul#node_available_recipes.connectedSortable
39
+ - @available_recipes.each do |recipe|
40
+ %li{ :id => "recipe[#{recipe}]", :class => 'ui-state-default' }= h recipe
41
+
42
+
43
+ %div.group.form{:style => "position:relative;"}
44
+ %label.label Attributes
45
+ = partial '../layout/jsonedit', :json =>@node.attribute.to_json
46
+ %div.group.form
47
+ %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.
48
+
49
+ = form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
50
+ %div.group
51
+ .actions-bar
52
+ .actions= submit submit_name, :id => submit_id, :class => 'button'
53
+
@@ -0,0 +1,9 @@
1
+ .secondary-navigation
2
+ %ul
3
+ %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:nodes))
4
+ %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', slice_url(:new_node))
5
+ - if active != 'create' && active != 'index'
6
+ %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:node, @node.name))
7
+ %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', slice_url(:edit_node, @node.name))
8
+ %li= link_to('Delete', slice_url(:node, @node.name), :method => "delete", :confirm => "Really delete node #{@node.name}? There is no undo.")
9
+ .clear
@@ -0,0 +1,22 @@
1
+ .resource
2
+ %h3= "#{h resource.to_s} (#{resource.class})"
3
+ %table
4
+ - resource.instance_variables.sort.each do |v|
5
+ - attr_name = v.gsub(/\@/, "")
6
+ - unless attr_name == "collection"
7
+ %tr.attr_group
8
+ %td.attr_name
9
+ = "#{h attr_name}"
10
+ %td.attr_value
11
+ - value = resource.instance_variable_get(v)
12
+ - if value.kind_of?(String)
13
+ = "#{h value}"
14
+ - elsif value.kind_of?(Array)
15
+ = "#{h value.join(", ")}"
16
+ - elsif value.kind_of?(Symbol)
17
+ = "#{h value.to_s}"
18
+ - elsif attr_name == "actions"
19
+ = partial(:action, :actions => value)
20
+ - else
21
+ = "#{h value.inspect}"
22
+
@@ -0,0 +1,7 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title= "Node #{h @node.name}"
4
+ .inner
5
+ = partial('navigation', :active => 'edit')
6
+ = partial('form', :header => "Edit Node #{@node.name}", :form_id => 'edit_node', :submit_name => "Save Node", :submit_id => "edit_node_button", :form_for => 'edit', :form_url => slice_url(:node, @node.name) )
7
+
@@ -0,0 +1,25 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title Node List
4
+ .inner
5
+ = partial('navigation', :active => 'index')
6
+ .content
7
+ .inner
8
+ %table.table
9
+ %tr
10
+ %th.first{:colspan => 2} Name
11
+ %th &nbsp;
12
+ %th.last &nbsp;
13
+ - even = false
14
+ - if @node_list.empty?
15
+ %td{:colspan => 4}= "You appear to have no nodes - try connecting one, or creating or editing a #{link_to('client', slice_url(:clients))}"
16
+ - else
17
+ - @node_list.each do |node, node_url|
18
+ %tr{:class => even ? "even": "odd" }
19
+ %td{:colspan => 2}= link_to node, slice_url(:node, { :id => node } )
20
+ %td
21
+ = link_to('Edit', slice_url(:edit_node, node))
22
+ |
23
+ = link_to('Delete', slice_url(:node, node), :method => "delete", :confirm => "Really delete Node #{node}? There is no undo.")
24
+ - even ? even = false: even = true
25
+
@@ -0,0 +1,6 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title= "Node"
4
+ .inner
5
+ = partial('navigation', :active => 'create')
6
+ = partial('form', :header => "Create new Node", :form_id => 'create_node', :submit_name => "Create Node", :submit_id => "create_node_button", :form_for => 'create', :form_url => slice_url(:nodes))
@@ -0,0 +1,60 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title= "Node #{h @node.name}"
4
+ .inner
5
+ = partial('navigation', :active => 'show')
6
+
7
+ .content
8
+ .inner
9
+ .left
10
+ %h3 Run List
11
+ %table.table
12
+ %tr
13
+ %th.first Position
14
+ %th Name
15
+ %th.last Type
16
+ - if @node.run_list.empty?
17
+ %tr
18
+ %td{:colspan => 2} This node has no roles or recipes applied.
19
+ - else
20
+ -@node.run_list.each_index do |i|
21
+ - type, name, fname = @node.run_list.parse_entry(@node.run_list[i])
22
+ %tr
23
+ %td.position= i
24
+ %td= name
25
+ %td= type
26
+ .left.accordion
27
+ %h3.head= link_to("Recipes", "#")
28
+ - full_recipe_list, default_attrs, override_attrs = @node.run_list.expand()
29
+ %div
30
+ %span.description.form.help
31
+ This is the list of recipes, fully expanded, as they will be applied to the node in question.
32
+ %table#recipes.table
33
+ %tr
34
+ %th.first Position
35
+ %th.last Name
36
+ - if @node.run_list.empty?
37
+ %tr
38
+ %td{:colspan => 2} This node has no recipes applied.
39
+ - else
40
+ - full_recipe_list.each_index do |i|
41
+ %tr
42
+ %td.position= i
43
+ %td= full_recipe_list[i]
44
+
45
+ .left
46
+ %h3 Tags
47
+ %table#recipes.table
48
+ %tr
49
+ %th.first Tags
50
+ %th.last &nbsp;
51
+ %tr
52
+ - if (@node.attribute?(:tags) == false) || @node[:tags].empty?
53
+ %td{:colspan => 2} This node has no tags applied.
54
+ - else
55
+ %td{:colspan => 2}= @node[:tags].join(", ")
56
+
57
+ .left
58
+ %h3 Attributes
59
+ = build_tree('attrs', @node.attribute, default_attrs, override_attrs)
60
+
@@ -0,0 +1,28 @@
1
+ - throw_content(:sidebar_block_notice) do
2
+ %h4 Where do I get a Login?
3
+ %p Any existing Admin level user can create new users.
4
+ %p To create the first user, please login with the default admin credential, which by default is:
5
+ %p username: admin, password: p@ssw0rd1 (May be different if you've set it in Chef::Config)
6
+ %b Please change the default password immediately after logging in!
7
+ %p Once you have an User, you can associate an OpenID with the User and login using the OpenID as the User.
8
+ %p Administrators can associate OpenID to any User.
9
+
10
+ .block#block-forms
11
+ .content
12
+ %h2.title Login
13
+ .inner
14
+ %form.form{ :method => "get", "accept-charset" => "UTF-8", :action => slice_url(:openid_consumer_login) }
15
+ .group
16
+ .text_field= text_field :openid_identifier
17
+ .group
18
+ .check_box= check_box :name => "immediate", :label => "Use immediate mode", :value => "0"
19
+ .group
20
+ .check_box= check_box :name => "use_sreg", :label => "Request registration data", :value => "0"
21
+ .group
22
+ .check_box= check_box :name => "use_pape", :label => "Request phishing-resistent auth policy", :value => "0"
23
+ .group
24
+ .check_box= check_box :name => "force_post", :label => "Force the transaction to POST", :value => "0"
25
+ .group
26
+ =link_to("Or, log in with username and password.", slice_url(:users_login))
27
+ .group.navform
28
+ .button= submit "Login &rarr;"
@@ -0,0 +1,4 @@
1
+ <%= @form_text %>
2
+ <script type="text/javascript">
3
+ document.getElementById('openid_form').submit();
4
+ </script>
@@ -0,0 +1,5 @@
1
+ #login-form
2
+ %form{ :method => "get", :action => url(:openid_login_submit) }
3
+ %input{ :type => "text", :name => "username" }/
4
+ %input{ :type => "submit", :value => "Log In"}/
5
+
@@ -0,0 +1,19 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title Registrations
4
+ .inner
5
+ %table.table
6
+ %tr
7
+ %th.first Registration Name
8
+ %th &nbsp
9
+ %th Control
10
+ %th.last &nbsp;
11
+ - @registered_nodes.sort{ |a,b| a.name.to_s <=> b.name.to_s }.each_with_index do |node, index|
12
+ %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
13
+ %td{:colspan => 2}= link_to(node.name, slice_url(:registration, { :id => node.name }))
14
+ %td
15
+ = link_to( (node.validated ? "Invalidate Registration" : "Validate Registration"), slice_url( :validate_registration, { :id => node.name} ), :method => "post", :confirm => "Are you sure you want to" + (node.validated ? " invalidate " : " validate ") + "this node's registration?")
16
+ |
17
+ = link_to((node.admin ? "Remove Admin Rights" : "Grant Admin Rights"), slice_url(:admin_registration, { :id => node.name}), :method => "post", :confirm => "Are you sure you want to" + (node.admin ? " remove administrator privileges from this node?" : " grant administrator privileges to this node?"))
18
+ |
19
+ = link_to("Delete", slice_url(:registration, { :id => node.name} ), :method => "delete", :confirm => "Are you sure you want to delete this registration")
@@ -0,0 +1,7 @@
1
+ .block#block-text
2
+ .content
3
+ %h2.title= "Registration #{@registered_node.name}"
4
+ .inner
5
+ = link_to "OpenID URL", slice_url(:openid_node, { :id => @registered_node.name.gsub(/\./, "_")})
6
+ %br= "Validated: #{@registered_node.validated}"
7
+ %br= "Admin: #{@registered_node.admin}"
@@ -0,0 +1,53 @@
1
+ .content
2
+ .inner
3
+ - if form_for != "edit"
4
+ %div.group.form
5
+ %label.label Name
6
+ = text_field :id => "role_name", :name => "name", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @role.name
7
+ %span.description The name of the Role
8
+ %div.group.form
9
+ %label.label Description
10
+ = text_area(params.has_key?(:description) ? h(params[:description]) : @role.description, :name => "description", :class => "text_area", :id => "role_description")
11
+ %span.description A description of this Role
12
+
13
+ %div.group.form
14
+ %table.sortable
15
+ %tr
16
+ %td
17
+ %label.label Available Roles
18
+ %td
19
+ %label.label Run List
20
+ %tr
21
+ %td
22
+ %div.sortable
23
+ %ul#node_available_roles.connectedSortable
24
+ - @available_roles.each do |role|
25
+ %li{ :id => "role[#{role}]", :class => 'ui-state-highlight' }= h role
26
+ %td{:rowspan => 3}
27
+ %div.sortable.run-list
28
+ %ul#for_role.connectedSortable
29
+ - @run_list.each do |entry|
30
+ - type, name, fname = @run_list.parse_entry(entry)
31
+ %li{ :id => h(fname), :class => type == 'role' ? 'ui-state-highlight' : 'ui-state-default' }= h name
32
+ %td.help
33
+ %span.description
34
+ Drag recipes from the list of Available Recipes section on the left, and drop them
35
+ 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.
36
+ %tr
37
+ %td
38
+ %label.label Available Recipes
39
+ %tr
40
+ %td
41
+ %div.sortable
42
+ %ul#node_available_recipes.connectedSortable
43
+ - @available_recipes.each do |recipe|
44
+ %li{ :id => "recipe[#{recipe}]", :class => 'ui-state-default' }= h recipe
45
+
46
+ %div.group.form{:style => "position:relative;"}
47
+ %label.label Default and Override Attributes
48
+ = partial '../layout/jsonedit', :json => { :defaults => @role.default_attributes, :overrides => @role.override_attributes }.to_json
49
+ %span.description A JSON hash for default attributes for nodes of this role. These attributes will only be applied if the node does not already have a value for the attributes.
50
+ = form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
51
+ %div.group
52
+ .actions-bar
53
+ .actions= submit submit_name, :id => submit_id, :class => 'button'
@@ -0,0 +1,9 @@
1
+ .secondary-navigation
2
+ %ul
3
+ %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:roles))
4
+ %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', slice_url(:new_role))
5
+ - if active != 'create' && active != 'index'
6
+ %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:role, @role.name))
7
+ %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', slice_url(:edit_role, @role.name))
8
+ %li= link_to('Delete', slice_url(:role, @role.name), :method => "delete", :confirm => "Really delete Role #{@role.name}? There is no undo.")
9
+ .clear
@@ -0,0 +1,6 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title= "Role #{h @role.name}"
4
+ .inner
5
+ = partial('navigation', :active => 'edit')
6
+ = partial('form', :header => "Edit Role #{@role.name}", :form_id => 'edit_role', :submit_name => "Save Role", :submit_id => "edit_role_button", :form_for => 'edit', :form_url => slice_url(:role, @role.name) )
@@ -0,0 +1,21 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title Roles
4
+ .inner
5
+ = partial('navigation', :active => 'index')
6
+ .content
7
+ .inner
8
+ %table.table
9
+ %tr
10
+ %th.first{:colspan => 2} Name
11
+ %th &nbsp;
12
+ %th.last &nbsp;
13
+ - even = false;
14
+ - @role_list.each do |role|
15
+ %tr{ :class => even ? "even" : "odd" }
16
+ %td{:colspan => 2}= link_to(role[0], slice_url(:role, role[0]))
17
+ %td
18
+ = link_to('Edit', slice_url(:edit_role, role[0]))
19
+ |
20
+ = link_to('Delete', slice_url(:role, role[0]), :method => "delete", :confirm => "Really delete Role #{role[0]}? there is no undo.")
21
+ - even ? even = false: even = true
@@ -0,0 +1,6 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title= "Role"
4
+ .inner
5
+ = partial('navigation', :active => 'create')
6
+ = partial('form', :header => "Create new Role", :form_id => 'create_role', :submit_name => "Create Role", :submit_id => "create_role_button", :form_for => 'create', :form_url => slice_url(:roles))
@@ -0,0 +1,54 @@
1
+ .block#block-tables
2
+ .content
3
+ %h2.title= "Role #{h @role.name}"
4
+ .inner
5
+ = partial("navigation", :active => "show")
6
+ .content
7
+ .inner
8
+ .left
9
+ %h3 Description
10
+ = @role.description
11
+
12
+ .left
13
+ %h3 Run List
14
+ %table.table
15
+ %tr
16
+ %th.first Position
17
+ %th Name
18
+ %th.last Type
19
+ - if @role.run_list.empty?
20
+ %tr
21
+ %td{:colspan => 2} This role does not include any roles or recipes.
22
+ - else
23
+ -@role.run_list.each_index do |i|
24
+ - type, name, fname = @role.run_list.parse_entry(@role.run_list[i])
25
+ %tr
26
+ %td.position= i
27
+ %td= name
28
+ %td= type
29
+ .left.accordion
30
+ %h3.head= link_to("Recipes", "#")
31
+ - full_recipe_list, default_attrs, override_attrs = @role.run_list.expand()
32
+ %div
33
+ %span.description.form.help
34
+ This is the list of recipes, fully expanded, as they will be applied to the node in question.
35
+ %table#recipes.table
36
+ %tr
37
+ %th.first Position
38
+ %th.last Name
39
+ - if @role.run_list.empty?
40
+ %tr
41
+ %td{:colspan => 2} This node has no recipes applied.
42
+ - else
43
+ - full_recipe_list.each_index do |i|
44
+ %tr
45
+ %td.position= i
46
+ %td= full_recipe_list[i]
47
+ .left
48
+ %h3 Default Attributes
49
+ = build_tree('defattrs', @role.default_attributes)
50
+
51
+ .left
52
+ %h3 Override Attributes
53
+ = build_tree('overattrs', @role.override_attributes)
54
+