gdpr_rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +270 -13
- data/app/assets/javascripts/policy_manager/application.js +4 -0
- data/app/assets/javascripts/policy_manager/portability_requests.js +2 -0
- data/app/assets/javascripts/policy_manager/user_portability_requests.js +2 -0
- data/app/assets/stylesheets/policy_manager/portability_requests.css +4 -0
- data/app/assets/stylesheets/policy_manager/user_portability_requests.css +4 -0
- data/app/controllers/policy_manager/application_controller.rb +22 -0
- data/app/controllers/policy_manager/categories_controller.rb +5 -47
- data/app/controllers/policy_manager/portability_requests_controller.rb +34 -0
- data/app/controllers/policy_manager/terms_controller.rb +16 -13
- data/app/controllers/policy_manager/user_portability_requests_controller.rb +41 -0
- data/app/controllers/policy_manager/user_terms_controller.rb +68 -28
- data/app/helpers/policy_manager/application_helper.rb +28 -0
- data/app/helpers/policy_manager/portability_requests_helper.rb +4 -0
- data/app/helpers/policy_manager/scripts_helper.rb +11 -0
- data/app/helpers/policy_manager/terms_helper.rb +1 -1
- data/app/helpers/policy_manager/user_portability_requests_helper.rb +4 -0
- data/app/jobs/policy_manager/exporter_job.rb +10 -0
- data/app/mailers/policy_manager/application_mailer.rb +20 -2
- data/app/mailers/policy_manager/portability_mailer.rb +34 -0
- data/app/models/policy_manager/concerns/user_behavior.rb +80 -22
- data/app/models/policy_manager/portability_request.rb +65 -0
- data/app/models/policy_manager/term.rb +18 -0
- data/app/models/policy_manager/user_term.rb +14 -7
- data/app/views/layouts/policy_manager/application.html.erb +41 -39
- data/app/views/layouts/policy_manager/mailer.html.erb +13 -0
- data/app/views/layouts/policy_manager/mailer.text.erb +1 -0
- data/app/views/policy_manager/categories/index.html.erb +6 -12
- data/app/views/policy_manager/categories/show.html.erb +13 -20
- data/app/views/policy_manager/portability_mailer/completed_notification.erb +7 -0
- data/app/views/policy_manager/portability_mailer/progress_notification.erb +3 -0
- data/app/views/policy_manager/portability_requests/index.html.erb +42 -0
- data/app/views/policy_manager/portability_requests/index.json.jbuilder +5 -0
- data/app/views/policy_manager/terms/_form.html.erb +12 -11
- data/app/views/policy_manager/terms/edit.html.erb +6 -4
- data/app/views/policy_manager/terms/index.html.erb +12 -13
- data/app/views/policy_manager/terms/new.html.erb +5 -3
- data/app/views/policy_manager/terms/show.html.erb +12 -10
- data/app/views/policy_manager/user_portability_requests/index.html.erb +42 -0
- data/app/views/policy_manager/user_portability_requests/index.json.jbuilder +5 -0
- data/app/views/policy_manager/user_terms/pending.html.erb +10 -6
- data/app/views/policy_manager/user_terms/show.html.erb +7 -8
- data/app/views/policy_manager/user_terms/show.json.jbuilder +15 -8
- data/config/locales/en.yml +122 -0
- data/config/locales/es.yml +122 -0
- data/config/routes.rb +15 -6
- data/db/migrate/20180326193825_create_policy_manager_terms.rb +1 -0
- data/db/migrate/20180410171354_create_policy_manager_portability_requests.rb +18 -0
- data/lib/policy_manager/anonimizer.rb +18 -0
- data/lib/policy_manager/config.rb +35 -1
- data/lib/policy_manager/exporter/handler.rb +110 -0
- data/lib/policy_manager/exporter/paginator_renderer.rb +74 -0
- data/lib/policy_manager/exporter/view.rb +108 -0
- data/lib/policy_manager/exporter/zip_generator.rb +60 -0
- data/lib/policy_manager/exporter.rb +75 -0
- data/lib/policy_manager/portability_rule.rb +15 -0
- data/lib/policy_manager/rule.rb +21 -4
- data/lib/policy_manager/script.rb +56 -0
- data/lib/policy_manager/templates/index.html.erb +1 -0
- data/lib/policy_manager/version.rb +1 -1
- data/lib/policy_manager.rb +10 -0
- metadata +160 -19
- data/app/controllers/policy_manager/dashboard_controller.rb +0 -6
- data/app/helpers/policy_manager/categories_helper.rb +0 -4
- data/app/helpers/policy_manager/dashboard_helper.rb +0 -4
- data/app/helpers/policy_manager/terms_categories_helper.rb +0 -4
- data/app/views/policy_manager/categories/_form.html.erb +0 -22
- data/app/views/policy_manager/categories/edit.html.erb +0 -6
- data/app/views/policy_manager/categories/new.html.erb +0 -5
- data/app/views/policy_manager/dashboard/index.erb +0 -33
- data/app/views/policy_manager/terms_categories/_form.html.erb +0 -17
- data/app/views/policy_manager/terms_categories/edit.html.erb +0 -6
- data/app/views/policy_manager/terms_categories/index.html.erb +0 -24
- data/app/views/policy_manager/terms_categories/new.html.erb +0 -5
- data/app/views/policy_manager/terms_categories/show.html.erb +0 -4
- data/app/views/policy_manager/user_terms/_form.html.erb +0 -17
- data/app/views/policy_manager/user_terms/edit.html.erb +0 -6
- data/app/views/policy_manager/user_terms/index.html.erb +0 -24
- data/app/views/policy_manager/user_terms/new.html.erb +0 -5
data/lib/policy_manager/rule.rb
CHANGED
@@ -1,20 +1,37 @@
|
|
1
1
|
module PolicyManager
|
2
2
|
class Rule
|
3
|
-
attr_accessor :
|
3
|
+
attr_accessor :validates_on,
|
4
|
+
:if,
|
5
|
+
:blocking,
|
6
|
+
:name,
|
7
|
+
:on_reject,
|
8
|
+
:on_accept
|
4
9
|
|
5
10
|
def initialize(opts={})
|
6
11
|
self.name = opts[:name]
|
7
12
|
self.blocking = opts[:blocking]
|
8
|
-
self.
|
13
|
+
self.validates_on = opts[:validates_on]
|
14
|
+
self.if = opts[:if]
|
15
|
+
self.on_reject = opts[:on_reject]
|
16
|
+
self.on_accept = opts[:on_accept]
|
17
|
+
self
|
9
18
|
end
|
10
19
|
|
11
|
-
def
|
12
|
-
@
|
20
|
+
def validates_on
|
21
|
+
@validates_on #|| [:create]
|
13
22
|
end
|
14
23
|
|
15
24
|
def terms
|
16
25
|
Term.where("rule =?", self.name)
|
17
26
|
end
|
18
27
|
|
28
|
+
def on_reject_callback
|
29
|
+
@on_reject.call if @on_reject.is_a?(Proc)
|
30
|
+
end
|
31
|
+
|
32
|
+
def on_accept_callback
|
33
|
+
@on_accept.call if @on_accept.is_a?(Proc)
|
34
|
+
end
|
35
|
+
|
19
36
|
end
|
20
37
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module PolicyManager
|
2
|
+
class Script
|
3
|
+
include ActiveModel::Serialization
|
4
|
+
|
5
|
+
attr_accessor :script,
|
6
|
+
:name,
|
7
|
+
:environments,
|
8
|
+
:cookies,
|
9
|
+
:description,
|
10
|
+
:permanent,
|
11
|
+
:domain
|
12
|
+
|
13
|
+
def initialize(opts={})
|
14
|
+
self.name = opts[:name]
|
15
|
+
self.script = opts[:script]
|
16
|
+
self.cookies = opts[:cookies]
|
17
|
+
self.environments = opts[:environments]
|
18
|
+
self.description = opts[:description]
|
19
|
+
self.permanent = opts[:permanent]
|
20
|
+
self.domain = opts[:domain]
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
24
|
+
def can_render?
|
25
|
+
self.environments.map(&:to_s).include?(Rails.env)
|
26
|
+
end
|
27
|
+
|
28
|
+
def description
|
29
|
+
@description.is_a?(Proc) ? @description.call : @description
|
30
|
+
end
|
31
|
+
|
32
|
+
def as_json(opts={})
|
33
|
+
data = {}
|
34
|
+
fields = [:script, :name, :cookies, :description]
|
35
|
+
fields.each { |k| data[k] = send(k) }
|
36
|
+
data
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.cookies
|
40
|
+
PolicyManager::Config
|
41
|
+
.scripts
|
42
|
+
.select{|o| o.cookies.present? }
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.cookies_permanent
|
46
|
+
PolicyManager::Config
|
47
|
+
.scripts
|
48
|
+
.select{|o| o.cookies.present? && o.permanent? }
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.scripts
|
52
|
+
PolicyManager::Config.scripts.select{|o| o.script.present?}
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
hellow
|
data/lib/policy_manager.rb
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
|
2
|
+
require "groupdate"
|
3
|
+
require "chartkick"
|
2
4
|
require "policy_manager/engine"
|
3
5
|
require "policy_manager/rule"
|
6
|
+
require "policy_manager/script"
|
7
|
+
require "policy_manager/portability_rule"
|
8
|
+
require "policy_manager/exporter"
|
9
|
+
require "policy_manager/exporter/handler.rb"
|
10
|
+
require "policy_manager/exporter/view.rb"
|
11
|
+
require "policy_manager/exporter/zip_generator.rb"
|
12
|
+
require "policy_manager/exporter/paginator_renderer.rb"
|
13
|
+
|
4
14
|
require "policy_manager/config"
|
5
15
|
|
6
16
|
module PolicyManager
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdpr_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Michelson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-05-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 5.1.4
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: tilt
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: redcarpet
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,6 +53,118 @@ dependencies:
|
|
39
53
|
- - ">="
|
40
54
|
- !ruby/object:Gem::Version
|
41
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: will_paginate
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: aasm
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rubyzip
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 1.0.0
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.0.0
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: paperclip
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: groupdate
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 4.0.0
|
119
|
+
type: :runtime
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 4.0.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: chartkick
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - '='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 2.3.4
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - '='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 2.3.4
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: minitest-stub_any_instance
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: nokogiri
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
type: :development
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
42
168
|
- !ruby/object:Gem::Dependency
|
43
169
|
name: sqlite3
|
44
170
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,57 +191,72 @@ files:
|
|
65
191
|
- Rakefile
|
66
192
|
- app/assets/config/policy_manager_manifest.js
|
67
193
|
- app/assets/javascripts/policy_manager/application.js
|
194
|
+
- app/assets/javascripts/policy_manager/portability_requests.js
|
195
|
+
- app/assets/javascripts/policy_manager/user_portability_requests.js
|
68
196
|
- app/assets/stylesheets/policy_manager/application.css
|
69
197
|
- app/assets/stylesheets/policy_manager/dashboard.css
|
198
|
+
- app/assets/stylesheets/policy_manager/portability_requests.css
|
199
|
+
- app/assets/stylesheets/policy_manager/user_portability_requests.css
|
70
200
|
- app/assets/stylesheets/scaffold.css
|
71
201
|
- app/controllers/policy_manager/application_controller.rb
|
72
202
|
- app/controllers/policy_manager/categories_controller.rb
|
73
|
-
- app/controllers/policy_manager/
|
203
|
+
- app/controllers/policy_manager/portability_requests_controller.rb
|
74
204
|
- app/controllers/policy_manager/terms_controller.rb
|
205
|
+
- app/controllers/policy_manager/user_portability_requests_controller.rb
|
75
206
|
- app/controllers/policy_manager/user_terms_controller.rb
|
76
207
|
- app/helpers/policy_manager/application_helper.rb
|
77
|
-
- app/helpers/policy_manager/
|
78
|
-
- app/helpers/policy_manager/
|
79
|
-
- app/helpers/policy_manager/terms_categories_helper.rb
|
208
|
+
- app/helpers/policy_manager/portability_requests_helper.rb
|
209
|
+
- app/helpers/policy_manager/scripts_helper.rb
|
80
210
|
- app/helpers/policy_manager/terms_helper.rb
|
211
|
+
- app/helpers/policy_manager/user_portability_requests_helper.rb
|
81
212
|
- app/helpers/policy_manager/user_terms_helper.rb
|
82
213
|
- app/jobs/policy_manager/application_job.rb
|
214
|
+
- app/jobs/policy_manager/exporter_job.rb
|
83
215
|
- app/mailers/policy_manager/application_mailer.rb
|
216
|
+
- app/mailers/policy_manager/portability_mailer.rb
|
84
217
|
- app/models/policy_manager/application_record.rb
|
85
218
|
- app/models/policy_manager/concerns/user_behavior.rb
|
219
|
+
- app/models/policy_manager/portability_request.rb
|
86
220
|
- app/models/policy_manager/term.rb
|
87
221
|
- app/models/policy_manager/user_term.rb
|
88
222
|
- app/views/layouts/policy_manager/application.html.erb
|
89
|
-
- app/views/policy_manager/
|
90
|
-
- app/views/policy_manager/
|
223
|
+
- app/views/layouts/policy_manager/mailer.html.erb
|
224
|
+
- app/views/layouts/policy_manager/mailer.text.erb
|
91
225
|
- app/views/policy_manager/categories/index.html.erb
|
92
|
-
- app/views/policy_manager/categories/new.html.erb
|
93
226
|
- app/views/policy_manager/categories/show.html.erb
|
94
|
-
- app/views/policy_manager/
|
227
|
+
- app/views/policy_manager/portability_mailer/completed_notification.erb
|
228
|
+
- app/views/policy_manager/portability_mailer/progress_notification.erb
|
229
|
+
- app/views/policy_manager/portability_requests/index.html.erb
|
230
|
+
- app/views/policy_manager/portability_requests/index.json.jbuilder
|
95
231
|
- app/views/policy_manager/terms/_form.html.erb
|
96
232
|
- app/views/policy_manager/terms/edit.html.erb
|
97
233
|
- app/views/policy_manager/terms/index.html.erb
|
98
234
|
- app/views/policy_manager/terms/new.html.erb
|
99
235
|
- app/views/policy_manager/terms/show.html.erb
|
100
|
-
- app/views/policy_manager/
|
101
|
-
- app/views/policy_manager/
|
102
|
-
- app/views/policy_manager/terms_categories/index.html.erb
|
103
|
-
- app/views/policy_manager/terms_categories/new.html.erb
|
104
|
-
- app/views/policy_manager/terms_categories/show.html.erb
|
105
|
-
- app/views/policy_manager/user_terms/_form.html.erb
|
106
|
-
- app/views/policy_manager/user_terms/edit.html.erb
|
107
|
-
- app/views/policy_manager/user_terms/index.html.erb
|
108
|
-
- app/views/policy_manager/user_terms/new.html.erb
|
236
|
+
- app/views/policy_manager/user_portability_requests/index.html.erb
|
237
|
+
- app/views/policy_manager/user_portability_requests/index.json.jbuilder
|
109
238
|
- app/views/policy_manager/user_terms/pending.html.erb
|
110
239
|
- app/views/policy_manager/user_terms/show.html.erb
|
111
240
|
- app/views/policy_manager/user_terms/show.json.jbuilder
|
241
|
+
- config/locales/en.yml
|
242
|
+
- config/locales/es.yml
|
112
243
|
- config/routes.rb
|
113
244
|
- db/migrate/20180326193825_create_policy_manager_terms.rb
|
114
245
|
- db/migrate/20180326193827_create_policy_manager_user_terms.rb
|
246
|
+
- db/migrate/20180410171354_create_policy_manager_portability_requests.rb
|
115
247
|
- lib/policy_manager.rb
|
248
|
+
- lib/policy_manager/anonimizer.rb
|
116
249
|
- lib/policy_manager/config.rb
|
117
250
|
- lib/policy_manager/engine.rb
|
251
|
+
- lib/policy_manager/exporter.rb
|
252
|
+
- lib/policy_manager/exporter/handler.rb
|
253
|
+
- lib/policy_manager/exporter/paginator_renderer.rb
|
254
|
+
- lib/policy_manager/exporter/view.rb
|
255
|
+
- lib/policy_manager/exporter/zip_generator.rb
|
256
|
+
- lib/policy_manager/portability_rule.rb
|
118
257
|
- lib/policy_manager/rule.rb
|
258
|
+
- lib/policy_manager/script.rb
|
259
|
+
- lib/policy_manager/templates/index.html.erb
|
119
260
|
- lib/policy_manager/version.rb
|
120
261
|
- lib/tasks/terms_tasks.rake
|
121
262
|
homepage: http://preyproject.com
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%= form_with(model: category, local: true) do |form| %>
|
2
|
-
<% if category.errors.any? %>
|
3
|
-
<div id="error_explanation">
|
4
|
-
<h2><%= pluralize(category.errors.count, "error") %> prohibited this category from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% category.errors.full_messages.each do |message| %>
|
8
|
-
<li><%= message %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div class="form-group">
|
15
|
-
<%= form.label :name %>
|
16
|
-
<%= form.text_field :name, id: :category_name, class: "form-control" %>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<div class="actions">
|
20
|
-
<%= form.submit class: "btn btn-primary" %>
|
21
|
-
</div>
|
22
|
-
<% end %>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
|
2
|
-
<h3>Categories</h3>
|
3
|
-
|
4
|
-
<div>
|
5
|
-
<% PolicyManager::UserTerm.group("year(created_at)").group("month(created_at)").count.each do |ut| %>
|
6
|
-
<%= ut.first %> | <%= ut.last %>
|
7
|
-
<% end %>
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<div class="table-responsive">
|
11
|
-
<table class="table table-striped table-sm">
|
12
|
-
<thead>
|
13
|
-
<tr>
|
14
|
-
<th>Name</th>
|
15
|
-
<th>Articles</th>
|
16
|
-
<th colspan="3"></th>
|
17
|
-
</tr>
|
18
|
-
</thead>
|
19
|
-
|
20
|
-
<tbody>
|
21
|
-
<% PolicyManager::Category.all.each do |category| %>
|
22
|
-
<tr>
|
23
|
-
<td><%= category.name %></td>
|
24
|
-
<td><%= category.terms.size %></td>
|
25
|
-
<td><%= link_to 'Show', category %></td>
|
26
|
-
<td><%= link_to 'Edit', edit_category_path(category) %></td>
|
27
|
-
<td><%= link_to 'Destroy', category, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
28
|
-
</tr>
|
29
|
-
<% end %>
|
30
|
-
</tbody>
|
31
|
-
</table>
|
32
|
-
|
33
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<%= form_with(model: terms_category, local: true) do |form| %>
|
2
|
-
<% if terms_category.errors.any? %>
|
3
|
-
<div id="error_explanation">
|
4
|
-
<h2><%= pluralize(terms_category.errors.count, "error") %> prohibited this terms_category from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% terms_category.errors.full_messages.each do |message| %>
|
8
|
-
<li><%= message %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div class="actions">
|
15
|
-
<%= form.submit %>
|
16
|
-
</div>
|
17
|
-
<% end %>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
|
2
|
-
<h1>Terms Categories</h1>
|
3
|
-
|
4
|
-
<table>
|
5
|
-
<thead>
|
6
|
-
<tr>
|
7
|
-
<th colspan="3"></th>
|
8
|
-
</tr>
|
9
|
-
</thead>
|
10
|
-
|
11
|
-
<tbody>
|
12
|
-
<% @terms_categories.each do |terms_category| %>
|
13
|
-
<tr>
|
14
|
-
<td><%= link_to 'Show', terms_category %></td>
|
15
|
-
<td><%= link_to 'Edit', edit_terms_category_path(terms_category) %></td>
|
16
|
-
<td><%= link_to 'Destroy', terms_category, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
17
|
-
</tr>
|
18
|
-
<% end %>
|
19
|
-
</tbody>
|
20
|
-
</table>
|
21
|
-
|
22
|
-
<br>
|
23
|
-
|
24
|
-
<%= link_to 'New Terms Category', new_terms_category_path %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<%= form_with(model: user_term, local: true) do |form| %>
|
2
|
-
<% if user_term.errors.any? %>
|
3
|
-
<div id="error_explanation">
|
4
|
-
<h2><%= pluralize(user_term.errors.count, "error") %> prohibited this user_term from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% user_term.errors.full_messages.each do |message| %>
|
8
|
-
<li><%= message %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div class="actions">
|
15
|
-
<%= form.submit %>
|
16
|
-
</div>
|
17
|
-
<% end %>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
|
2
|
-
<h1>User Terms</h1>
|
3
|
-
|
4
|
-
<table>
|
5
|
-
<thead>
|
6
|
-
<tr>
|
7
|
-
<th colspan="3"></th>
|
8
|
-
</tr>
|
9
|
-
</thead>
|
10
|
-
|
11
|
-
<tbody>
|
12
|
-
<% @user_terms.each do |user_term| %>
|
13
|
-
<tr>
|
14
|
-
<td><%= link_to 'Show', user_term %></td>
|
15
|
-
<td><%= link_to 'Edit', edit_user_term_path(user_term) %></td>
|
16
|
-
<td><%= link_to 'Destroy', user_term, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
17
|
-
</tr>
|
18
|
-
<% end %>
|
19
|
-
</tbody>
|
20
|
-
</table>
|
21
|
-
|
22
|
-
<br>
|
23
|
-
|
24
|
-
<%= link_to 'New User Term', new_user_term_path %>
|