paper_trail_manager 0.9.0 → 1.0.0
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 +4 -4
- data/.gitignore +1 -0
- data/{CHANGES.md → CHANGELOG.md} +6 -0
- data/README.md +17 -1
- data/app/assets/stylesheets/paper_trail_manager/changes.css +256 -0
- data/paper_trail_manager.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f28e3a746ba34c98e03d86d36e05e5588ceeed50ad478f9736084722950d08d
|
|
4
|
+
data.tar.gz: 6d0746fb02ce9a984387078763c77b54580bb6efa63b2ed0ca72117a7e6fd083
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43f7cac000943029af95ee1c1b3544708afb6bf2ac47d61c0e56aea025d15c32d9b9d1d2fdd1a3f730b0d2c78e120f7c79cc02a9c075fa37e3db875fe0a0ad46
|
|
7
|
+
data.tar.gz: 30f45eb5c5b25386daaea0f89fad1405045ca80dd67d27fb1082061139614e5d0fe327ef3c3f2425f62fe7f94d83296d8e8a64ba1583f8985dfdce8da6460e85
|
data/.gitignore
CHANGED
data/{CHANGES.md → CHANGELOG.md}
RENAMED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
Changes to `paper_trail_manager`
|
|
2
2
|
================================
|
|
3
3
|
|
|
4
|
+
* 1.0.0
|
|
5
|
+
* Ship default stylesheet for changes views (table formatting, event color coding, diff highlighting, rollback button, date filter form)
|
|
6
|
+
* Include via `stylesheet_link_tag` or `require` in application.css
|
|
7
|
+
* Low-specificity selectors for easy overriding by host apps
|
|
8
|
+
* Add `.gitignore` for `.gem` build artifacts
|
|
9
|
+
|
|
4
10
|
* 0.9.0
|
|
5
11
|
* Add date range filtering to changes index via `from` and `to` query parameters
|
|
6
12
|
* Add date filter UI with date inputs, filter button, and clear link
|
data/README.md
CHANGED
|
@@ -45,6 +45,22 @@ resources :changes, controller: 'paper_trail_manager/changes'
|
|
|
45
45
|
|
|
46
46
|
Restart your server and visit `/changes` to browse, view, and revert your changes.
|
|
47
47
|
|
|
48
|
+
### Stylesheet (optional)
|
|
49
|
+
|
|
50
|
+
A default stylesheet is included. Add to your layout or application CSS:
|
|
51
|
+
|
|
52
|
+
```erb
|
|
53
|
+
<%= stylesheet_link_tag 'paper_trail_manager/changes' %>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or require it in `app/assets/stylesheets/application.css`:
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
/*= require paper_trail_manager/changes */
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The styles are low-specificity and easy to override in your own stylesheet.
|
|
63
|
+
|
|
48
64
|
## Configuration
|
|
49
65
|
|
|
50
66
|
Create an initializer (e.g. `config/initializers/paper_trail_manager.rb`) to customize behavior.
|
|
@@ -162,7 +178,7 @@ CI runs each combination across Ruby 3.1, 3.2, and 3.3 (18 jobs total).
|
|
|
162
178
|
- **Tests:** Added unit tests for authorization block delegation
|
|
163
179
|
- Modernized for Ruby 3.1–3.3 and Rails 7.0–7.1
|
|
164
180
|
|
|
165
|
-
See [
|
|
181
|
+
See [CHANGELOG.md](CHANGELOG.md) for full history.
|
|
166
182
|
|
|
167
183
|
## License
|
|
168
184
|
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* PaperTrailManager — Default Stylesheet
|
|
3
|
+
*
|
|
4
|
+
* Include in your layout:
|
|
5
|
+
* <%= stylesheet_link_tag 'paper_trail_manager/changes' %>
|
|
6
|
+
*
|
|
7
|
+
* Or import in your application.css:
|
|
8
|
+
* *= require paper_trail_manager/changes
|
|
9
|
+
*
|
|
10
|
+
* Override any styles in your own stylesheet — these are intentionally
|
|
11
|
+
* low-specificity so your app's styles take precedence.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/* ── Table ────────────────────────────────────────────────── */
|
|
15
|
+
|
|
16
|
+
.changes_table {
|
|
17
|
+
width: 100%;
|
|
18
|
+
border-collapse: collapse;
|
|
19
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
line-height: 1.5;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.changes_table thead {
|
|
25
|
+
border-bottom: 2px solid #dee2e6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.changes_table th {
|
|
29
|
+
padding: 10px 12px;
|
|
30
|
+
text-align: left;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
color: #495057;
|
|
33
|
+
background-color: #f8f9fa;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.changes_table td {
|
|
37
|
+
padding: 10px 12px;
|
|
38
|
+
vertical-align: top;
|
|
39
|
+
border-bottom: 1px solid #e9ecef;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.changes_table tfoot td {
|
|
43
|
+
padding: 12px;
|
|
44
|
+
border-bottom: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ── Change Row ───────────────────────────────────────────── */
|
|
48
|
+
|
|
49
|
+
.change_row {
|
|
50
|
+
transition: background-color 0.15s ease;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.change_row:hover {
|
|
54
|
+
background-color: #f8f9fa;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Event-specific row colors */
|
|
58
|
+
.change_event_create {
|
|
59
|
+
border-left: 3px solid #28a745;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.change_event_update {
|
|
63
|
+
border-left: 3px solid #007bff;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.change_event_destroy {
|
|
67
|
+
border-left: 3px solid #dc3545;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ── Time Column ──────────────────────────────────────────── */
|
|
71
|
+
|
|
72
|
+
.change_time {
|
|
73
|
+
width: 140px;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.change_id {
|
|
78
|
+
display: block;
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
color: #868e96;
|
|
81
|
+
margin-bottom: 2px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.change_time .date {
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
color: #343a40;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.change_time .time {
|
|
90
|
+
font-size: 13px;
|
|
91
|
+
color: #868e96;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ── Details Column ───────────────────────────────────────── */
|
|
95
|
+
|
|
96
|
+
.change_details_description {
|
|
97
|
+
margin: 0 0 8px 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.change_details_description .event {
|
|
101
|
+
display: inline-block;
|
|
102
|
+
padding: 2px 8px;
|
|
103
|
+
border-radius: 3px;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
text-transform: uppercase;
|
|
107
|
+
letter-spacing: 0.5px;
|
|
108
|
+
margin-right: 4px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.change_event_create .event {
|
|
112
|
+
background-color: #d4edda;
|
|
113
|
+
color: #155724;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.change_event_update .event {
|
|
117
|
+
background-color: #cce5ff;
|
|
118
|
+
color: #004085;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.change_event_destroy .event {
|
|
122
|
+
background-color: #f8d7da;
|
|
123
|
+
color: #721c24;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.change_item {
|
|
127
|
+
color: #007bff;
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.change_item:hover {
|
|
132
|
+
text-decoration: underline;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* ── Diff Table ───────────────────────────────────────────── */
|
|
136
|
+
|
|
137
|
+
.change_details_table {
|
|
138
|
+
width: 100%;
|
|
139
|
+
border-collapse: collapse;
|
|
140
|
+
font-size: 13px;
|
|
141
|
+
margin-top: 6px;
|
|
142
|
+
background-color: #f8f9fa;
|
|
143
|
+
border-radius: 4px;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.change_details_table td {
|
|
148
|
+
padding: 4px 8px;
|
|
149
|
+
border-bottom: 1px solid #e9ecef;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.change_detail_key {
|
|
153
|
+
font-weight: 500;
|
|
154
|
+
color: #495057;
|
|
155
|
+
width: 20%;
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.change_detail_value.previous {
|
|
160
|
+
color: #dc3545;
|
|
161
|
+
background-color: #fff5f5;
|
|
162
|
+
word-break: break-word;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.change_detail_value.current {
|
|
166
|
+
color: #28a745;
|
|
167
|
+
background-color: #f0fff4;
|
|
168
|
+
word-break: break-word;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.change_detail_spacer {
|
|
172
|
+
text-align: center;
|
|
173
|
+
width: 30px;
|
|
174
|
+
color: #868e96;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.change_details_table .even {
|
|
178
|
+
background-color: #f8f9fa;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.change_details_table .odd {
|
|
182
|
+
background-color: #ffffff;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* ── Rollback Button ──────────────────────────────────────── */
|
|
186
|
+
|
|
187
|
+
.rollback {
|
|
188
|
+
display: inline-block;
|
|
189
|
+
padding: 3px 10px;
|
|
190
|
+
font-size: 12px;
|
|
191
|
+
font-weight: 500;
|
|
192
|
+
color: #856404;
|
|
193
|
+
background-color: #fff3cd;
|
|
194
|
+
border: 1px solid #ffc107;
|
|
195
|
+
border-radius: 3px;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
margin-left: 8px;
|
|
198
|
+
transition: background-color 0.15s ease;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.rollback:hover {
|
|
202
|
+
background-color: #ffc107;
|
|
203
|
+
color: #533f03;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* ── Date Filter Form ─────────────────────────────────────── */
|
|
207
|
+
|
|
208
|
+
.changes_date_filter {
|
|
209
|
+
display: flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
gap: 8px;
|
|
212
|
+
margin-bottom: 16px;
|
|
213
|
+
flex-wrap: wrap;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.changes_date_filter label {
|
|
217
|
+
font-size: 13px;
|
|
218
|
+
font-weight: 500;
|
|
219
|
+
color: #495057;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.changes_date_filter input[type="date"] {
|
|
223
|
+
padding: 4px 8px;
|
|
224
|
+
border: 1px solid #ced4da;
|
|
225
|
+
border-radius: 4px;
|
|
226
|
+
font-size: 13px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.changes_date_filter input[type="submit"] {
|
|
230
|
+
padding: 4px 12px;
|
|
231
|
+
font-size: 13px;
|
|
232
|
+
font-weight: 500;
|
|
233
|
+
color: #fff;
|
|
234
|
+
background-color: #007bff;
|
|
235
|
+
border: 1px solid #007bff;
|
|
236
|
+
border-radius: 4px;
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.changes_date_filter input[type="submit"]:hover {
|
|
241
|
+
background-color: #0056b3;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.clear_filter {
|
|
245
|
+
font-size: 13px;
|
|
246
|
+
color: #868e96;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* ── Empty State ──────────────────────────────────────────── */
|
|
250
|
+
|
|
251
|
+
.changes_table tbody td[colspan] {
|
|
252
|
+
text-align: center;
|
|
253
|
+
color: #868e96;
|
|
254
|
+
padding: 24px;
|
|
255
|
+
font-style: italic;
|
|
256
|
+
}
|
data/paper_trail_manager.gemspec
CHANGED
|
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'paper_trail_manager'
|
|
8
|
-
spec.version = '0.
|
|
8
|
+
spec.version = '1.0.0'
|
|
9
9
|
spec.authors = ['Igal Koshevoy', 'Reid Beels']
|
|
10
10
|
spec.email = ['mail@reidbeels.com']
|
|
11
11
|
spec.summary = 'A user interface for `paper_trail` versioning data in Rails applications.'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paper_trail_manager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Igal Koshevoy
|
|
@@ -197,11 +197,12 @@ files:
|
|
|
197
197
|
- ".rubocop.yml"
|
|
198
198
|
- ".ruby-version"
|
|
199
199
|
- Appraisals
|
|
200
|
-
-
|
|
200
|
+
- CHANGELOG.md
|
|
201
201
|
- Gemfile
|
|
202
202
|
- LICENSE.txt
|
|
203
203
|
- README.md
|
|
204
204
|
- Rakefile
|
|
205
|
+
- app/assets/stylesheets/paper_trail_manager/changes.css
|
|
205
206
|
- app/controllers/paper_trail_manager/changes_controller.rb
|
|
206
207
|
- app/helpers/paper_trail_manager/changes_helper.rb
|
|
207
208
|
- app/views/paper_trail_manager/changes/_version.html.erb
|