chef-server-webui 0.9.18 → 0.10.0.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +0 -4
- data/Rakefile +10 -0
- data/app/controllers/application.rb +34 -6
- data/app/controllers/cookbooks.rb +125 -35
- data/app/controllers/environments.rb +235 -0
- data/app/controllers/nodes.rb +26 -19
- data/app/controllers/roles.rb +37 -44
- data/app/controllers/search.rb +13 -13
- data/app/helpers/application_helper.rb +34 -0
- data/app/views/cookbooks/_cookbook_content.html.haml +7 -0
- data/app/views/cookbooks/index.html.haml +22 -7
- data/app/views/cookbooks/show.html.haml +8 -50
- data/app/views/environments/_form.html.erb +91 -0
- data/app/views/environments/_navigation.html.haml +9 -0
- data/app/views/environments/_version_selector.html.erb +8 -0
- data/app/views/environments/edit.html.erb +17 -0
- data/app/views/environments/index.html.haml +26 -0
- data/app/views/environments/new.html.erb +17 -0
- data/app/views/environments/show.html.haml +31 -0
- data/app/views/layout/application.html.haml +22 -13
- data/app/views/layout/login.html.haml +2 -2
- data/app/views/nodes/_form.html.erb +69 -0
- data/app/views/nodes/index.html.haml +6 -2
- data/app/views/nodes/show.html.haml +4 -1
- data/app/views/roles/_form.html.erb +92 -0
- data/app/views/roles/_run_lists.html.erb +26 -0
- data/app/views/roles/edit.html.haml +1 -1
- data/app/views/roles/new.html.haml +1 -1
- data/app/views/roles/show.html.haml +10 -7
- data/app/views/status/index.html.haml +2 -1
- data/bin/chef-server-webui +1 -0
- data/config/router.rb +14 -8
- data/lib/chef-server-webui/version.rb +1 -1
- data/public/javascripts/chef.js +206 -49
- data/public/javascripts/cookbook_constraint_ctrl.js +191 -0
- data/public/javascripts/cookbook_versions.js +75 -0
- data/public/javascripts/jquery-1.4.4.min.js +167 -0
- data/public/javascripts/jquery.suggest.js +250 -0
- data/public/stylesheets/base.css +30 -24
- data/public/stylesheets/chef.css +212 -45
- data/public/stylesheets/jquery.suggest.css +28 -0
- data/public/stylesheets/jsonedit_main.css +26 -10
- data/public/stylesheets/themes/djime-cerulean/style.css +31 -18
- metadata +22 -29
- data/app/controllers/cookbook_attributes.rb +0 -41
- data/app/controllers/cookbook_definitions.rb +0 -41
- data/app/controllers/cookbook_files.rb +0 -39
- data/app/controllers/cookbook_libraries.rb +0 -41
- data/app/controllers/cookbook_recipes.rb +0 -40
- data/app/controllers/cookbook_templates.rb +0 -57
- data/app/helpers/cookbook_attributes_helper.rb +0 -7
- data/app/helpers/cookbook_definitions_helper.rb +0 -8
- data/app/helpers/cookbook_files_helper.rb +0 -8
- data/app/helpers/cookbook_libraries_helper.rb +0 -7
- data/app/helpers/cookbook_recipes_helper.rb +0 -8
- data/app/helpers/cookbook_templates_helper.rb +0 -8
- data/app/helpers/exceptions_helper.rb +0 -6
- data/app/helpers/global_helpers.rb +0 -39
- data/app/helpers/nodes_helper.rb +0 -43
- data/app/helpers/openid_consumer_helper.rb +0 -8
- data/app/helpers/openid_register_helper.rb +0 -8
- data/app/helpers/openid_server_helper.rb +0 -6
- data/app/helpers/openid_server_helpers.rb +0 -32
- data/app/helpers/roles_helper.rb +0 -5
- data/app/helpers/search_entries_helper.rb +0 -8
- data/app/helpers/search_helper.rb +0 -44
- data/app/views/nodes/_form.html.haml +0 -52
- data/app/views/roles/_form.html.haml +0 -52
data/app/controllers/nodes.rb
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
9
|
# you may not use this file except in compliance with the License.
|
10
10
|
# You may obtain a copy of the License at
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
13
|
+
#
|
14
14
|
# Unless required by applicable law or agreed to in writing, software
|
15
15
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
16
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -21,17 +21,19 @@
|
|
21
21
|
require 'chef/node'
|
22
22
|
|
23
23
|
class Nodes < Application
|
24
|
-
|
24
|
+
|
25
25
|
provides :html
|
26
|
-
|
26
|
+
|
27
27
|
before :login_required
|
28
28
|
before :require_admin, :only => [:destroy]
|
29
|
-
|
29
|
+
|
30
30
|
def index
|
31
31
|
begin
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
if session[:environment]
|
33
|
+
node_hash = Chef::Node.list_by_environment(session[:environment])
|
34
|
+
else
|
35
|
+
node_hash = Chef::Node.list
|
36
|
+
end
|
35
37
|
@node_list = node_hash.keys.sort
|
36
38
|
rescue => e
|
37
39
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
@@ -42,35 +44,38 @@ class Nodes < Application
|
|
42
44
|
end
|
43
45
|
|
44
46
|
def show
|
45
|
-
begin
|
47
|
+
begin
|
46
48
|
@node =Chef::Node.load(params[:id])
|
47
49
|
rescue => e
|
48
50
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
49
51
|
@_message = {:error => "Could not load node #{params[:id]}"}
|
50
52
|
@node = Chef::Node.new
|
51
|
-
end
|
53
|
+
end
|
52
54
|
render
|
53
55
|
end
|
54
56
|
|
55
57
|
def new
|
56
58
|
begin
|
57
59
|
@node = Chef::Node.new
|
58
|
-
@
|
60
|
+
@node.chef_environment(session[:environment] || "_default")
|
61
|
+
@available_recipes = list_available_recipes_for(@node.chef_environment)
|
59
62
|
@available_roles = Chef::Role.list.keys.sort
|
60
63
|
@run_list = @node.run_list
|
64
|
+
@env = session[:environment]
|
61
65
|
render
|
62
66
|
rescue => e
|
63
67
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
64
68
|
@node_list = Chef::Node.list()
|
65
69
|
@_message = {:error => "Could not load available recipes, roles, or the run list"}
|
66
70
|
render :index
|
67
|
-
end
|
71
|
+
end
|
68
72
|
end
|
69
73
|
|
70
74
|
def edit
|
71
75
|
begin
|
72
76
|
@node = Chef::Node.load(params[:id])
|
73
|
-
@
|
77
|
+
@env = @node.chef_environment
|
78
|
+
@available_recipes = list_available_recipes_for(@node.chef_environment)
|
74
79
|
@available_roles = Chef::Role.list.keys.sort
|
75
80
|
@run_list = @node.run_list
|
76
81
|
render
|
@@ -82,13 +87,14 @@ class Nodes < Application
|
|
82
87
|
@run_list = []
|
83
88
|
@_message = {:error => "Could not load node #{params[:id]}"}
|
84
89
|
render
|
85
|
-
end
|
90
|
+
end
|
86
91
|
end
|
87
92
|
|
88
93
|
def create
|
89
|
-
begin
|
94
|
+
begin
|
90
95
|
@node = Chef::Node.new
|
91
96
|
@node.name params[:name]
|
97
|
+
@node.chef_environment params[:chef_environment]
|
92
98
|
@node.normal_attrs = Chef::JSONCompat.from_json(params[:attributes])
|
93
99
|
@node.run_list.reset!(params[:for_node] ? params[:for_node] : [])
|
94
100
|
raise ArgumentError, "Node name cannot be blank" if (params[:name].nil? || params[:name].length==0)
|
@@ -97,7 +103,7 @@ class Nodes < Application
|
|
97
103
|
rescue => e
|
98
104
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
99
105
|
@node.normal_attrs = Chef::JSONCompat.from_json(params[:attributes])
|
100
|
-
@available_recipes =
|
106
|
+
@available_recipes = list_available_recipes_for(@node.chef_environment)
|
101
107
|
@available_roles = Chef::Role.list.keys.sort
|
102
108
|
@node.run_list params[:for_node]
|
103
109
|
@run_list = @node.run_list
|
@@ -109,6 +115,7 @@ class Nodes < Application
|
|
109
115
|
def update
|
110
116
|
begin
|
111
117
|
@node = Chef::Node.load(params[:id])
|
118
|
+
@node.chef_environment(params[:chef_environment])
|
112
119
|
@node.run_list.reset!(params[:for_node] ? params[:for_node] : [])
|
113
120
|
@node.normal_attrs = Chef::JSONCompat.from_json(params[:attributes])
|
114
121
|
@node.save
|
@@ -116,7 +123,7 @@ class Nodes < Application
|
|
116
123
|
render :show
|
117
124
|
rescue => e
|
118
125
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
119
|
-
@available_recipes =
|
126
|
+
@available_recipes = list_available_recipes_for(@node.chef_environment)
|
120
127
|
@available_roles = Chef::Role.list.keys.sort
|
121
128
|
@run_list = Chef::RunList.new
|
122
129
|
@run_list.reset!(params[:for_node])
|
@@ -135,7 +142,7 @@ class Nodes < Application
|
|
135
142
|
@node_list = Chef::Node.list()
|
136
143
|
@_message = {:error => "Could not delete the node"}
|
137
144
|
render :index
|
138
|
-
end
|
145
|
+
end
|
139
146
|
end
|
140
|
-
|
147
|
+
|
141
148
|
end
|
data/app/controllers/roles.rb
CHANGED
@@ -7,9 +7,9 @@
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
# you may not use this file except in compliance with the License.
|
9
9
|
# You may obtain a copy of the License at
|
10
|
-
#
|
10
|
+
#
|
11
11
|
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
12
|
+
#
|
13
13
|
# Unless required by applicable law or agreed to in writing, software
|
14
14
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
15
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -24,7 +24,7 @@ class Roles < Application
|
|
24
24
|
provides :html
|
25
25
|
before :login_required
|
26
26
|
before :require_admin, :only => [:destroy]
|
27
|
-
|
27
|
+
|
28
28
|
# GET /roles
|
29
29
|
def index
|
30
30
|
@role_list = begin
|
@@ -33,7 +33,7 @@ class Roles < Application
|
|
33
33
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
34
34
|
@_message = {:error => "Could not list roles"}
|
35
35
|
{}
|
36
|
-
end
|
36
|
+
end
|
37
37
|
render
|
38
38
|
end
|
39
39
|
|
@@ -43,44 +43,54 @@ class Roles < Application
|
|
43
43
|
Chef::Role.load(params[:id])
|
44
44
|
rescue => e
|
45
45
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
46
|
-
@_message = {:error => "Could not load role #{params[:id]}"}
|
46
|
+
@_message = {:error => "Could not load role #{params[:id]}."}
|
47
47
|
Chef::Role.new
|
48
|
-
end
|
48
|
+
end
|
49
|
+
|
50
|
+
@current_env = session[:environment] || "_default"
|
51
|
+
@env_run_list_exists = @role.env_run_lists.has_key?(@current_env)
|
52
|
+
@run_list = @role.run_list_for(@current_env)
|
53
|
+
@recipes = @run_list.expand(@current_env, 'server').recipes
|
49
54
|
render
|
50
55
|
end
|
51
56
|
|
52
57
|
# GET /roles/new
|
53
58
|
def new
|
54
59
|
begin
|
55
|
-
@available_recipes = get_available_recipes
|
56
60
|
@role = Chef::Role.new
|
57
61
|
@available_roles = Chef::Role.list.keys.sort
|
58
|
-
@
|
62
|
+
@environments = Chef::Environment.list.keys.sort
|
63
|
+
@run_lists = @environments.inject({}) { |run_lists, env| run_lists[env] = @role.env_run_lists[env]; run_lists}
|
64
|
+
@current_env = "_default"
|
65
|
+
@available_recipes = list_available_recipes_for(@current_env)
|
66
|
+
@existing_run_list_environments = @role.env_run_lists.keys
|
67
|
+
# merb select helper has no :include_blank => true, so fix the view in the controller.
|
68
|
+
@existing_run_list_environments.unshift('')
|
59
69
|
render
|
60
70
|
rescue => e
|
61
71
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
62
|
-
|
63
|
-
|
64
|
-
render :index
|
65
|
-
end
|
72
|
+
redirect url(:roles), :message => {:error => "Could not load available recipes, roles, or the run list."}
|
73
|
+
end
|
66
74
|
end
|
67
75
|
|
68
76
|
# GET /roles/:id/edit
|
69
77
|
def edit
|
70
78
|
begin
|
71
79
|
@role = Chef::Role.load(params[:id])
|
72
|
-
@available_recipes = get_available_recipes
|
73
80
|
@available_roles = Chef::Role.list.keys.sort
|
81
|
+
@environments = Chef::Environment.list.keys.sort
|
82
|
+
@current_env = session[:environment] || "_default"
|
74
83
|
@run_list = @role.run_list
|
84
|
+
@run_lists = @environments.inject({}) { |run_lists, env| run_lists[env] = @role.env_run_lists[env]; run_lists}
|
85
|
+
@existing_run_list_environments = @role.env_run_lists.keys
|
86
|
+
# merb select helper has no :include_blank => true, so fix the view in the controller.
|
87
|
+
@existing_run_list_environments.unshift('')
|
88
|
+
@available_recipes = list_available_recipes_for(@current_env)
|
89
|
+
render
|
75
90
|
rescue => e
|
76
91
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
77
|
-
|
78
|
-
|
79
|
-
@available_roles = []
|
80
|
-
@run_list = []
|
81
|
-
@_message = {:error => "Could not load role #{params[:id]}, the available recipes, roles, or the run list"}
|
82
|
-
end
|
83
|
-
render
|
92
|
+
redirect url(:roles), :message => {:error => "Could not load role #{params[:id]}. #{e.message}"}
|
93
|
+
end
|
84
94
|
end
|
85
95
|
|
86
96
|
# POST /roles
|
@@ -88,7 +98,7 @@ class Roles < Application
|
|
88
98
|
begin
|
89
99
|
@role = Chef::Role.new
|
90
100
|
@role.name(params[:name])
|
91
|
-
@role.
|
101
|
+
@role.env_run_lists(params[:env_run_lists])
|
92
102
|
@role.description(params[:description]) if params[:description] != ''
|
93
103
|
@role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
|
94
104
|
@role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
|
@@ -96,14 +106,7 @@ class Roles < Application
|
|
96
106
|
redirect(url(:roles), :message => { :notice => "Created Role #{@role.name}" })
|
97
107
|
rescue => e
|
98
108
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
99
|
-
|
100
|
-
@available_roles = Chef::Role.list.keys.sort
|
101
|
-
@role = Chef::Role.new
|
102
|
-
@role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
|
103
|
-
@role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
|
104
|
-
@run_list = Chef::RunList.new.reset!(Array(params[:for_role]))
|
105
|
-
@_message = { :error => "Could not create role" }
|
106
|
-
render :new
|
109
|
+
redirect(url(:new_role), :message => { :error => "Could not create role. #{e.message}" })
|
107
110
|
end
|
108
111
|
end
|
109
112
|
|
@@ -111,23 +114,15 @@ class Roles < Application
|
|
111
114
|
def update
|
112
115
|
begin
|
113
116
|
@role = Chef::Role.load(params[:id])
|
114
|
-
@role.
|
117
|
+
@role.env_run_lists(params[:env_run_lists])
|
115
118
|
@role.description(params[:description]) if params[:description] != ''
|
116
119
|
@role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
|
117
120
|
@role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
|
118
121
|
@role.save
|
119
|
-
|
120
|
-
render :show
|
122
|
+
redirect(url(:role, params[:id]), :message => { :notice => "Updated Role" })
|
121
123
|
rescue => e
|
122
124
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
123
|
-
|
124
|
-
@available_roles = Chef::Role.list.keys.sort
|
125
|
-
@run_list = Chef::RunList.new.reset!( Array(params[:for_role]))
|
126
|
-
Chef::Log.error(@run_list.inspect)
|
127
|
-
@role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
|
128
|
-
@role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
|
129
|
-
@_message = {:error => "Could not update role #{params[:id]}"}
|
130
|
-
render :edit
|
125
|
+
redirect url(:edit_role, params[:id]), :message => {:error => "Could not update role #{params[:id]}. #{e.message}"}
|
131
126
|
end
|
132
127
|
end
|
133
128
|
|
@@ -139,10 +134,8 @@ class Roles < Application
|
|
139
134
|
redirect(absolute_url(:roles), :message => { :notice => "Role #{@role.name} deleted successfully." }, :permanent => true)
|
140
135
|
rescue => e
|
141
136
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
142
|
-
|
143
|
-
|
144
|
-
render :index
|
145
|
-
end
|
137
|
+
redirect url(:roles), :message => {:error => "Could not delete role #{params[:id]}"}
|
138
|
+
end
|
146
139
|
end
|
147
140
|
|
148
141
|
end
|
data/app/controllers/search.rb
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
14
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -19,10 +19,10 @@
|
|
19
19
|
require 'chef' / 'search' / 'query'
|
20
20
|
|
21
21
|
class Search < Application
|
22
|
-
|
22
|
+
|
23
23
|
provides :html
|
24
|
-
before :login_required
|
25
|
-
|
24
|
+
before :login_required
|
25
|
+
|
26
26
|
def index
|
27
27
|
@s = Chef::Search::Query.new
|
28
28
|
@search_indexes = begin
|
@@ -31,20 +31,20 @@ class Search < Application
|
|
31
31
|
Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
|
32
32
|
@_message = {:error => "Could not list search indexes"}
|
33
33
|
{}
|
34
|
-
end
|
34
|
+
end
|
35
35
|
render
|
36
36
|
end
|
37
37
|
|
38
38
|
def show
|
39
39
|
begin
|
40
40
|
@s = Chef::Search::Query.new
|
41
|
-
query = params[:q].nil?
|
42
|
-
@results = @s.search(params[:id], query)
|
41
|
+
query = (params[:q].nil? || params[:q].empty?) ? "*:*" : URI.escape(params[:q], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
|
42
|
+
@results = @s.search(params[:id], query)
|
43
43
|
@type = if params[:id].to_s == "node" || params[:id].to_s == "role" || params[:id].to_s == "client"
|
44
44
|
params[:id]
|
45
|
-
else
|
46
|
-
"databag"
|
47
|
-
end
|
45
|
+
else
|
46
|
+
"databag"
|
47
|
+
end
|
48
48
|
@results = @results - @results.last(2)
|
49
49
|
@results.each do |result|
|
50
50
|
result.delete(nil)
|
@@ -56,7 +56,7 @@ class Search < Application
|
|
56
56
|
@_message = { :error => "Unable to find the #{params[:id]}. (#{$!})" }
|
57
57
|
@search_indexes = @s.list_indexes
|
58
58
|
render :index
|
59
|
-
end
|
59
|
+
end
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
end
|
@@ -4,9 +4,43 @@ require 'chef-server-webui/version'
|
|
4
4
|
module Merb
|
5
5
|
module ApplicationHelper
|
6
6
|
|
7
|
+
ROLE_STR = "role"
|
8
|
+
RECIPE_STR = "recipe"
|
9
|
+
|
10
|
+
|
7
11
|
def chef_version
|
8
12
|
::ChefServerWebui::VERSION
|
9
13
|
end
|
10
14
|
|
15
|
+
def class_for_run_list_item(item)
|
16
|
+
case item.type.to_s
|
17
|
+
when ROLE_STR
|
18
|
+
'ui-state-highlight'
|
19
|
+
when RECIPE_STR
|
20
|
+
'ui-state-default'
|
21
|
+
else
|
22
|
+
raise ArgumentError, "Cannot generate UI class for #{item.inspect}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def display_run_list_item(item)
|
27
|
+
case item.type.to_s
|
28
|
+
when ROLE_STR
|
29
|
+
item.name
|
30
|
+
when RECIPE_STR
|
31
|
+
# webui not sophisticated enough for versioned recipes
|
32
|
+
# "#{item.name}@#{item.version}"
|
33
|
+
item.name
|
34
|
+
else
|
35
|
+
raise ArgumentError, "can't generate display string for #{item.inspect}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def nav_link_item(title, dest)
|
40
|
+
name = title.gsub(/ /, "").downcase
|
41
|
+
klass = controller_name == name ? 'class="active"' : ""
|
42
|
+
link = link_to(title, url(dest))
|
43
|
+
"<li #{klass}>#{link}</li>"
|
44
|
+
end
|
11
45
|
end
|
12
46
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
- unless @manifest[cookbook_part].empty?
|
2
|
+
%h4.head= link_to(cookbook_part, "JavaScript:void(0);")
|
3
|
+
.files
|
4
|
+
- @manifest[cookbook_part].each do |f|
|
5
|
+
.head= link_to(File.basename(f["name"]), "JavaScript:void(0);")
|
6
|
+
.code
|
7
|
+
%pre.ruby= highlight_content(f["url"], type)
|
@@ -1,12 +1,27 @@
|
|
1
1
|
.block#block-tables
|
2
2
|
.content
|
3
|
-
%h2.title
|
3
|
+
%h2.title
|
4
|
+
Cookbooks
|
4
5
|
.inner
|
5
|
-
%table.table
|
6
|
+
%table.table#cookbook_version_table
|
6
7
|
%thead
|
7
8
|
%tr
|
8
|
-
%th
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
%th Cookbook
|
10
|
+
%th Latest Version
|
11
|
+
%th Other Versions
|
12
|
+
%tbody.cookbook_versions
|
13
|
+
- @cl.keys.sort.each do |cookbook|
|
14
|
+
- versions = @cl[cookbook]
|
15
|
+
%tr
|
16
|
+
%td= cookbook
|
17
|
+
%td
|
18
|
+
%ul.cookbook_versions{ :id => "#{cookbook}_versions" }
|
19
|
+
- versions[0..4].each_with_index do |v, i|
|
20
|
+
- klass = i > 0 ? "other_version" : "latest_version"
|
21
|
+
%li{ :class => klass }
|
22
|
+
= link_to(v["version"], v["url"])
|
23
|
+
- if versions.length > 5
|
24
|
+
= all_versions_link(cookbook)
|
25
|
+
%td.show_more
|
26
|
+
= versions.length > 1 ? more_versions_link(cookbook) : ""
|
27
|
+
= js_include_tag "cookbook_versions"
|
@@ -1,56 +1,14 @@
|
|
1
|
-
%script{:type=>"text/javascript", :src => "/javascripts/drop_down_menu.js"}
|
2
1
|
.block#block-text
|
3
2
|
.content
|
4
3
|
%h2
|
5
4
|
.title
|
6
|
-
= "
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
%option{:value =>
|
11
|
-
|
12
|
-
%option{:value => url(:show_specific_version_cookbook, :cookbook_id => @cookbook_id, :cb_version => v)} "#{v}"
|
5
|
+
= "#{@cookbook_id}"
|
6
|
+
%select{:name => "choice", :onchange => "jump(this)", :size => "1"}
|
7
|
+
- @versions.each do |version|
|
8
|
+
- selected = @version == version
|
9
|
+
%option{:value => cookbook_link(version), :selected => selected }
|
10
|
+
= version
|
13
11
|
.inner
|
14
12
|
.accordion
|
15
|
-
-
|
16
|
-
|
17
|
-
.files
|
18
|
-
- @manifest["libraries"].each do |f|
|
19
|
-
.code
|
20
|
-
%h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
|
21
|
-
%pre.ruby= syntax_highlight(f["url"])
|
22
|
-
- unless @manifest["attributes"].empty?
|
23
|
-
%h2.head= link_to "Attribute Files", "JavaScript:void(0);"
|
24
|
-
.files
|
25
|
-
- @manifest["attributes"].each do |f|
|
26
|
-
.code
|
27
|
-
%h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
|
28
|
-
%pre.ruby= syntax_highlight(f["url"])
|
29
|
-
- unless @manifest["definitions"].empty?
|
30
|
-
%h2.head= link_to "Definition Files", "JavaScript:void(0);"
|
31
|
-
.files
|
32
|
-
- @manifest["definitions"].each do |f|
|
33
|
-
.code
|
34
|
-
%h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
|
35
|
-
%pre.ruby= syntax_highlight(f["url"])
|
36
|
-
- unless @manifest["recipes"].empty?
|
37
|
-
%h2.head= link_to "Recipe Files", "JavaScript:void(0);"
|
38
|
-
.files
|
39
|
-
- @manifest["recipes"].each do |f|
|
40
|
-
.code
|
41
|
-
%h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
|
42
|
-
%pre.ruby= syntax_highlight(f["url"])
|
43
|
-
- unless @manifest["templates"].empty?
|
44
|
-
%h2.head= link_to "Template Files", "JavaScript:void(0);"
|
45
|
-
.files
|
46
|
-
- @manifest["templates"].each do |f|
|
47
|
-
.code
|
48
|
-
%h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
|
49
|
-
%pre.ruby= syntax_highlight(f["url"])
|
50
|
-
- unless @manifest["files"].empty?
|
51
|
-
%h2.head= link_to "Cookbook Files", "JavaScript:void(0);"
|
52
|
-
.files
|
53
|
-
- @manifest["files"].each do |f|
|
54
|
-
.code
|
55
|
-
%h4.head= link_to File.basename(f["name"]), "JavaScript:void(0);"
|
56
|
-
%pre= show_plain_file(f["url"])
|
13
|
+
- cookbook_parts.each do |(part, type)|
|
14
|
+
= partial('cookbook_content', :cookbook_part => part, :type => type)
|