foreman_datacenter 0.1.21 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_datacenter/comments_controller.rb +13 -0
- data/app/views/foreman_datacenter/comments/index.html.erb +9 -0
- data/config/routes.rb +1 -1
- data/lib/foreman_datacenter/version.rb +1 -1
- metadata +3 -3
- data/app/views/foreman_datacenter/comments/create.html.erb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8cbf1af42ecb4278006e44d188d26cbdde7b3c0
|
4
|
+
data.tar.gz: 4e4b3bc907c81018b0a168a4ae6581db8cf3957e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a393b0b0321059abf6bd5f33e631570ebabe65c2c073f176b1e863a9e4dffcb3972e1e3381ebe7a8313eb886e0e321eaa06b76733874fe34a31e1ed6103d14e2
|
7
|
+
data.tar.gz: 597273f4e8b4c34648229f53a417fa0445aaa4b56daac5ca6f3db6390eb7859bbc55b827447713a1723e001d4a8ff21f0c49d9301e6a1dd3ad292dbe29ac1812
|
@@ -1,5 +1,11 @@
|
|
1
1
|
module ForemanDatacenter
|
2
2
|
class CommentsController < ApplicationController
|
3
|
+
before_filter :load_commentable
|
4
|
+
|
5
|
+
def index
|
6
|
+
@comments = @commentable.comments
|
7
|
+
end
|
8
|
+
|
3
9
|
def new
|
4
10
|
end
|
5
11
|
|
@@ -14,5 +20,12 @@ module ForemanDatacenter
|
|
14
20
|
|
15
21
|
def destroy
|
16
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def load_commentable
|
26
|
+
resource, id = request.path.split('/')[2, 3]
|
27
|
+
@commentable = "foreman_datacenter::#{resource.capitalize}".singularize.classify.constantize.find(id)
|
28
|
+
end
|
29
|
+
|
17
30
|
end
|
18
31
|
end
|
data/config/routes.rb
CHANGED
@@ -83,7 +83,7 @@ Foreman::Application.routes.draw do
|
|
83
83
|
resources :management_devices, only: [:new, :create, :edit, :update, :destroy],
|
84
84
|
shallow: true
|
85
85
|
|
86
|
-
resources :comments, except: [:show
|
86
|
+
resources :comments, except: [:show]
|
87
87
|
end
|
88
88
|
resources :device_interface_connections, only: [:index], path: 'connections' do
|
89
89
|
get :interfaces, on: :collection
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_datacenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Ivanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -176,8 +176,8 @@ files:
|
|
176
176
|
- app/models/foreman_datacenter/rack.rb
|
177
177
|
- app/models/foreman_datacenter/rack_group.rb
|
178
178
|
- app/models/foreman_datacenter/site.rb
|
179
|
-
- app/views/foreman_datacenter/comments/create.html.erb
|
180
179
|
- app/views/foreman_datacenter/comments/edit.html.erb
|
180
|
+
- app/views/foreman_datacenter/comments/index.html.erb
|
181
181
|
- app/views/foreman_datacenter/comments/new.html.erb
|
182
182
|
- app/views/foreman_datacenter/console_port_templates/_form.html.erb
|
183
183
|
- app/views/foreman_datacenter/console_port_templates/new.html.erb
|