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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d23d2edbef5ef4c2d706aed6b9670db66913f3ff
4
- data.tar.gz: be91ece30c875751efa733804433645774846803
3
+ metadata.gz: f8cbf1af42ecb4278006e44d188d26cbdde7b3c0
4
+ data.tar.gz: 4e4b3bc907c81018b0a168a4ae6581db8cf3957e
5
5
  SHA512:
6
- metadata.gz: dae5a6cb17c88b146a51fc67eebc8c4057645463a84fc679fc92fd1beb755f10e270af89143e1e36d4ec9b51692d96aadf0c39a2862013b8b989144721df4481
7
- data.tar.gz: 557ad82fa7fb392bf265d9b94b5ba3be74bc8882ae303bb7691e23cf34b48e81f488bf95676588d96eb9fb7ae1cf816152f29ea6818a4cf0dc94128cdbb907e6
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
@@ -0,0 +1,9 @@
1
+ <h1>Comments for device <%= @commentable_type %> #<%= @commentable.id %></h1>
2
+
3
+ <% @comments.each do |c| %>
4
+ <%= c.content %>
5
+ </br>
6
+ </hr>
7
+ <% end %>
8
+
9
+
@@ -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, :index]
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
@@ -1,3 +1,3 @@
1
1
  module ForemanDatacenter
2
- VERSION = '0.1.21'.freeze
2
+ VERSION = '0.1.22'.freeze
3
3
  end
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.21
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-23 00:00:00.000000000 Z
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
@@ -1,2 +0,0 @@
1
- <h1>Comments#create</h1>
2
- <p>Find me in app/views/comments/create.html.erb</p>