chef-server-webui 0.8.16 → 0.9.0.a3

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 (80) hide show
  1. data/Rakefile +14 -10
  2. data/app/controllers/application.rb +111 -128
  3. data/app/controllers/clients.rb +10 -10
  4. data/app/controllers/cookbook_attributes.rb +1 -1
  5. data/app/controllers/cookbook_definitions.rb +1 -1
  6. data/app/controllers/cookbook_files.rb +1 -1
  7. data/app/controllers/cookbook_libraries.rb +1 -1
  8. data/app/controllers/cookbook_recipes.rb +1 -1
  9. data/app/controllers/cookbook_templates.rb +1 -1
  10. data/app/controllers/cookbooks.rb +21 -3
  11. data/app/controllers/databag_items.rb +6 -6
  12. data/app/controllers/databags.rb +3 -3
  13. data/app/controllers/main.rb +1 -1
  14. data/app/controllers/nodes.rb +21 -21
  15. data/app/controllers/openid_consumer.rb +9 -9
  16. data/app/controllers/roles.rb +3 -3
  17. data/app/controllers/search.rb +1 -1
  18. data/app/controllers/search_entries.rb +1 -1
  19. data/app/controllers/status.rb +1 -1
  20. data/app/controllers/users.rb +7 -7
  21. data/app/helpers/application_helper.rb +1 -156
  22. data/app/helpers/global_helpers.rb +20 -16
  23. data/app/helpers/nodes_helper.rb +24 -22
  24. data/app/helpers/openid_server_helpers.rb +13 -10
  25. data/app/helpers/search_helper.rb +44 -38
  26. data/app/helpers/status_helper.rb +10 -3
  27. data/app/views/clients/_navigation.html.haml +5 -5
  28. data/app/views/clients/edit.html.haml +1 -1
  29. data/app/views/clients/index.html.haml +4 -4
  30. data/app/views/clients/new.html.haml +1 -1
  31. data/app/views/cookbooks/index.html.haml +1 -1
  32. data/app/views/cookbooks/show.html.haml +25 -16
  33. data/app/views/databag_items/_form.html.haml +1 -1
  34. data/app/views/databag_items/_navigation.html.haml +5 -5
  35. data/app/views/databag_items/edit.html.haml +1 -1
  36. data/app/views/databag_items/new.html.haml +1 -1
  37. data/app/views/databags/_item_navigation.html.haml +4 -4
  38. data/app/views/databags/_navigation.html.haml +5 -5
  39. data/app/views/databags/edit.html.haml +1 -1
  40. data/app/views/databags/index.html.haml +3 -3
  41. data/app/views/databags/new.html.haml +1 -1
  42. data/app/views/databags/show.html.haml +3 -3
  43. data/app/views/layout/{chef_server_webui.html.haml → application.html.haml} +11 -11
  44. data/app/views/layout/login.html.haml +1 -1
  45. data/app/views/nodes/_form.html.haml +1 -1
  46. data/app/views/nodes/_navigation.html.haml +5 -5
  47. data/app/views/nodes/edit.html.haml +1 -1
  48. data/app/views/nodes/index.html.haml +6 -6
  49. data/app/views/nodes/new.html.haml +1 -1
  50. data/app/views/nodes/show.html.haml +4 -5
  51. data/app/views/openid_consumer/index.html.haml +2 -2
  52. data/app/views/openid_register/index.html.haml +4 -4
  53. data/app/views/openid_register/show.html.haml +1 -1
  54. data/app/views/roles/_form.html.haml +1 -1
  55. data/app/views/roles/_navigation.html.haml +5 -5
  56. data/app/views/roles/edit.html.haml +1 -1
  57. data/app/views/roles/index.html.haml +4 -4
  58. data/app/views/roles/new.html.haml +1 -1
  59. data/app/views/roles/show.html.haml +3 -4
  60. data/app/views/search/_search_form.html.haml +1 -1
  61. data/app/views/search/index.html.haml +1 -1
  62. data/app/views/search/show.html.haml +1 -1
  63. data/app/views/status/index.html.haml +9 -12
  64. data/app/views/users/_form.html.haml +1 -1
  65. data/app/views/users/_navigation.html.haml +5 -5
  66. data/app/views/users/edit.html.haml +1 -1
  67. data/app/views/users/index.html.haml +3 -3
  68. data/app/views/users/login.html.haml +1 -1
  69. data/app/views/users/new.html.haml +1 -1
  70. data/bin/chef-server-webui +72 -0
  71. data/config.ru +10 -74
  72. data/config/init.rb +30 -11
  73. data/config/rack.rb +5 -0
  74. data/config/router.rb +62 -5
  75. data/lib/chef-server-webui.rb +2 -155
  76. data/lib/chef-server-webui/version.rb +3 -0
  77. data/public/javascripts/drop_down_menu.js +22 -0
  78. metadata +60 -48
  79. data/stubs/app/controllers/application.rb +0 -2
  80. data/stubs/app/controllers/main.rb +0 -2
@@ -16,20 +16,24 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- module Merb
20
- module ChefServerWebui
19
+ # Possibly Dead Code. To revive it, move the GlobalHelpers module into the
20
+ # Merb namespace
21
21
 
22
- module GlobalHelpers
23
- # helpers defined here available to all views.
24
- def resource_collection(collection)
25
- html = "<ul>"
26
- collection.each do |resource|
27
- html << "<li><b>#{resource.class}</b></li>"
28
- end
29
- html << "</ul>"
30
- html
31
- end
32
-
33
- end
34
- end
35
- end
22
+ # module Merb
23
+ # module ChefServerWebui
24
+ #
25
+ # module GlobalHelpers
26
+ # # helpers defined here available to all views.
27
+ # def resource_collection(collection)
28
+ # html = "<ul>"
29
+ # collection.each do |resource|
30
+ # html << "<li><b>#{resource.class}</b></li>"
31
+ # end
32
+ # html << "</ul>"
33
+ # html
34
+ # end
35
+ #
36
+ # end
37
+ # end
38
+ # end
39
+ #
@@ -17,25 +17,27 @@
17
17
  # limitations under the License.
18
18
  #
19
19
 
20
- module Merb
21
- module ChefServerWebui
22
- module NodesHelper
23
- def recipe_list(node)
24
- response = ""
25
- node.recipes.each do |recipe|
26
- response << "<li>#{recipe}</li>\n"
27
- end
28
- response
29
- end
30
-
31
- def attribute_list(node)
32
- response = ""
33
- node.each_attribute do |k,v|
34
- response << "<li><b>#{k}</b>: #{v}</li>\n"
35
- end
36
- response
37
- end
38
-
39
- end
40
- end
41
- end
20
+ # Possibly dead code. to revive it, move NodesHelper into the Merb namespace.
21
+ # module Merb
22
+ # module ChefServerWebui
23
+ # module NodesHelper
24
+ # def recipe_list(node)
25
+ # response = ""
26
+ # node.recipes.each do |recipe|
27
+ # response << "<li>#{recipe}</li>\n"
28
+ # end
29
+ # response
30
+ # end
31
+ #
32
+ # def attribute_list(node)
33
+ # response = ""
34
+ # node.each_attribute do |k,v|
35
+ # response << "<li><b>#{k}</b>: #{v}</li>\n"
36
+ # end
37
+ # response
38
+ # end
39
+ #
40
+ # end
41
+ # end
42
+ # end
43
+ #
@@ -16,14 +16,17 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- module Merb
20
- module ChefServerWebui
21
- module OpenidServerHelper
22
-
23
- def url_for_user
24
- url(:openid_node, :username => session[:username])
25
- end
19
+ # possibly dead code.
26
20
 
27
- end
28
- end
29
- end
21
+ # module Merb
22
+ # module ChefServerWebui
23
+ # module OpenidServerHelper
24
+ #
25
+ # def url_for_user
26
+ # url(:openid_node, :username => session[:username])
27
+ # end
28
+ #
29
+ # end
30
+ # end
31
+ # end
32
+ #
@@ -1,38 +1,44 @@
1
- module Merb
2
- module ChefServerWebui
3
- module SearchHelper
4
- def output_path(attributes)
5
- res = Hash.new
6
- attributes.each do |path|
7
- parts = path.split("/")
8
- unless parts[0].nil?
9
- parts.shift if parts[0].length == 0
10
- end
11
- res[path] = ohai_walk(parts)
12
- end
13
- res
14
- end
15
-
16
- def ohai_walk(path)
17
- unless path[0]
18
- @@ohai.to_json
19
- else
20
- ohai_walk_r(@@ohai, path)
21
- end
22
- end
23
-
24
- def ohai_walk_r(ohai, path)
25
- hop = (ohai.is_a?(Array) ? path.shift.to_i : path.shift)
26
- if ohai[hop]
27
- if path[0]
28
- ohai_walk_r(ohai[hop], path)
29
- else
30
- ohai[hop].to_json
31
- end
32
- else
33
- nil
34
- end
35
- end
36
- end
37
- end
38
- end # Merb
1
+ # TODO: missing license header.
2
+
3
+
4
+ # possibly dead code. to revive, move SearchHelper to the Merb namespace.
5
+
6
+ # module Merb
7
+ # module ChefServerWebui
8
+ # module SearchHelper
9
+ # def output_path(attributes)
10
+ # res = Hash.new
11
+ # attributes.each do |path|
12
+ # parts = path.split("/")
13
+ # unless parts[0].nil?
14
+ # parts.shift if parts[0].length == 0
15
+ # end
16
+ # res[path] = ohai_walk(parts)
17
+ # end
18
+ # res
19
+ # end
20
+ #
21
+ # def ohai_walk(path)
22
+ # unless path[0]
23
+ # @@ohai.to_json
24
+ # else
25
+ # ohai_walk_r(@@ohai, path)
26
+ # end
27
+ # end
28
+ #
29
+ # def ohai_walk_r(ohai, path)
30
+ # hop = (ohai.is_a?(Array) ? path.shift.to_i : path.shift)
31
+ # if ohai[hop]
32
+ # if path[0]
33
+ # ohai_walk_r(ohai[hop], path)
34
+ # else
35
+ # ohai[hop].to_json
36
+ # end
37
+ # else
38
+ # nil
39
+ # end
40
+ # end
41
+ # end
42
+ # end
43
+ # end # Merb
44
+ #
@@ -18,9 +18,16 @@
18
18
  require 'chef' / 'node'
19
19
 
20
20
  module Merb
21
- module ChefServerWebui
22
- module StatusHelper
21
+ module StatusHelper
22
+ def time_difference_in_hms(unix_time)
23
+ now = Time.now.to_i
24
+ difference = now - unix_time.to_i
25
+ hours = (difference / 3600).to_i
26
+ difference = difference % 3600
27
+ minutes = (difference / 60).to_i
28
+ seconds = (difference % 60)
29
+ return [hours, minutes, seconds]
23
30
  end
24
-
31
+
25
32
  end
26
33
  end
@@ -1,9 +1,9 @@
1
1
  .secondary-navigation
2
2
  %ul
3
- %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:clients))
4
- %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', slice_url(:new_client))
3
+ %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', url(:clients))
4
+ %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', url(:new_client))
5
5
  - if active != 'create' && active != 'index'
6
- %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:client, @client.name))
7
- %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', slice_url(:edit_client, @client.name))
8
- %li= link_to('Delete', slice_url(:client, @client.name), :method => "delete", :confirm => "Really delete Role #{@client.name}? There is no undo.")
6
+ %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', url(:client, @client.name))
7
+ %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', url(:edit_client, @client.name))
8
+ %li= link_to('Delete', url(:client, @client.name), :method => "delete", :confirm => "Really delete Role #{@client.name}? There is no undo.")
9
9
  .clear
@@ -3,4 +3,4 @@
3
3
  %h2.title= "Client: #{h @client.name}"
4
4
  .inner
5
5
  = partial('navigation', :active => 'edit')
6
- = partial('form', :header => "Edit Client #{@client.name}", :form_id => 'edit_client', :submit_name => "Save Client", :submit_id => "edit_client_button", :form_for => 'edit', :form_url => slice_url(:client, @client.name) )
6
+ = partial('form', :header => "Edit Client #{@client.name}", :form_id => 'edit_client', :submit_name => "Save Client", :submit_id => "edit_client_button", :form_for => 'edit', :form_url => url(:client, @client.name) )
@@ -13,9 +13,9 @@
13
13
  - even = false;
14
14
  - @clients_list.each do |client|
15
15
  %tr{ :class => even ? "even" : "odd" }
16
- %td{:colspan => 2}= link_to(client[0], slice_url(:client, client[0]))
16
+ %td{:colspan => 2}= link_to(client, url(:client, client))
17
17
  %td
18
- = link_to('Edit', slice_url(:edit_client, client[0]))
18
+ = link_to('Edit', url(:edit_client, client))
19
19
  |
20
- = link_to('Delete', slice_url(:client, client[0]), :method => "delete", :confirm => "Really delete Role #{client[0]}? there is no undo.")
21
- - even ? even = false: even = true
20
+ = link_to('Delete', url(:client, client), :method => "delete", :confirm => "Really delete Role #{client}? there is no undo.")
21
+ - even = (not even)
@@ -3,4 +3,4 @@
3
3
  %h2.title= "Client"
4
4
  .inner
5
5
  = partial('navigation', :active => 'create')
6
- = partial('form', :header => "Create new Client", :form_id => 'create_client', :submit_name => "Create Client", :submit_id => "create_client_button", :form_for => 'create', :form_url => slice_url(:clients))
6
+ = partial('form', :header => "Create new Client", :form_id => 'create_client', :submit_name => "Create Client", :submit_id => "create_client_button", :form_for => 'create', :form_url => url(:clients))
@@ -7,4 +7,4 @@
7
7
  %th.first Cookbook Name
8
8
  - @cl.sort.each_with_index do |cookbook, index|
9
9
  %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
10
- %td= link_to cookbook[0], slice_url(:cookbook, { :id => cookbook[0] })
10
+ %td= link_to cookbook[0], url(:cookbook, { :id => cookbook[0] })
@@ -1,40 +1,49 @@
1
+ %script{:type=>"text/javascript", :src => "/javascripts/drop_down_menu.js"}
1
2
  .block#block-text
2
3
  .content
3
- %h2.title= "Cookbook: #{h @cookbook["name"]}"
4
+ %h2
5
+ .title
6
+ = "Cookbook: #{h @cookbook.manifest["name"]}"
7
+ - unless @other_versions.nil? || @other_versions.empty?
8
+ %select{:name => "choice", :onchange => "jump(this)", :size => "1"}
9
+ %option{:value => ""} Other Versions
10
+ %option{:value => ""} --------------
11
+ - @other_versions.each do |v|
12
+ %option{:value => url(:show_specific_version_cookbook, :cookbook_id => @cookbook_id, :cb_version => v)} "#{v}"
4
13
  .inner
5
14
  .accordion
6
- - unless @cookbook["libraries"].empty?
15
+ - unless @cookbook.manifest["libraries"].empty?
7
16
  %h2.head= link_to "Library Files", "JavaScript:void(0);"
8
17
  .files
9
- - @cookbook["libraries"].each do |f|
18
+ - @cookbook.manifest["libraries"].each do |f|
10
19
  .code
11
20
  %h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
12
- %pre.ruby= syntax_highlight(f["uri"])
13
- - unless @cookbook["attributes"].empty?
21
+ %pre.ruby= syntax_highlight(get_file(f["uri"]))
22
+ - unless @cookbook.manifest["attributes"].empty?
14
23
  %h2.head= link_to "Attribute Files", "JavaScript:void(0);"
15
24
  .files
16
- - @cookbook["attributes"].each do |f|
25
+ - @cookbook.manifest["attributes"].each do |f|
17
26
  .code
18
27
  %h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
19
- %pre.ruby= syntax_highlight(f["uri"])
20
- - unless @cookbook["definitions"].empty?
28
+ %pre.ruby= syntax_highlight(get_file(f["uri"]))
29
+ - unless @cookbook.manifest["definitions"].empty?
21
30
  %h2.head= link_to "Definition Files", "JavaScript:void(0);"
22
31
  .files
23
- - @cookbook["definitions"].each do |f|
32
+ - @cookbook.manifest["definitions"].each do |f|
24
33
  .code
25
34
  %h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
26
- %pre.ruby= syntax_highlight(f["uri"])
27
- - unless @cookbook["recipes"].empty?
35
+ %pre.ruby= syntax_highlight(get_file(f["uri"]))
36
+ - unless @cookbook.manifest["recipes"].empty?
28
37
  %h2.head= link_to "Recipe Files", "JavaScript:void(0);"
29
38
  .files
30
- - @cookbook["recipes"].each do |f|
39
+ - @cookbook.manifest["recipes"].each do |f|
31
40
  .code
32
41
  %h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
33
- %pre.ruby= syntax_highlight(f["uri"])
34
- - unless @cookbook["templates"].empty?
42
+ %pre.ruby= syntax_highlight(get_file(f["uri"]))
43
+ - unless @cookbook.manifest["templates"].empty?
35
44
  %h2.head= link_to "Template Files", "JavaScript:void(0);"
36
45
  .files
37
- - @cookbook["templates"].each do |f|
46
+ - @cookbook.manifest["templates"].each do |f|
38
47
  .code
39
48
  %h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
40
- %pre.ruby= syntax_highlight(f["uri"])
49
+ %pre.ruby= syntax_highlight(get_file(f["uri"]))
@@ -4,7 +4,7 @@
4
4
  %label.label Data
5
5
  %div.group.form{:style => "position:relative;"}
6
6
  %label.label Attributes
7
- = partial '../layout/jsonedit', :json =>@default_data.to_json
7
+ = partial 'layout/jsonedit', :json =>@default_data.to_json
8
8
 
9
9
 
10
10
  = form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
@@ -1,9 +1,9 @@
1
1
  .secondary-navigation
2
2
  %ul
3
- %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:databag_databag_items, :databag_id=>@databag_name))
4
- %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', slice_url(:new_databag_databag_item, :databag_id => @databag_name))
3
+ %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', url(:databag_databag_items, :databag_id=>@databag_name))
4
+ %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', url(:new_databag_databag_item, :databag_id => @databag_name))
5
5
  - if active != 'create' && active != 'index'
6
- %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:databag_databag_item, :id => @databag_item_name, :databag_id=>@databag_name))
7
- %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', slice_url(:edit_databag_databag_item, :id => @databag_item_name, :databag_id=>@databag_name))
8
- %li= link_to('Delete', slice_url(:databag_databag_item, :id => @databag_item_name, :databag_id=>@databag_name), :method => "delete", :confirm => "Really delete Databag Item #{@databag_item_name}? There is no undo.")
6
+ %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', url(:databag_databag_item, :id => @databag_item_name, :databag_id=>@databag_name))
7
+ %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', url(:edit_databag_databag_item, :id => @databag_item_name, :databag_id=>@databag_name))
8
+ %li= link_to('Delete', url(:databag_databag_item, :id => @databag_item_name, :databag_id=>@databag_name), :method => "delete", :confirm => "Really delete Databag Item #{@databag_item_name}? There is no undo.")
9
9
  .clear
@@ -3,4 +3,4 @@
3
3
  %h2.title= "Databag Item"
4
4
  .inner
5
5
  = partial('navigation', :active => 'edit')
6
- = partial('form', :header => "Edit Databag Item", :form_id => 'edit_databag_item', :submit_name => "Edit Databag Item", :submit_id => "edit_databag_item_button", :form_for => 'edit', :form_url => slice_url(:databag_databag_item, :databag_id=>params[:databag_id], :id=>params[:id]))
6
+ = partial('form', :header => "Edit Databag Item", :form_id => 'edit_databag_item', :submit_name => "Edit Databag Item", :submit_id => "edit_databag_item_button", :form_for => 'edit', :form_url => url(:databag_databag_item, :databag_id=>params[:databag_id], :id=>params[:id]))
@@ -3,4 +3,4 @@
3
3
  %h2.title= "Databag Item"
4
4
  .inner
5
5
  = partial('navigation', :active => 'create')
6
- = partial('form', :header => "Create new Databag Item", :form_id => 'create_databag_item', :submit_name => "Create Databag Item", :submit_id => "create_databag_item_button", :form_for => 'create', :form_url => slice_url(:databag_databag_items))
6
+ = partial('form', :header => "Create new Databag Item", :form_id => 'create_databag_item', :submit_name => "Create Databag Item", :submit_id => "create_databag_item_button", :form_for => 'create', :form_url => url(:databag_databag_items))
@@ -1,8 +1,8 @@
1
1
  .secondary-navigation
2
2
  %ul
3
- %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:databags))
4
- %li{ :class => (active == 'create_item' ? "active" : '')}= link_to('Create Item', slice_url(:new_databag_databag_item, :databag_id => @databag_name))
3
+ %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', url(:databags))
4
+ %li{ :class => (active == 'create_item' ? "active" : '')}= link_to('Create Item', url(:new_databag_databag_item, :databag_id => @databag_name))
5
5
  - if active != 'create' && active != 'index'
6
- %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:databag, :id => params[:id]))
7
- %li= link_to('Delete', slice_url(:databag, :id => params[:id]), :method => "delete", :confirm => "Really delete Databag #{params[:id]}? There is no undo.")
6
+ %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', url(:databag, :id => params[:id]))
7
+ %li= link_to('Delete', url(:databag, :id => params[:id]), :method => "delete", :confirm => "Really delete Databag #{params[:id]}? There is no undo.")
8
8
  .clear
@@ -1,9 +1,9 @@
1
1
  .secondary-navigation
2
2
  %ul
3
- %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:databags))
4
- %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', slice_url(:new_databag))
3
+ %li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', url(:databags))
4
+ %li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', url(:new_databag))
5
5
  - if active != 'create' && active != 'index'
6
- %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:databag, @databag_name))
7
- %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', slice_url(:edit_databag, @databag_name))
8
- %li= link_to('Delete', slice_url(:databag, @databag_name), :method => "delete", :confirm => "Really delete Databag #{@databag_name}? There is no undo.")
6
+ %li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', url(:databag, @databag_name))
7
+ %li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', url(:edit_databag, @databag_name))
8
+ %li= link_to('Delete', url(:databag, @databag_name), :method => "delete", :confirm => "Really delete Databag #{@databag_name}? There is no undo.")
9
9
  .clear
@@ -3,4 +3,4 @@
3
3
  %h2.title= "Databag: #{params[:id]}"
4
4
  .inner
5
5
  = partial('navigation', :active => 'edit')
6
- = partial('form', :header => "Edit Databag", :form_id => 'edit_databag', :submit_name => "Edit Databag", :submit_id => "edit_databag_button", :form_for => 'edit', :form_url => slice_url(:databag, :databag_id=>params[:id]))
6
+ = partial('form', :header => "Edit Databag", :form_id => 'edit_databag', :submit_name => "Edit Databag", :submit_id => "edit_databag_button", :form_for => 'edit', :form_url => url(:databag, :databag_id=>params[:id]))
@@ -12,8 +12,8 @@
12
12
  %th.last &nbsp;
13
13
  - @databags.sort.each_with_index do |databag, index|
14
14
  %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
15
- %td{:colspan => 2}= link_to databag[0], slice_url(:databag, { :id => databag[0] })
15
+ %td{:colspan => 2}= link_to databag[0], url(:databag, { :id => databag[0] })
16
16
  %td
17
- = link_to('Edit', slice_url(:databag, :id => databag[0]))
17
+ = link_to('Edit', url(:databag, :id => databag[0]))
18
18
  |
19
- = link_to('Delete', slice_url(:databag, :id => databag[0]), :method => "delete", :confirm => "Really delete Databag #{databag[0]}? There is no undo.")
19
+ = link_to('Delete', url(:databag, :id => databag[0]), :method => "delete", :confirm => "Really delete Databag #{databag[0]}? There is no undo.")
@@ -3,4 +3,4 @@
3
3
  %h2.title= "Databag"
4
4
  .inner
5
5
  = partial('navigation', :active => 'create')
6
- = partial('form', :header => "Create new Databag", :form_id => 'create_databag', :submit_name => "Create Databag", :submit_id => "create_databag_button", :form_for => 'create', :form_url => slice_url(:databags))
6
+ = partial('form', :header => "Create new Databag", :form_id => 'create_databag', :submit_name => "Create Databag", :submit_id => "create_databag_button", :form_for => 'create', :form_url => url(:databags))
@@ -12,8 +12,8 @@
12
12
  %th.last &nbsp;
13
13
  - @databag.sort.each_with_index do |databag_item_uri, index|
14
14
  %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
15
- %td{:colspan => 2}= link_to databag_item_uri[0], slice_url(:databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name)
15
+ %td{:colspan => 2}= link_to databag_item_uri[0], url(:databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name)
16
16
  %td
17
- = link_to('Edit', slice_url(:edit_databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name))
17
+ = link_to('Edit', url(:edit_databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name))
18
18
  |
19
- = link_to('Delete', slice_url(:databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name), :method => "delete", :confirm => "Really delete Databag Item #{databag_item_uri[0]}? There is no undo.")
19
+ = link_to('Delete', url(:databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name), :method => "delete", :confirm => "Really delete Databag Item #{databag_item_uri[0]}? There is no undo.")