foreman_datacenter 0.1.28 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3bb886dd6e594c44644dc906e0a114d3753fd41
4
- data.tar.gz: 37c34a36aba8e89822ac4b470ad169dad4ad948c
3
+ metadata.gz: a51927a6d6c5ab0213cf5133fbf9e5128ab0d9f6
4
+ data.tar.gz: 3f176391dd82707b426739969ac176b61fd5b61a
5
5
  SHA512:
6
- metadata.gz: 1ce51989419d2d0118522ba9d1692d63a1abb560493e5b53d1445dc81c8cc852f78a411e39d7ff2888678945419d929380bcd9edbeeb63acbae52526c7542fe6
7
- data.tar.gz: 7535811c728a339ef7f220d786e42f3a257e8af504986c6137ad91331230e0ddb8d1f062e5a0506f4728e4a4934f9affdb5007d59bfe38a261f6b7bbfc4a4498
6
+ metadata.gz: 47fa4ed6fcd7cdefa808b58db7af49ebb20c8cd0743a794afbbcf7463d2417b92db3b81f4419b32d4721f941fc7ff1e5157d246f233420562d12b3976dc62ade
7
+ data.tar.gz: 27c6ba3746379282ef251e985a72df79d1a010471c0a195872378209763aba4977fafddd509a9d44b72cf8d5c6d6738b421b1703b781dba99aeccf38d0630da9
@@ -1,22 +1,28 @@
1
1
  <% stylesheet 'foreman_datacenter/comments' %>
2
2
 
3
3
  <table class="table table-hover panel-body table-striped">
4
- <tbody>
5
- <% comments.roots.each do |c| %>
6
- <tr>
7
- <td>
8
- <ul class="none-list">
9
- <li>
10
- <%= render 'foreman_datacenter/comments/item', comment: c, commentable_data: commentable_data %>
11
- </li>
12
- <% if c.root.descendants != [] %>
13
- <%= render 'foreman_datacenter/comments/children', c: c.root.descendants.arrange, commentable_data: commentable_data %>
14
- <% end %>
15
- </ul>
16
- </td>
17
- </tr>
18
- <% end %>
19
- </tbody>
4
+ <% if comments == [] %>
5
+ <div class="col-md-2">
6
+ <small>No comments yet...</small>
7
+ </div>
8
+ <% else %>
9
+ <tbody>
10
+ <% comments.roots.each do |c| %>
11
+ <tr>
12
+ <td>
13
+ <ul class="none-list" style="padding-left:5px;margin-top:5px;">
14
+ <li>
15
+ <%= render 'foreman_datacenter/comments/item', comment: c, commentable_data: commentable_data %>
16
+ </li>
17
+ <% if c.root.descendants != [] %>
18
+ <%= render 'foreman_datacenter/comments/children', c: c.root.descendants.arrange, commentable_data: commentable_data %>
19
+ <% end %>
20
+ </ul>
21
+ </td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ <% end %>
20
26
  </table>
21
27
 
22
28
  <%= render 'foreman_datacenter/comments/form'%>
@@ -1,22 +1,22 @@
1
- <strong>
2
- <small class="text-left pull-left">
3
- Posted by ... <%#= "#{@user.firstname} #{@user.lastname}" %> at <%= comment.updated_at %>
4
- </small>
1
+ <strong id="comment-<%= comment.id %>">
2
+ <small class="text-left pull-left">
3
+ Posted by ... <%#= "#{@user.firstname} #{@user.lastname}" %> at <%= comment.updated_at %>
4
+ </small>
5
5
 
6
- <small class="text-right pull-right">
7
- <%= link_to "##{comment.id}", "#comment-#{comment.id}" %>
8
- </small>
6
+ <small class="text-right pull-right">
7
+ <%= link_to "##{comment.id}", "#comment-#{comment.id}" %>
8
+ </small>
9
9
  </strong>
10
10
  <br/>
11
11
  <div class="text-left pull-left">
12
- <%= comment.content %>
12
+ <%= comment.content %>
13
13
  <br/>
14
14
  <small>
15
15
  <%= link_to "Reply", new_comment_path(parent_id: comment.id, resource: commentable_data[:resource], resource_id: commentable_data[:id]) %>
16
16
  &nbsp;
17
17
  <%= link_to "Edit", "/datacenter/comments/#{comment.id}/edit" %>
18
18
  &nbsp;
19
- <%= link_to "Delete", "/datacenter/#{commentable_data[:resource]}/#{commentable_data[:id]}/comments/#{comment.id}", method: :delete, data: {confirm: "Are you sure?"} %>
19
+ <%= link_to "Delete", "/datacenter/#{commentable_data[:resource]}/#{commentable_data[:id]}/comments/#{comment.id}", method: :delete, data: {confirm: "Are you sure?"} %>
20
20
  </small>
21
21
  </div>
22
22
  <br/>
@@ -386,30 +386,7 @@
386
386
  <!-- Comments -->
387
387
  <div class="panel panel-default">
388
388
  <div class="panel-heading"><strong>Comments</strong></div>
389
- <table class="table table-hover panel-body table-striped">
390
- <tbody>
391
- <% @device.comments.each do |c| %>
392
- <tr>
393
- <td>
394
- <!-- <div id="comment-<%#= c.id %>"></div> -->
395
- <div class="text-left pull-left" id="comment-<%= c.id %>">
396
- <strong><small>Updated by ... <%#= "#{@user.firstname} #{@user.lastname}" %> at <%= c.updated_at %></small></strong>
397
- <br/>
398
- <%= c.content %>
399
- </div>
400
- <div class="text-right pull-right">
401
- <%= link_to "##{c.id}", "#comment-#{c.id}" %>
402
- <%= link_to "Delete", "/datacenter/#{@resource}/#{@id}/comments/#{c.id}", method: :delete, data: {confirm: "Are you sure?"} %>
403
- <%= link_to "Edit", "/datacenter/comments/#{c.id}/edit" %>
404
- </div>
405
- <br/>
406
- </td>
407
- </tr>
408
- <% end %>
409
- </tbody>
410
- </table>
411
- <%= render 'foreman_datacenter/comments/form' %>
389
+ <%= render 'foreman_datacenter/comments/comments', comments: @device.comments, commentable_data: @commentable_data %>
412
390
  </div>
413
-
414
391
  </div>
415
392
  </div>
@@ -0,0 +1,5 @@
1
+ class AddUserIdToComments < ActiveRecord::Migration
2
+ def change
3
+ add_column :datacenter_comments, :user_id, :integer
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanDatacenter
2
- VERSION = '0.1.28'.freeze
2
+ VERSION = '0.1.29'.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.28
4
+ version: 0.1.29
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-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -331,6 +331,7 @@ files:
331
331
  - db/migrate/20170924194247_rename_device_comments_column.rb
332
332
  - db/migrate/20170929101032_add_parent_id_to_comments.rb
333
333
  - db/migrate/20171001130802_fix_parent_id_column_in_comments.rb
334
+ - db/migrate/20171004221349_add_user_id_to_comments.rb
334
335
  - lib/foreman_datacenter.rb
335
336
  - lib/foreman_datacenter/engine.rb
336
337
  - lib/foreman_datacenter/version.rb