foreman_datacenter 0.1.14 → 0.1.15

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: f2635b9749edcbb7f851c930b1a98ee55e08e7cc
4
- data.tar.gz: 213d3c51deb8379ebeae9a6cc91c949247bb52ca
3
+ metadata.gz: e9a5390f350683b404c37dd3de63f80cb49eb114
4
+ data.tar.gz: c82a570e7156edb3fb5d65f0a5ce3ffd5be15253
5
5
  SHA512:
6
- metadata.gz: b4bc37e022fc70353fc20446f8aeec1cc1b0eef16e099f30a540eb0be8a475fabf275b9d2224fd75ad6a5d259366b644b9e9ab224d6bb5f17280d19612a39fea
7
- data.tar.gz: 257dadcfcc6d14328b7d3f992fdc42bdd88aac4fcde1765c10d6a7c2df31c7290d4761b184ceef992ad20662b6c4a3c4900dc1d9672ed736ae7bf32e5ea23b20
6
+ metadata.gz: 6cfb19e9e727e3db78470ba625a764c6a4f8f637651be226232e327ed29de750cb9cf5a88b6a80273f370ef036bb1d18ff45b35efb6d8176bfc5228778a7b846
7
+ data.tar.gz: c4f9dd9c0b58508245ba2f7a833192159f50c0044e9edb44a18c6e8984851d53eaefdb5ab7e45d024bdb5cfbcbee42ee4647facc53db2f52401c81bdb6ec6046
@@ -11,7 +11,7 @@ module ForemanDatacenter
11
11
  validates_numericality_of :height, only_integer: true
12
12
 
13
13
  def device_at(position)
14
- devices.find { |d| d.position == position }
14
+ devices.where(position: position).to_a
15
15
  end
16
16
 
17
17
  def positioned_devices
@@ -0,0 +1,28 @@
1
+ <div class="col-md-5">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading"><strong>Devices</strong></div>
4
+ <table class="table table-hover panel-body">
5
+ <tbody>
6
+ <% @rack.positioned_devices.each do |position, devices| %>
7
+ <tr>
8
+ <td class="col-md-1"><%= position %>U</td>
9
+ <td class="col-md-4">
10
+ <% unless devices.empty? %>
11
+ <% devices.each do |d| %>
12
+ <div class="<%= "text-" + ((d.side == "full" or d.side.nil?) ? "center" : "right") + " pull-" + ((d.side == "full" or d.side.nil?) ? "center" : d.side) %>">
13
+ <%= link_to d.name, device_path(d) %>
14
+ <% if d.side.nil? %>
15
+ *
16
+ <% end %>
17
+ </div>
18
+ <% end %>
19
+ <% end %>
20
+ </td>
21
+ </tr>
22
+ <% end %>
23
+ </tbody>
24
+ </table>
25
+ </div>
26
+ <div><h6 class="text-right">* side is not defined</h6></div>
27
+ </div>
28
+
@@ -67,23 +67,7 @@
67
67
  </div>
68
68
  </div>
69
69
 
70
- <div class="col-md-4">
71
- <div class="panel panel-default">
72
- <div class="panel-heading"><strong>Devices</strong></div>
73
- <table class="table table-hover panel-body">
74
- <tbody>
75
- <% @rack.positioned_devices.each do |position, device| %>
76
- <tr>
77
- <td><%= position %>U</td>
78
- <td class="text-right">
79
- <% if device %>
80
- <%= link_to device.name, device_path(device) %>
81
- <% end %>
82
- </td>
83
- </tr>
84
- <% end %>
85
- </tbody>
86
- </table>
87
- </div>
88
- </div>
70
+ <!-- Devices -->
71
+ <%= render "device_position", rack: @rack %>
72
+
89
73
  </div>
@@ -1,3 +1,3 @@
1
1
  module ForemanDatacenter
2
- VERSION = '0.1.14'.freeze
2
+ VERSION = '0.1.15'.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.14
4
+ version: 0.1.15
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-08-27 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -271,6 +271,7 @@ files:
271
271
  - app/views/foreman_datacenter/rack_groups/index.html.erb
272
272
  - app/views/foreman_datacenter/rack_groups/new.html.erb
273
273
  - app/views/foreman_datacenter/rack_groups/show.html.erb
274
+ - app/views/foreman_datacenter/racks/_device_position.html.erb
274
275
  - app/views/foreman_datacenter/racks/_form.html.erb
275
276
  - app/views/foreman_datacenter/racks/_rack_groups.html.erb
276
277
  - app/views/foreman_datacenter/racks/edit.html.erb