chef-server-webui 0.8.16 → 0.9.0.a3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -10
- data/app/controllers/application.rb +111 -128
- data/app/controllers/clients.rb +10 -10
- data/app/controllers/cookbook_attributes.rb +1 -1
- data/app/controllers/cookbook_definitions.rb +1 -1
- data/app/controllers/cookbook_files.rb +1 -1
- data/app/controllers/cookbook_libraries.rb +1 -1
- data/app/controllers/cookbook_recipes.rb +1 -1
- data/app/controllers/cookbook_templates.rb +1 -1
- data/app/controllers/cookbooks.rb +21 -3
- data/app/controllers/databag_items.rb +6 -6
- data/app/controllers/databags.rb +3 -3
- data/app/controllers/main.rb +1 -1
- data/app/controllers/nodes.rb +21 -21
- data/app/controllers/openid_consumer.rb +9 -9
- data/app/controllers/roles.rb +3 -3
- data/app/controllers/search.rb +1 -1
- data/app/controllers/search_entries.rb +1 -1
- data/app/controllers/status.rb +1 -1
- data/app/controllers/users.rb +7 -7
- data/app/helpers/application_helper.rb +1 -156
- data/app/helpers/global_helpers.rb +20 -16
- data/app/helpers/nodes_helper.rb +24 -22
- data/app/helpers/openid_server_helpers.rb +13 -10
- data/app/helpers/search_helper.rb +44 -38
- data/app/helpers/status_helper.rb +10 -3
- data/app/views/clients/_navigation.html.haml +5 -5
- data/app/views/clients/edit.html.haml +1 -1
- data/app/views/clients/index.html.haml +4 -4
- data/app/views/clients/new.html.haml +1 -1
- data/app/views/cookbooks/index.html.haml +1 -1
- data/app/views/cookbooks/show.html.haml +25 -16
- data/app/views/databag_items/_form.html.haml +1 -1
- data/app/views/databag_items/_navigation.html.haml +5 -5
- data/app/views/databag_items/edit.html.haml +1 -1
- data/app/views/databag_items/new.html.haml +1 -1
- data/app/views/databags/_item_navigation.html.haml +4 -4
- data/app/views/databags/_navigation.html.haml +5 -5
- data/app/views/databags/edit.html.haml +1 -1
- data/app/views/databags/index.html.haml +3 -3
- data/app/views/databags/new.html.haml +1 -1
- data/app/views/databags/show.html.haml +3 -3
- data/app/views/layout/{chef_server_webui.html.haml → application.html.haml} +11 -11
- data/app/views/layout/login.html.haml +1 -1
- data/app/views/nodes/_form.html.haml +1 -1
- data/app/views/nodes/_navigation.html.haml +5 -5
- data/app/views/nodes/edit.html.haml +1 -1
- data/app/views/nodes/index.html.haml +6 -6
- data/app/views/nodes/new.html.haml +1 -1
- data/app/views/nodes/show.html.haml +4 -5
- data/app/views/openid_consumer/index.html.haml +2 -2
- data/app/views/openid_register/index.html.haml +4 -4
- data/app/views/openid_register/show.html.haml +1 -1
- data/app/views/roles/_form.html.haml +1 -1
- data/app/views/roles/_navigation.html.haml +5 -5
- data/app/views/roles/edit.html.haml +1 -1
- data/app/views/roles/index.html.haml +4 -4
- data/app/views/roles/new.html.haml +1 -1
- data/app/views/roles/show.html.haml +3 -4
- data/app/views/search/_search_form.html.haml +1 -1
- data/app/views/search/index.html.haml +1 -1
- data/app/views/search/show.html.haml +1 -1
- data/app/views/status/index.html.haml +9 -12
- data/app/views/users/_form.html.haml +1 -1
- data/app/views/users/_navigation.html.haml +5 -5
- data/app/views/users/edit.html.haml +1 -1
- data/app/views/users/index.html.haml +3 -3
- data/app/views/users/login.html.haml +1 -1
- data/app/views/users/new.html.haml +1 -1
- data/bin/chef-server-webui +72 -0
- data/config.ru +10 -74
- data/config/init.rb +30 -11
- data/config/rack.rb +5 -0
- data/config/router.rb +62 -5
- data/lib/chef-server-webui.rb +2 -155
- data/lib/chef-server-webui/version.rb +3 -0
- data/public/javascripts/drop_down_menu.js +22 -0
- metadata +60 -48
- data/stubs/app/controllers/application.rb +0 -2
- data/stubs/app/controllers/main.rb +0 -2
@@ -16,20 +16,24 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
module
|
20
|
-
|
19
|
+
# Possibly Dead Code. To revive it, move the GlobalHelpers module into the
|
20
|
+
# Merb namespace
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
+
#
|
data/app/helpers/nodes_helper.rb
CHANGED
@@ -17,25 +17,27 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
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
|
-
|
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
|
22
|
-
|
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',
|
4
|
-
%li{ :class => (active == 'create' ? "active" : '')}= link_to('Create',
|
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',
|
7
|
-
%li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit',
|
8
|
-
%li= link_to('Delete',
|
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 =>
|
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
|
16
|
+
%td{:colspan => 2}= link_to(client, url(:client, client))
|
17
17
|
%td
|
18
|
-
= link_to('Edit',
|
18
|
+
= link_to('Edit', url(:edit_client, client))
|
19
19
|
|
|
20
|
-
= link_to('Delete',
|
21
|
-
- even
|
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 =>
|
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))
|
@@ -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
|
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 '
|
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',
|
4
|
-
%li{ :class => (active == 'create' ? "active" : '')}= link_to('Create',
|
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',
|
7
|
-
%li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit',
|
8
|
-
%li= link_to('Delete',
|
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 =>
|
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 =>
|
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',
|
4
|
-
%li{ :class => (active == 'create_item' ? "active" : '')}= link_to('Create Item',
|
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',
|
7
|
-
%li= link_to('Delete',
|
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',
|
4
|
-
%li{ :class => (active == 'create' ? "active" : '')}= link_to('Create',
|
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',
|
7
|
-
%li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit',
|
8
|
-
%li= link_to('Delete',
|
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 =>
|
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
|
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],
|
15
|
+
%td{:colspan => 2}= link_to databag[0], url(:databag, { :id => databag[0] })
|
16
16
|
%td
|
17
|
-
= link_to('Edit',
|
17
|
+
= link_to('Edit', url(:databag, :id => databag[0]))
|
18
18
|
|
|
19
|
-
= link_to('Delete',
|
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 =>
|
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
|
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],
|
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',
|
17
|
+
= link_to('Edit', url(:edit_databag_databag_item, :id => databag_item_uri[0], :databag_id => @databag_name))
|
18
18
|
|
|
19
|
-
= link_to('Delete',
|
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.")
|