protected_record_manager 0.1.0 → 0.1.1

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: 534aaaab6761cf1bee0c48de69616cd0bbf573f8
4
- data.tar.gz: c6f09ed83683a94a028c3f4bf6eb98307c3cdfd9
3
+ metadata.gz: 84693404904f04eb62754f7a4b2a5ec5db783055
4
+ data.tar.gz: 26490babc58f677d0a3045d3dc34b869406fa392
5
5
  SHA512:
6
- metadata.gz: 88f8c1a76d05a06e9b15804723e5d1b86650fc04f588a2b29a07049562bb5a566cc76788c3529905c1ae9720ea7303b9b69b9d7d9a6958f56a69e9a481ce402b
7
- data.tar.gz: ec59410b58143a1259af66715e6ad448ee50042203569f4963c9f71803c3b73e2e14fe3e91664641ce0bada18b702c28d2126b229599f9aaa1f84ec0686d4d42
6
+ metadata.gz: a0991511c53be014b543feb5f662a71d59a77945e08019387e8c7838e95d86dafbef04132df47dbefafea0c158a80aa88578e6dbab9baf758f558412b38f2fd7
7
+ data.tar.gz: b574c7ca3bc1df38e99df834cd160c1402ebae8a2bc86ae904e8a61a677f15701d0078abbfafc98f9069e167b6ef6c4a1c277e30da189469b2e256d304dcd1e7
@@ -0,0 +1,7 @@
1
+ body {
2
+ background-color: rgb(111,111,111);
3
+ }
4
+
5
+ td.centered {
6
+ text-align:center;
7
+ }
@@ -1,4 +1,13 @@
1
1
  module ProtectedRecordManager
2
2
  module ChangeRequestsHelper
3
+ def change_count(change_request)
4
+ requested_changes = JSON.parse change_request.requested_changes
5
+
6
+ return requested_changes.keys.count
7
+ end
8
+
9
+ def requested_changes(change_request)
10
+ JSON.parse change_request.requested_changes
11
+ end
3
12
  end
4
13
  end
@@ -2,10 +2,13 @@
2
2
 
3
3
  <table>
4
4
  <tr>
5
+ <th>Request</th>
5
6
  <th>User</th>
6
7
  <th>Record Type</th>
7
8
  <th>Record ID</th>
8
- <th>Changes</th>
9
+ <th>Column</th>
10
+ <th>From</th>
11
+ <th>To</th>
9
12
 
10
13
  <th></th>
11
14
  <th></th>
@@ -13,12 +16,32 @@
13
16
 
14
17
  <% @change_requests.each do |change_request| %>
15
18
  <tr>
16
- <td><%= change_request.user.email %></td>
17
- <td><%= change_request.recordable_type %></td>
18
- <td style="text-align:center;"><%= change_request.recordable_id %></td>
19
- <td><%= change_request.requested_changes %></td>
20
- <td><%= link_to 'Show', change_request_path(change_request) %></td>
21
- <td><%= link_to 'Edit', edit_change_request_path(change_request) %></td>
19
+ <td rowspan=<%=change_count(change_request) %> class='centered'><%= change_request.id %>
20
+ <td rowspan=<%=change_count(change_request) %>><%= change_request.user.email %></td>
21
+ <td rowspan=<%=change_count(change_request) %>><%= change_request.recordable_type %></td>
22
+ <td rowspan=<%=change_count(change_request) %> class='centered'><%= change_request.recordable_id %></td>
23
+ <% requested_changes(change_request).each do |column, change| %>
24
+ <% if requested_changes(change_request).keys.first == column %>
25
+ <td><%= column %></td>
26
+ <% change.each do |point| %>
27
+ <td><%= point %></td>
28
+ <% end %>
29
+ <td rowspan=<%=change_count(change_request) %>>
30
+ <%= link_to 'Show', change_request_path(change_request) %>
31
+ </td>
32
+ <td rowspan=<%=change_count(change_request) %>>
33
+ <%= link_to 'Edit', edit_change_request_path(change_request) %>
34
+ </td>
35
+ </tr>
36
+ <% else %>
37
+ <tr>
38
+ <td><%= column %></td>
39
+ <% change.each do |point| %>
40
+ <td><%= point %></td>
41
+ <% end %>
42
+ </tr>
43
+ <% end %>
44
+ <% end %>
22
45
  </tr>
23
46
  <% end %>
24
47
  </table>
@@ -1,3 +1,3 @@
1
1
  module ProtectedRecordManager
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protected_record_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tad Hosford
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.0
33
+ version: 0.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.0
40
+ version: 0.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -62,6 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - app/assets/javascripts/protected_record_manager/application.js
64
64
  - app/assets/stylesheets/protected_record_manager/application.css
65
+ - app/assets/stylesheets/protected_record_manager/change_request.css
65
66
  - app/helpers/protected_record_manager/application_helper.rb
66
67
  - app/helpers/protected_record_manager/change_requests_helper.rb
67
68
  - app/controllers/protected_record_manager/change_requests_controller.rb
@@ -113,10 +114,7 @@ files:
113
114
  - test/dummy/config/locales/en.yml
114
115
  - test/dummy/config.ru
115
116
  - test/dummy/README.rdoc
116
- - test/dummy/log/development.log
117
- - test/dummy/log/test.log
118
117
  - test/unit/helpers/protected_record_manager/protected_records_helper_test.rb
119
- - test/unit/helpers/protected_record_manager/change_requests_helper_test.rb
120
118
  - test/protected_record_manager_test.rb
121
119
  homepage: http://github.com/rthbound/protected_record_manager
122
120
  licenses:
@@ -175,8 +173,5 @@ test_files:
175
173
  - test/dummy/config/locales/en.yml
176
174
  - test/dummy/config.ru
177
175
  - test/dummy/README.rdoc
178
- - test/dummy/log/development.log
179
- - test/dummy/log/test.log
180
176
  - test/unit/helpers/protected_record_manager/protected_records_helper_test.rb
181
- - test/unit/helpers/protected_record_manager/change_requests_helper_test.rb
182
177
  - test/protected_record_manager_test.rb
@@ -1 +0,0 @@
1
- Connecting to database specified by database.yml
@@ -1 +0,0 @@
1
- Connecting to database specified by database.yml
@@ -1,6 +0,0 @@
1
- require 'test_helper'
2
-
3
- module ProtectedRecordManager
4
- class ChangeRequestsHelperTest < ActionView::TestCase
5
- end
6
- end