audited-timeline 0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/Gemfile.lock +78 -164
- data/README.md +1 -1
- data/VERSION +1 -0
- data/app/assets/stylesheets/audited-timeline/_timeline.scss +21 -43
- data/app/assets/stylesheets/audited-timeline.scss +0 -1
- data/app/views/audited_timeline/_diff.html.erb +4 -8
- data/app/views/audited_timeline/_diff_create.html.erb +1 -0
- data/app/views/audited_timeline/_diff_destroy.html.erb +1 -0
- data/app/views/audited_timeline/_list.html.erb +25 -30
- data/audited_timeline.gemspec +8 -8
- data/config/locales/audited_timeline.de.yml +2 -3
- data/config/locales/audited_timeline.en.yml +2 -3
- data/lib/audited_timeline/audit.rb +1 -1
- data/lib/audited_timeline/audit_decorator.rb +9 -16
- data/lib/audited_timeline/view_helpers.rb +2 -2
- metadata +33 -20
- data/.github/dependabot.yml +0 -10
- data/.github/workflows/codeql-analysis.yml +0 -27
- data/.github/workflows/gem-build.yml +0 -18
- data/.github/workflows/gem-push.yml +0 -27
- data/Dockerfile +0 -14
- data/app/assets/stylesheets/audited-timeline/_variables.scss +0 -12
- data/docker-compose.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b93a3cb9f05b8325c4cf2c65b3a086c7b9021a78
|
4
|
+
data.tar.gz: 258bf94edcd08930fcb7057b165acf2523d7f43f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a25fa3518ca156d10aa9ba491dafcd58518ebfd057b30b974973a67e2b6942f2ca57c0851fa11ec09c5023321b6d55cdba9f62f51ef310168ff22f216329b5
|
7
|
+
data.tar.gz: 44b1f1ef1b4fbefba24e6f33a67892ea3d75c7c6480172c1412fb7bf0da5cf5f0dfcfe6f2665aa65e031189f8c27dc0aeb711bfc9df291ae16a7883ad78c5b3a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.2.0
|
data/Gemfile.lock
CHANGED
@@ -1,177 +1,91 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
customer-client (0.0.1)
|
5
|
+
activesupport (> 3.0.0)
|
6
|
+
faraday
|
7
|
+
faraday_middleware
|
8
|
+
rest-in-peace
|
9
|
+
webmock
|
10
|
+
|
11
|
+
PATH
|
12
|
+
remote: ../REST-in-Peace
|
13
|
+
specs:
|
14
|
+
rest-in-peace (3.0.0)
|
15
|
+
activemodel (>= 3.2, < 5)
|
8
16
|
|
9
17
|
GEM
|
10
18
|
remote: https://rubygems.org/
|
11
19
|
specs:
|
12
|
-
|
13
|
-
|
14
|
-
activesupport (= 6.1.7.2)
|
15
|
-
nio4r (~> 2.0)
|
16
|
-
websocket-driver (>= 0.6.1)
|
17
|
-
actionmailbox (6.1.7.2)
|
18
|
-
actionpack (= 6.1.7.2)
|
19
|
-
activejob (= 6.1.7.2)
|
20
|
-
activerecord (= 6.1.7.2)
|
21
|
-
activestorage (= 6.1.7.2)
|
22
|
-
activesupport (= 6.1.7.2)
|
23
|
-
mail (>= 2.7.1)
|
24
|
-
actionmailer (6.1.7.2)
|
25
|
-
actionpack (= 6.1.7.2)
|
26
|
-
actionview (= 6.1.7.2)
|
27
|
-
activejob (= 6.1.7.2)
|
28
|
-
activesupport (= 6.1.7.2)
|
29
|
-
mail (~> 2.5, >= 2.5.4)
|
30
|
-
rails-dom-testing (~> 2.0)
|
31
|
-
actionpack (6.1.7.2)
|
32
|
-
actionview (= 6.1.7.2)
|
33
|
-
activesupport (= 6.1.7.2)
|
34
|
-
rack (~> 2.0, >= 2.0.9)
|
35
|
-
rack-test (>= 0.6.3)
|
36
|
-
rails-dom-testing (~> 2.0)
|
37
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
38
|
-
actiontext (6.1.7.2)
|
39
|
-
actionpack (= 6.1.7.2)
|
40
|
-
activerecord (= 6.1.7.2)
|
41
|
-
activestorage (= 6.1.7.2)
|
42
|
-
activesupport (= 6.1.7.2)
|
43
|
-
nokogiri (>= 1.8.5)
|
44
|
-
actionview (6.1.7.2)
|
45
|
-
activesupport (= 6.1.7.2)
|
20
|
+
activemodel (4.2.0)
|
21
|
+
activesupport (= 4.2.0)
|
46
22
|
builder (~> 3.1)
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
mini_portile2 (2.8.1)
|
105
|
-
minitest (5.17.0)
|
106
|
-
net-imap (0.3.4)
|
107
|
-
date
|
108
|
-
net-protocol
|
109
|
-
net-pop (0.1.2)
|
110
|
-
net-protocol
|
111
|
-
net-protocol (0.2.1)
|
112
|
-
timeout
|
113
|
-
net-smtp (0.3.3)
|
114
|
-
net-protocol
|
115
|
-
nio4r (2.5.8)
|
116
|
-
nokogiri (1.14.1)
|
117
|
-
mini_portile2 (~> 2.8.0)
|
118
|
-
racc (~> 1.4)
|
119
|
-
racc (1.6.2)
|
120
|
-
rack (2.2.6.2)
|
121
|
-
rack-test (2.0.2)
|
122
|
-
rack (>= 1.3)
|
123
|
-
rails (6.1.7.2)
|
124
|
-
actioncable (= 6.1.7.2)
|
125
|
-
actionmailbox (= 6.1.7.2)
|
126
|
-
actionmailer (= 6.1.7.2)
|
127
|
-
actionpack (= 6.1.7.2)
|
128
|
-
actiontext (= 6.1.7.2)
|
129
|
-
actionview (= 6.1.7.2)
|
130
|
-
activejob (= 6.1.7.2)
|
131
|
-
activemodel (= 6.1.7.2)
|
132
|
-
activerecord (= 6.1.7.2)
|
133
|
-
activestorage (= 6.1.7.2)
|
134
|
-
activesupport (= 6.1.7.2)
|
135
|
-
bundler (>= 1.15.0)
|
136
|
-
railties (= 6.1.7.2)
|
137
|
-
sprockets-rails (>= 2.0.0)
|
138
|
-
rails-dom-testing (2.0.3)
|
139
|
-
activesupport (>= 4.2.0)
|
140
|
-
nokogiri (>= 1.6)
|
141
|
-
rails-html-sanitizer (1.5.0)
|
142
|
-
loofah (~> 2.19, >= 2.19.1)
|
143
|
-
railties (6.1.7.2)
|
144
|
-
actionpack (= 6.1.7.2)
|
145
|
-
activesupport (= 6.1.7.2)
|
146
|
-
method_source
|
147
|
-
rake (>= 12.2)
|
148
|
-
thor (~> 1.0)
|
149
|
-
rake (13.0.6)
|
150
|
-
request_store (1.5.1)
|
151
|
-
rack (>= 1.4)
|
152
|
-
ruby2_keywords (0.0.5)
|
153
|
-
sprockets (4.2.0)
|
154
|
-
concurrent-ruby (~> 1.0)
|
155
|
-
rack (>= 2.2.4, < 4)
|
156
|
-
sprockets-rails (3.4.2)
|
157
|
-
actionpack (>= 5.2)
|
158
|
-
activesupport (>= 5.2)
|
159
|
-
sprockets (>= 3.0.0)
|
160
|
-
thor (1.2.1)
|
161
|
-
timeout (0.3.1)
|
162
|
-
tzinfo (2.0.6)
|
163
|
-
concurrent-ruby (~> 1.0)
|
164
|
-
websocket-driver (0.7.5)
|
165
|
-
websocket-extensions (>= 0.1.0)
|
166
|
-
websocket-extensions (0.1.5)
|
167
|
-
zeitwerk (2.6.6)
|
23
|
+
activesupport (4.2.0)
|
24
|
+
i18n (~> 0.7)
|
25
|
+
json (~> 1.7, >= 1.7.7)
|
26
|
+
minitest (~> 5.1)
|
27
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
28
|
+
tzinfo (~> 1.1)
|
29
|
+
addressable (2.3.6)
|
30
|
+
builder (3.2.2)
|
31
|
+
coderay (1.1.0)
|
32
|
+
columnize (0.9.0)
|
33
|
+
crack (0.4.2)
|
34
|
+
safe_yaml (~> 1.0.0)
|
35
|
+
debugger (1.6.8)
|
36
|
+
columnize (>= 0.3.1)
|
37
|
+
debugger-linecache (~> 1.2.0)
|
38
|
+
debugger-ruby_core_source (~> 1.3.5)
|
39
|
+
debugger-linecache (1.2.0)
|
40
|
+
debugger-ruby_core_source (1.3.8)
|
41
|
+
diff-lcs (1.2.5)
|
42
|
+
faraday (0.9.1)
|
43
|
+
multipart-post (>= 1.2, < 3)
|
44
|
+
faraday_middleware (0.9.1)
|
45
|
+
faraday (>= 0.7.4, < 0.10)
|
46
|
+
i18n (0.7.0)
|
47
|
+
json (1.8.2)
|
48
|
+
method_source (0.8.2)
|
49
|
+
minitest (5.5.1)
|
50
|
+
multipart-post (2.0.0)
|
51
|
+
pry (0.10.1)
|
52
|
+
coderay (~> 1.1.0)
|
53
|
+
method_source (~> 0.8.1)
|
54
|
+
slop (~> 3.4)
|
55
|
+
pry-debugger (0.2.3)
|
56
|
+
debugger (~> 1.3)
|
57
|
+
pry (>= 0.9.10, < 0.11.0)
|
58
|
+
rake (10.4.2)
|
59
|
+
rspec (3.2.0)
|
60
|
+
rspec-core (~> 3.2.0)
|
61
|
+
rspec-expectations (~> 3.2.0)
|
62
|
+
rspec-mocks (~> 3.2.0)
|
63
|
+
rspec-core (3.2.0)
|
64
|
+
rspec-support (~> 3.2.0)
|
65
|
+
rspec-expectations (3.2.0)
|
66
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
+
rspec-support (~> 3.2.0)
|
68
|
+
rspec-mocks (3.2.0)
|
69
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
+
rspec-support (~> 3.2.0)
|
71
|
+
rspec-support (3.2.1)
|
72
|
+
safe_yaml (1.0.4)
|
73
|
+
slop (3.6.0)
|
74
|
+
thread_safe (0.3.4)
|
75
|
+
tzinfo (1.2.2)
|
76
|
+
thread_safe (~> 0.1)
|
77
|
+
webmock (1.20.4)
|
78
|
+
addressable (>= 2.3.6)
|
79
|
+
crack (>= 0.3.2)
|
168
80
|
|
169
81
|
PLATFORMS
|
170
82
|
ruby
|
171
83
|
|
172
84
|
DEPENDENCIES
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
85
|
+
bundler (~> 1.6)
|
86
|
+
customer-client!
|
87
|
+
pry
|
88
|
+
pry-debugger
|
89
|
+
rake
|
90
|
+
rest-in-peace!
|
91
|
+
rspec
|
data/README.md
CHANGED
@@ -63,7 +63,7 @@ to create.
|
|
63
63
|
</div>
|
64
64
|
```
|
65
65
|
|
66
|
-
In this case, create in your application `app/views/audits/
|
66
|
+
In this case, create in your application `app/views/audits/lvm/_volume.create.html.erb`
|
67
67
|
to override this audit type.
|
68
68
|
|
69
69
|
audited-timeline will provide a locale called `audit` to your partial.
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
@@ -1,12 +1,8 @@
|
|
1
|
-
.audited-timeline-list .audited-timeline-wrapper:first-child {
|
2
|
-
margin-top: 0;
|
3
|
-
}
|
4
|
-
|
5
1
|
.audited-timeline-wrapper {
|
6
|
-
margin-bottom: $base-spacing;
|
7
|
-
margin-top: $base-spacing;
|
8
|
-
padding: 2px 0px 2px;
|
9
2
|
position: relative;
|
3
|
+
padding: 2px 0px 2px 64px;
|
4
|
+
margin-top: $base-spacing;
|
5
|
+
margin-bottom: $base-spacing;
|
10
6
|
|
11
7
|
&:first-child {
|
12
8
|
margin-top: 0;
|
@@ -17,44 +13,37 @@
|
|
17
13
|
margin-left: -64px;
|
18
14
|
border-radius: $base-border-radius;
|
19
15
|
}
|
20
|
-
|
21
|
-
.with-avatars {
|
22
|
-
padding-left: 64px;
|
23
|
-
}
|
24
16
|
}
|
25
17
|
|
26
|
-
.audited-timeline-
|
18
|
+
.audited-timeline-item {
|
27
19
|
position: relative;
|
20
|
+
border: $base-border;
|
21
|
+
border-radius: $base-border-radius;
|
28
22
|
|
29
23
|
&:before, &:after {
|
30
|
-
border-color: transparent;
|
31
|
-
border-style: solid solid outset;
|
32
|
-
content: ' ';
|
33
|
-
display: block;
|
34
|
-
height: 0;
|
35
|
-
left: -16px;
|
36
24
|
position: absolute;
|
37
|
-
right: 100%;
|
38
25
|
top: 11px;
|
26
|
+
left: -16px;
|
27
|
+
right: 100%;
|
39
28
|
width: 0;
|
29
|
+
height: 0;
|
30
|
+
display: block;
|
31
|
+
content: " ";
|
32
|
+
border-color: transparent;
|
33
|
+
border-style: solid solid outset;
|
40
34
|
}
|
41
35
|
|
42
36
|
&:before {
|
43
|
-
border-right-color: $base-border-color;
|
44
37
|
border-width: 8px;
|
38
|
+
border-right-color: $base-border-color;
|
45
39
|
}
|
46
40
|
|
47
41
|
&:after {
|
48
42
|
border-right-color: #f2f8fa;
|
49
43
|
border-width: 7px;
|
50
|
-
margin-left: 2px;
|
51
44
|
margin-top: 1px;
|
45
|
+
margin-left: 2px;
|
52
46
|
}
|
53
|
-
}
|
54
|
-
|
55
|
-
.audited-timeline-item {
|
56
|
-
border: $base-border;
|
57
|
-
border-radius: $base-border-radius;
|
58
47
|
|
59
48
|
&:hover .audited-timeline-header .audited-timeline-actions {
|
60
49
|
visibility: visible;
|
@@ -62,22 +51,20 @@
|
|
62
51
|
}
|
63
52
|
|
64
53
|
.audited-timeline-header {
|
54
|
+
padding: $base-spacing/3 $base-spacing/1.5;
|
65
55
|
background-color: lighten($light-gray, 15%);
|
66
56
|
border-bottom: 1px solid #eee;
|
67
57
|
border-top-left-radius: $base-border-radius;
|
68
58
|
border-top-right-radius: $base-border-radius;
|
69
|
-
padding: $base-spacing/3 $base-spacing/1.5;
|
70
59
|
|
71
60
|
.audited-timeline-user {
|
72
61
|
font-weight: bold;
|
73
62
|
margin-right: 0.5em;
|
74
63
|
}
|
75
|
-
|
76
64
|
.audited-timeline-date {
|
77
65
|
color: $dark-gray;
|
78
66
|
font-size: 0.8em;
|
79
67
|
}
|
80
|
-
|
81
68
|
.audited-timeline-actions {
|
82
69
|
float: right;
|
83
70
|
visibility: hidden;
|
@@ -86,8 +73,8 @@
|
|
86
73
|
}
|
87
74
|
}
|
88
75
|
|
76
|
+
|
89
77
|
.audited-timeline-body {
|
90
|
-
background: #fff;
|
91
78
|
padding: $base-spacing/1.5;
|
92
79
|
|
93
80
|
p {
|
@@ -96,8 +83,8 @@
|
|
96
83
|
|
97
84
|
form.simple_form {
|
98
85
|
float: none;
|
99
|
-
margin: 0;
|
100
86
|
width: 100%;
|
87
|
+
margin: 0;
|
101
88
|
}
|
102
89
|
|
103
90
|
table {
|
@@ -107,29 +94,20 @@
|
|
107
94
|
padding: 0 0 .25em;
|
108
95
|
}
|
109
96
|
|
110
|
-
th:first-child {
|
111
|
-
width: 12em;
|
112
|
-
}
|
113
|
-
|
114
97
|
td {
|
115
|
-
font-size: .9em;
|
116
98
|
padding: .25em 0;
|
99
|
+
font-size: .9em;
|
117
100
|
}
|
118
101
|
|
119
102
|
tr:last-child td {
|
120
|
-
border-bottom:
|
121
|
-
}
|
122
|
-
|
123
|
-
tr th:first-child,
|
124
|
-
tr td:first-child {
|
125
|
-
white-space: nowrap;
|
103
|
+
border-bottom: none;
|
126
104
|
}
|
127
105
|
}
|
128
106
|
|
129
107
|
h1 {
|
130
108
|
font-size: 1.2em;
|
131
|
-
height: auto !important;
|
132
109
|
margin: 0 0 .5em;
|
133
110
|
padding: 0;
|
111
|
+
height: auto !important;
|
134
112
|
}
|
135
113
|
}
|
@@ -1,15 +1,11 @@
|
|
1
|
-
<%= cache [audit,
|
2
|
-
<h1><%= audit.
|
1
|
+
<%= cache [audit, :diff] do %>
|
2
|
+
<h1><%= audit.auditable_type.constantize.model_name.human %></h1>
|
3
3
|
<table class="diff">
|
4
4
|
<thead>
|
5
5
|
<tr>
|
6
6
|
<th><%= t '.attribute' %></th>
|
7
|
-
|
8
|
-
|
9
|
-
<th><%= t '.to' %></th>
|
10
|
-
<% else %>
|
11
|
-
<th><%= t '.value' %></th>
|
12
|
-
<% end %>
|
7
|
+
<th><%= t '.from' %></th>
|
8
|
+
<th><%= t '.to' %></th>
|
13
9
|
</tr>
|
14
10
|
</thead>
|
15
11
|
<tbody>
|
@@ -1,34 +1,29 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
<%
|
4
|
-
|
5
|
-
|
6
|
-
<div id="<%= dom_id audit %>" class="audited-timeline-wrapper <%= 'with-avatars' if with_avatars == true %> ">
|
7
|
-
<% if with_avatars == true && audit.user.present? %>
|
8
|
-
<%= audited_timeline_user_gravatar audit.user %>
|
9
|
-
<% end %>
|
1
|
+
<% audits.reorder('created_at desc').limit(10).decorate.each do |audit| %>
|
2
|
+
<div id="<%= dom_id audit %>" class="audited-timeline-wrapper">
|
3
|
+
<% if audit.user.present? %>
|
4
|
+
<%= audited_timeline_user_gravatar audit.user %>
|
5
|
+
<% end %>
|
10
6
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
<% end %>
|
28
|
-
<%= render 'audited_timeline/diff', audit: audit %>
|
7
|
+
<div class="audited-timeline-item audited-timeline-audit <%= audit.action %>">
|
8
|
+
<div class="audited-timeline-header">
|
9
|
+
<span class="audited-timeline-user">
|
10
|
+
<%= audit.user %>
|
11
|
+
<%= audited_timeline_action_icon audit %>
|
12
|
+
</span>
|
13
|
+
<span class="audited-timeline-date">
|
14
|
+
<%= l audit.created_at, format: :audited_timeline %>
|
15
|
+
</span>
|
16
|
+
</div>
|
17
|
+
<div class="audited-timeline-body">
|
18
|
+
<% if lookup_context.template_exists?(audited_timeline_partial_for(audit), [], true) %>
|
19
|
+
<%= render audited_timeline_partial_for(audit), audit: audit %>
|
20
|
+
<% else %>
|
21
|
+
<% if Rails.env.development? %>
|
22
|
+
<!-- create partial <%= audited_timeline_partial_for(audit) %> to override this table -->
|
29
23
|
<% end %>
|
30
|
-
|
24
|
+
<%= render 'audited_timeline/diff', audit: audit %>
|
25
|
+
<% end %>
|
31
26
|
</div>
|
32
27
|
</div>
|
33
|
-
|
34
|
-
|
28
|
+
</div>
|
29
|
+
<% end %>
|
data/audited_timeline.gemspec
CHANGED
@@ -5,10 +5,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'audited-timeline'
|
8
|
-
spec.version =
|
9
|
-
spec.authors = ['
|
10
|
-
spec.email = ['
|
11
|
-
spec.summary =
|
8
|
+
spec.version = File.read(File.expand_path('../VERSION', __FILE__)).strip
|
9
|
+
spec.authors = ['Raffael Schmid']
|
10
|
+
spec.email = ['raffael.schmid@nine.ch']
|
11
|
+
spec.summary = %q{Frontent to audited}
|
12
12
|
spec.homepage = 'https://github.com/ninech/audited-timeline'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
spec.description = 'audited-timeline provides timeline frontend to audited'
|
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
22
22
|
|
23
|
-
spec.add_runtime_dependency 'audited', '
|
24
|
-
spec.add_runtime_dependency 'rails', '>= 4.0.0'
|
25
|
-
spec.add_runtime_dependency 'draper', '>= 2.1.0'
|
23
|
+
spec.add_runtime_dependency 'audited', '>= 4.2.0', '< 5.0.0'
|
24
|
+
spec.add_runtime_dependency 'rails', '>= 4.0.0', '< 5.0.0'
|
25
|
+
spec.add_runtime_dependency 'draper', '>= 2.1.0', '< 3.0.0'
|
26
26
|
end
|
@@ -3,6 +3,15 @@ require 'draper'
|
|
3
3
|
module AuditedTimeline
|
4
4
|
class AuditDecorator < ::Draper::Decorator
|
5
5
|
delegate_all
|
6
|
+
delegate :fullname, to: :user, allow_nil: true, prefix: true
|
7
|
+
|
8
|
+
def audited_contact
|
9
|
+
Contact.unscoped.find(object.audited_changes['contact_id'])
|
10
|
+
end
|
11
|
+
|
12
|
+
def audited_role
|
13
|
+
AccountContact.roles.key(object.audited_changes['role'])
|
14
|
+
end
|
6
15
|
|
7
16
|
def human_audited_changes
|
8
17
|
human_changes = {}
|
@@ -17,13 +26,6 @@ module AuditedTimeline
|
|
17
26
|
human_changes
|
18
27
|
end
|
19
28
|
|
20
|
-
def audited_title
|
21
|
-
[
|
22
|
-
auditable_type.constantize.model_name.human,
|
23
|
-
object_name_by_type_and_value(auditable_type, auditable_id)
|
24
|
-
].join(' ')
|
25
|
-
end
|
26
|
-
|
27
29
|
private
|
28
30
|
|
29
31
|
def human_value(field, value)
|
@@ -45,15 +47,6 @@ module AuditedTimeline
|
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
|
-
def object_name_by_type_and_value(type, value)
|
49
|
-
return nil unless value
|
50
|
-
begin
|
51
|
-
type.constantize.unscoped.find(value)
|
52
|
-
rescue
|
53
|
-
nil
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
50
|
def enum_value(field, value)
|
58
51
|
if value.kind_of?(Integer)
|
59
52
|
enum_values(field).key(value)
|
@@ -13,7 +13,7 @@ module AuditedTimeline
|
|
13
13
|
|
14
14
|
def audited_timeline_gravatar_url(email)
|
15
15
|
email_hash = Digest::MD5.hexdigest(email.to_s)
|
16
|
-
"
|
16
|
+
"http://www.gravatar.com/avatar/#{email_hash}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def audited_timeline_user_gravatar(user, options = {})
|
@@ -22,7 +22,7 @@ module AuditedTimeline
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def audited_timeline_partial_for(audit)
|
25
|
-
"audits/#{audit.auditable_type.underscore}
|
25
|
+
"audits/#{audit.auditable_type.underscore}.#{audit.action}"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
metadata
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: audited-timeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Raffael Schmid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: audited
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.2.0
|
34
|
+
- - "<"
|
32
35
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
36
|
+
version: 5.0.0
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
43
|
+
version: 4.2.0
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 5.0.0
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rails
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +51,9 @@ dependencies:
|
|
45
51
|
- - ">="
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: 4.0.0
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 5.0.0
|
48
57
|
type: :runtime
|
49
58
|
prerelease: false
|
50
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,6 +61,9 @@ dependencies:
|
|
52
61
|
- - ">="
|
53
62
|
- !ruby/object:Gem::Version
|
54
63
|
version: 4.0.0
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 5.0.0
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: draper
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,6 +71,9 @@ dependencies:
|
|
59
71
|
- - ">="
|
60
72
|
- !ruby/object:Gem::Version
|
61
73
|
version: 2.1.0
|
74
|
+
- - "<"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 3.0.0
|
62
77
|
type: :runtime
|
63
78
|
prerelease: false
|
64
79
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -66,28 +81,26 @@ dependencies:
|
|
66
81
|
- - ">="
|
67
82
|
- !ruby/object:Gem::Version
|
68
83
|
version: 2.1.0
|
84
|
+
- - "<"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 3.0.0
|
69
87
|
description: audited-timeline provides timeline frontend to audited
|
70
88
|
email:
|
71
|
-
-
|
89
|
+
- raffael.schmid@nine.ch
|
72
90
|
executables: []
|
73
91
|
extensions: []
|
74
92
|
extra_rdoc_files: []
|
75
93
|
files:
|
76
|
-
- ".github/dependabot.yml"
|
77
|
-
- ".github/workflows/codeql-analysis.yml"
|
78
|
-
- ".github/workflows/gem-build.yml"
|
79
|
-
- ".github/workflows/gem-push.yml"
|
80
94
|
- ".ruby-gemset"
|
81
95
|
- ".ruby-version"
|
82
|
-
- Dockerfile
|
83
96
|
- Gemfile
|
84
97
|
- Gemfile.lock
|
85
98
|
- README.md
|
86
99
|
- Rakefile
|
100
|
+
- VERSION
|
87
101
|
- app/assets/stylesheets/audited-timeline.scss
|
88
102
|
- app/assets/stylesheets/audited-timeline/_audits.scss
|
89
103
|
- app/assets/stylesheets/audited-timeline/_timeline.scss
|
90
|
-
- app/assets/stylesheets/audited-timeline/_variables.scss
|
91
104
|
- app/views/audited_timeline/_diff.html.erb
|
92
105
|
- app/views/audited_timeline/_diff_create.html.erb
|
93
106
|
- app/views/audited_timeline/_diff_destroy.html.erb
|
@@ -96,7 +109,6 @@ files:
|
|
96
109
|
- audited_timeline.gemspec
|
97
110
|
- config/locales/audited_timeline.de.yml
|
98
111
|
- config/locales/audited_timeline.en.yml
|
99
|
-
- docker-compose.yml
|
100
112
|
- images/screenshot.png
|
101
113
|
- lib/audited-timeline.rb
|
102
114
|
- lib/audited_timeline.rb
|
@@ -124,7 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
136
|
- !ruby/object:Gem::Version
|
125
137
|
version: '0'
|
126
138
|
requirements: []
|
127
|
-
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 2.4.5
|
128
141
|
signing_key:
|
129
142
|
specification_version: 4
|
130
143
|
summary: Frontent to audited
|
data/.github/dependabot.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
name: "CodeQL"
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [master]
|
6
|
-
pull_request:
|
7
|
-
branches: [master]
|
8
|
-
schedule:
|
9
|
-
- cron: "25 2 * * 6"
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
analyze:
|
13
|
-
name: Analyze
|
14
|
-
runs-on: ubuntu-latest
|
15
|
-
permissions:
|
16
|
-
actions: read
|
17
|
-
contents: read
|
18
|
-
security-events: write
|
19
|
-
steps:
|
20
|
-
- name: Checkout repository
|
21
|
-
uses: actions/checkout@v3
|
22
|
-
- name: Initialize CodeQL
|
23
|
-
uses: github/codeql-action/init@v2
|
24
|
-
- name: Autobuild
|
25
|
-
uses: github/codeql-action/autobuild@v2
|
26
|
-
- name: Perform CodeQL Analysis
|
27
|
-
uses: github/codeql-action/analyze@v2
|
@@ -1,18 +0,0 @@
|
|
1
|
-
name: Build Ruby Gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
branches: [master]
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
build:
|
9
|
-
name: Build
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
steps:
|
12
|
-
- uses: actions/checkout@v2
|
13
|
-
with:
|
14
|
-
fetch-depth: 0
|
15
|
-
- uses: ruby/setup-ruby@v1
|
16
|
-
with:
|
17
|
-
ruby-version: 3.0
|
18
|
-
- run: gem build *.gemspec
|
@@ -1,27 +0,0 @@
|
|
1
|
-
name: Build + Publish Ruby Gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- "*"
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
build:
|
10
|
-
name: Build + Publish
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
steps:
|
13
|
-
- uses: actions/checkout@v2
|
14
|
-
- uses: ruby/setup-ruby@v1
|
15
|
-
with:
|
16
|
-
ruby-version: 3.0
|
17
|
-
- name: Publish to RubyGems
|
18
|
-
run: |
|
19
|
-
mkdir -p $HOME/.gem
|
20
|
-
touch $HOME/.gem/credentials
|
21
|
-
chmod 0600 $HOME/.gem/credentials
|
22
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
23
|
-
gem build *.gemspec
|
24
|
-
gem push *.gem
|
25
|
-
env:
|
26
|
-
GEM_VERSION: ${{ vars.GITHUB_REF_NAME }}
|
27
|
-
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
data/Dockerfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
FROM ruby:3.0-alpine
|
2
|
-
|
3
|
-
WORKDIR /app
|
4
|
-
|
5
|
-
RUN apk add -U \
|
6
|
-
bash less tzdata shared-mime-info build-base libc6-compat git && \
|
7
|
-
gem install bundler bundler-audit
|
8
|
-
|
9
|
-
COPY *.gemspec Gemfile Gemfile.lock VERSION ./
|
10
|
-
RUN BUNDLER_VERSION=$(grep -A 1 "BUNDLED WITH" Gemfile.lock | grep -v "BUNDLED WITH" | tr -d '[:space:]') && \
|
11
|
-
gem install "bundler:$BUNDLER_VERSION" && \
|
12
|
-
bundle install --jobs $(nproc)
|
13
|
-
|
14
|
-
COPY . ./
|
@@ -1,12 +0,0 @@
|
|
1
|
-
$green: #27AE60 !default;
|
2
|
-
$red: #E74C3C !default;
|
3
|
-
$blue: #009ad7 !default;
|
4
|
-
$light-gray: #CDCFCE !default;
|
5
|
-
$dark-gray: #333 !default;
|
6
|
-
|
7
|
-
$base-line-height: 1.5 !default;
|
8
|
-
$base-spacing: $base-line-height * 1em !default;
|
9
|
-
|
10
|
-
$base-border-color: $light-gray !default;
|
11
|
-
$base-border: 1px solid $base-border-color !default;
|
12
|
-
$base-border-radius: 3px !default;
|