sail 3.4.0 → 3.5.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 +1 -1
- data/app/assets/images/sail/angle-left.svg +1 -1
- data/app/assets/images/sail/angle-right.svg +1 -1
- data/app/assets/images/sail/checkmark.svg +1 -0
- data/app/assets/images/sail/cog.svg +1 -1
- data/app/assets/images/sail/error.svg +1 -0
- data/app/assets/images/sail/refresh.svg +1 -1
- data/app/assets/images/sail/sort.svg +1 -1
- data/app/assets/javascripts/sail/settings.js +14 -1
- data/app/assets/stylesheets/sail/application.css.erb +10 -47
- data/app/assets/stylesheets/sail/settings.css +102 -83
- data/app/controllers/sail/settings_controller.rb +2 -13
- data/app/models/sail/setting.rb +1 -1
- data/app/views/layouts/sail/application.html.erb +0 -6
- data/app/views/sail/profiles/_profile.html.erb +29 -17
- data/app/views/sail/settings/_guide_modal.html.erb +2 -2
- data/app/views/sail/settings/_setting.html.erb +74 -52
- data/app/views/sail/settings/index.html.erb +8 -14
- data/app/views/sail/settings/update.js.erb +4 -4
- data/config/locales/en.yml +1 -4
- data/lib/generators/sail/install/install_generator.rb +4 -0
- data/lib/generators/sail/install/templates/sail.yml.tt +5 -0
- data/lib/sail/constant_collection.rb +1 -2
- data/lib/sail/engine.rb +2 -2
- data/lib/sail/version.rb +1 -1
- metadata +6 -4
- data/app/views/sail/settings/_setting_minimal.html.erb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c8c9fc861985a4fa65f4f777d4e9739a333bf8d27baf73c15e233421b85f30
|
4
|
+
data.tar.gz: b4fa1e809ddbe24599276a7af84fde31cbf6775f4f06e55d549019884359531e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97636b73c70c7d761bfc4519b33717578d9d97ec96a5e43b227bdb0949cc4baa1ba71c638a9c1107bec0feedbe4732a83a120e7b8db5adb4a47ccbe17a33d215
|
7
|
+
data.tar.gz: 75dd8458863ffdb53b0967b437f472c3ccc85b3909f3cef8463334dc4b34deba208d5dbfe52a3db182fe43e0788ad05020f47732180eaad860fbc8594cb3b614
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
![dashboard](https://raw.githubusercontent.com/vinistock/sail/master/app/assets/images/sail/sail.
|
1
|
+
![dashboard](https://raw.githubusercontent.com/vinistock/sail/master/app/assets/images/sail/sail.gif)
|
2
2
|
|
3
3
|
[![Build Status](https://github.com/vinistock/sail/workflows/Ruby%20on%20Rails/badge.svg?branch=master)](https://github.com/vinistock/sail/actions) [![codecov](https://codecov.io/gh/vinistock/sail/branch/master/graph/badge.svg)](https://codecov.io/gh/vinistock/sail) [![Gem Version](https://badge.fury.io/rb/sail.svg)](https://badge.fury.io/rb/sail) ![](http://ruby-gem-downloads-badge.herokuapp.com/sail?color=brightgreen&type=total) [![Mentioned in Awesome Ruby](https://awesome.re/mentioned-badge.svg)](https://github.com/markets/awesome-ruby)
|
4
4
|
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M7.05 9.293L6.343 10 12 15.657l1.414-1.414L9.172 10l4.242-4.243L12 4.343z"/></svg>
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M12.95 10.707l.707-.707L8 4.343 6.586 5.757 10.828 10l-4.242 4.243L8 15.657l4.95-4.95z"/></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3.94 6.5L2.22 3.64l1.42-1.42L6.5 3.94c.52-.3 1.1-.54 1.7-.7L9 0h2l.8 3.24c.6.16 1.18.4 1.7.7l2.86-1.72 1.42 1.42-1.72 2.86c.3.52.54 1.1.7 1.7L20 9v2l-3.24.8c-.16.6-.4 1.18-.7 1.7l1.72 2.86-1.42 1.42-2.86-1.72c-.52.3-1.1.54-1.7.7L11 20H9l-.8-3.24c-.6-.16-1.18-.4-1.7-.7l-2.86 1.72-1.42-1.42 1.72-2.86c-.3-.52-.54-1.1-.7-1.7L0 11V9l3.24-.8c.16-.6.4-1.18.7-1.7zM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"/></svg>
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 3v2a5 5 0 0 0-3.54 8.54l-1.41 1.41A7 7 0 0 1 10 3zm4.95 2.05A7 7 0 0 1 10 17v-2a5 5 0 0 0 3.54-8.54l1.41-1.41zM10 20l-4-4 4-4v8zm0-12V0l4 4-4 4z"/></svg>
|
@@ -1 +1 @@
|
|
1
|
-
<svg
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z"/></svg>
|
@@ -16,6 +16,7 @@ let dashboardBody = document.getElementById("settings-dashboard");
|
|
16
16
|
let guideButton = document.getElementById("btn-guide");
|
17
17
|
let guide = document.getElementById("guide-modal");
|
18
18
|
let guideSections = guide.getElementsByTagName("summary");
|
19
|
+
let cardTitles = document.getElementsByClassName("card-title");
|
19
20
|
let i;
|
20
21
|
|
21
22
|
function submitSearch() {
|
@@ -122,7 +123,9 @@ function refreshClick() {
|
|
122
123
|
|
123
124
|
for(i = 0; i < refreshButtons.length; i++) refreshButtons[i].addEventListener("click", refreshClick);
|
124
125
|
|
125
|
-
|
126
|
+
/*
|
127
|
+
Guide related functions
|
128
|
+
*/
|
126
129
|
|
127
130
|
function sectionClick() {
|
128
131
|
for(i = 0; i < guideSections.length; i++) {
|
@@ -135,3 +138,13 @@ function sectionClick() {
|
|
135
138
|
}
|
136
139
|
|
137
140
|
for(i = 0; i < guideSections.length; i++) guideSections[i].addEventListener("click", sectionClick);
|
141
|
+
|
142
|
+
/*
|
143
|
+
Cards related functions
|
144
|
+
*/
|
145
|
+
|
146
|
+
function flipCard() {
|
147
|
+
this.parentElement.parentElement.classList.toggle("flipped");
|
148
|
+
}
|
149
|
+
|
150
|
+
for(i = 0; i < cardTitles.length; i++) cardTitles[i].addEventListener("click", flipCard);
|
@@ -60,13 +60,6 @@ html, body {
|
|
60
60
|
clear: both;
|
61
61
|
}
|
62
62
|
|
63
|
-
@media (max-width: 413px) {
|
64
|
-
.clear-xs {
|
65
|
-
clear: both;
|
66
|
-
margin-top: 8px;
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
63
|
#nav-bar {
|
71
64
|
background-color: var(--lead);
|
72
65
|
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15), 0 5px 12px rgba(0, 0, 0, 0.1);
|
@@ -142,19 +135,6 @@ html, body {
|
|
142
135
|
}
|
143
136
|
}
|
144
137
|
|
145
|
-
#nav-bar #btn-monitor-mode,
|
146
|
-
#nav-bar #btn-regular-mode {
|
147
|
-
right: 80px;
|
148
|
-
padding: 1px 7px 2px 7px;
|
149
|
-
}
|
150
|
-
|
151
|
-
@media (min-width: 1200px) {
|
152
|
-
#nav-bar #btn-monitor-mode,
|
153
|
-
#nav-bar #btn-regular-mode {
|
154
|
-
right: 120px;
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
138
|
#pagination {
|
159
139
|
text-align: center;
|
160
140
|
margin-top: 2rem;
|
@@ -263,13 +243,7 @@ html, body {
|
|
263
243
|
outline: none;
|
264
244
|
}
|
265
245
|
|
266
|
-
#profiles-modal .profile-entry .inline-form {
|
267
|
-
float: right;
|
268
|
-
}
|
269
|
-
|
270
246
|
#profiles-modal .profile-entry button {
|
271
|
-
float: right;
|
272
|
-
margin-left: 5px;
|
273
247
|
padding: 10px;
|
274
248
|
}
|
275
249
|
|
@@ -278,27 +252,11 @@ html, body {
|
|
278
252
|
top: 10px;
|
279
253
|
}
|
280
254
|
|
281
|
-
|
282
|
-
|
283
|
-
float: left;
|
284
|
-
}
|
285
|
-
}
|
286
|
-
|
287
|
-
@media (min-width: 1200px) {
|
288
|
-
#profiles-modal .profile-entry .entry-name {
|
289
|
-
margin-left: 250px;
|
290
|
-
}
|
255
|
+
#profiles-modal .buttons button {
|
256
|
+
margin: 0 5px 0 5px;
|
291
257
|
}
|
292
258
|
|
293
259
|
@media (max-width: 767px) {
|
294
|
-
#profiles-modal .profile-entry .inline-form {
|
295
|
-
margin-right: 3%;
|
296
|
-
}
|
297
|
-
|
298
|
-
#profiles-modal .profile-entry .inline-form:first-child {
|
299
|
-
clear: both;
|
300
|
-
}
|
301
|
-
|
302
260
|
#profiles-modal .profile-entry .entry-name {
|
303
261
|
width: 90%;
|
304
262
|
margin-bottom: 15px;
|
@@ -310,7 +268,6 @@ html, body {
|
|
310
268
|
}
|
311
269
|
|
312
270
|
#profiles-modal .profile-entry .active-indicator {
|
313
|
-
float: left;
|
314
271
|
position: relative;
|
315
272
|
top: 7px;
|
316
273
|
}
|
@@ -324,7 +281,6 @@ html, body {
|
|
324
281
|
}
|
325
282
|
|
326
283
|
#profiles-modal .profile-entry .errors-indicator {
|
327
|
-
float: left;
|
328
284
|
position: relative;
|
329
285
|
top: 9px;
|
330
286
|
left: 15px;
|
@@ -340,7 +296,6 @@ html, body {
|
|
340
296
|
position: relative;
|
341
297
|
top: 10px;
|
342
298
|
text-overflow: ellipsis;
|
343
|
-
|
344
299
|
}
|
345
300
|
|
346
301
|
#profiles-modal #new-profile-input:focus {
|
@@ -372,6 +327,14 @@ html, body {
|
|
372
327
|
outline: none;
|
373
328
|
}
|
374
329
|
|
330
|
+
#guide-modal details > summary {
|
331
|
+
list-style: none;
|
332
|
+
}
|
333
|
+
|
334
|
+
#guide-modal details > summary::-webkit-details-marker {
|
335
|
+
display: none;
|
336
|
+
}
|
337
|
+
|
375
338
|
#guide-modal details summary:focus,
|
376
339
|
#guide-modal details summary:hover {
|
377
340
|
border-color: var(--tangerine);
|
@@ -16,15 +16,19 @@
|
|
16
16
|
#settings-dashboard #settings-container {
|
17
17
|
margin-top: 1rem;
|
18
18
|
text-align: center;
|
19
|
+
display: flex;
|
20
|
+
flex-wrap: wrap;
|
21
|
+
justify-content: flex-start;
|
22
|
+
padding: 0 15px 0 15px;
|
19
23
|
}
|
20
24
|
|
21
25
|
#settings-dashboard .card {
|
22
|
-
|
26
|
+
flex: 0 1 auto;
|
27
|
+
max-height: 220px;
|
23
28
|
background-color: white;
|
24
29
|
margin: 1rem .75rem;
|
25
|
-
display: inline-block;
|
26
30
|
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
27
|
-
padding: 10px;
|
31
|
+
padding: 0 10px 0 10px;
|
28
32
|
z-index: 2;
|
29
33
|
width: 90%;
|
30
34
|
-webkit-box-sizing: border-box;
|
@@ -33,14 +37,41 @@
|
|
33
37
|
-webkit-border-radius: 5px;
|
34
38
|
-moz-border-radius: 5px;
|
35
39
|
border-radius: 5px;
|
40
|
+
|
41
|
+
transition-duration: 0.6s;
|
42
|
+
transition-timing-function: ease-in-out;
|
43
|
+
transform-style: preserve-3d;
|
44
|
+
}
|
45
|
+
|
46
|
+
#settings-dashboard .card .card-title {
|
47
|
+
transition: color 500ms ease-in;
|
48
|
+
}
|
49
|
+
|
50
|
+
#settings-dashboard .card .card-title:hover {
|
51
|
+
color: var(--tangerine);
|
52
|
+
cursor: pointer;
|
53
|
+
}
|
54
|
+
|
55
|
+
#settings-dashboard .card .front,
|
56
|
+
#settings-dashboard .card .back {
|
57
|
+
backface-visibility: hidden;
|
58
|
+
transform: rotateX(0deg);
|
59
|
+
height: 61%;
|
60
|
+
}
|
61
|
+
|
62
|
+
#settings-dashboard .card .back {
|
63
|
+
transform: rotateY(-180deg);
|
64
|
+
position: relative;
|
65
|
+
bottom: 155px;
|
36
66
|
}
|
37
67
|
|
38
|
-
#settings-dashboard .card
|
39
|
-
|
68
|
+
#settings-dashboard .card.flipped {
|
69
|
+
transform: rotateY(-180deg);
|
40
70
|
}
|
41
71
|
|
42
72
|
#settings-dashboard .card .relevancy-score {
|
43
|
-
|
73
|
+
position: relative;
|
74
|
+
bottom: 5px;
|
44
75
|
color: var(--dark-aluminium);
|
45
76
|
}
|
46
77
|
|
@@ -52,26 +83,14 @@
|
|
52
83
|
|
53
84
|
@media (min-width: 1200px) {
|
54
85
|
#settings-dashboard .card {
|
55
|
-
width:
|
86
|
+
width: 18%;
|
56
87
|
}
|
57
88
|
}
|
58
89
|
|
59
|
-
#settings-dashboard .card .card-body-container {
|
60
|
-
display: table;
|
61
|
-
width: 100%;
|
62
|
-
}
|
63
|
-
|
64
|
-
#settings-dashboard .card .card-body {
|
65
|
-
height: 80px;
|
66
|
-
width: 100%;
|
67
|
-
display: table-cell;
|
68
|
-
vertical-align: bottom;
|
69
|
-
}
|
70
|
-
|
71
90
|
#settings-dashboard .card .tag {
|
72
|
-
-webkit-border-radius:
|
73
|
-
-moz-border-radius:
|
74
|
-
border-radius:
|
91
|
+
-webkit-border-radius: 20px;
|
92
|
+
-moz-border-radius: 20px;
|
93
|
+
border-radius: 20px;
|
75
94
|
padding: 10px;
|
76
95
|
color: var(--main-black);
|
77
96
|
font-size: 14px;
|
@@ -94,11 +113,6 @@
|
|
94
113
|
}
|
95
114
|
|
96
115
|
#settings-dashboard .card .setting-description {
|
97
|
-
clear: both;
|
98
|
-
padding: 25px 15px 15px 15px;
|
99
|
-
text-overflow: ellipsis;
|
100
|
-
white-space: nowrap;
|
101
|
-
overflow: hidden;
|
102
116
|
-webkit-animation: fadeIn 0.5s;
|
103
117
|
animation: fadeIn 0.5s;
|
104
118
|
color: var(--darker-aluminium);
|
@@ -111,16 +125,10 @@
|
|
111
125
|
}
|
112
126
|
}
|
113
127
|
|
114
|
-
#settings-dashboard .card .label-container {
|
115
|
-
float: right;
|
116
|
-
margin-top: 5px;
|
117
|
-
}
|
118
|
-
|
119
128
|
#settings-dashboard .card .value-input {
|
120
|
-
width:
|
121
|
-
margin-bottom: 10px;
|
122
|
-
font-size: 22px;
|
129
|
+
width: 95%;
|
123
130
|
text-align: center;
|
131
|
+
font-size: 22px;
|
124
132
|
border: none;
|
125
133
|
border-bottom: 2px solid var(--aluminium);
|
126
134
|
-webkit-border-radius: 0;
|
@@ -140,42 +148,16 @@
|
|
140
148
|
outline: none;
|
141
149
|
}
|
142
150
|
|
143
|
-
#settings-dashboard .card .date-picker {
|
144
|
-
position: relative;
|
145
|
-
bottom: 10px;
|
146
|
-
border: none;
|
147
|
-
border-bottom: 2px solid var(--aluminium);
|
148
|
-
-webkit-border-radius: 0;
|
149
|
-
-moz-border-radius: 0;
|
150
|
-
border-radius: 0;
|
151
|
-
width: 100%;
|
152
|
-
text-align: center;
|
153
|
-
font-size: 22px;
|
154
|
-
padding: 0;
|
155
|
-
-webkit-transition : border .25s ease-in;
|
156
|
-
-moz-transition : border .25s ease-in;
|
157
|
-
-o-transition : border .25s ease-in;
|
158
|
-
transition : border .25s ease-in;
|
159
|
-
outline: none;
|
160
|
-
}
|
161
|
-
|
162
|
-
#settings-dashboard .card .date-picker:focus,
|
163
|
-
#settings-dashboard .card .date-picker:hover {
|
164
|
-
border-color: var(--tangerine);
|
165
|
-
outline: none;
|
166
|
-
}
|
167
|
-
|
168
151
|
#settings-dashboard .card .value-slider {
|
169
152
|
-webkit-appearance: none;
|
170
|
-
width: 100%;
|
171
153
|
height: 15px;
|
154
|
+
width: 90%;
|
172
155
|
border-radius: 5px;
|
173
156
|
background: #d3d3d3;
|
174
157
|
outline: none;
|
175
158
|
opacity: 0.7;
|
176
159
|
-webkit-transition: .2s;
|
177
160
|
transition: opacity .2s;
|
178
|
-
margin: 0 0 10px 0;
|
179
161
|
}
|
180
162
|
|
181
163
|
#settings-dashboard .card .value-slider::-webkit-slider-thumb {
|
@@ -197,17 +179,21 @@
|
|
197
179
|
}
|
198
180
|
|
199
181
|
#settings-dashboard .card .btn-value-submit {
|
200
|
-
|
182
|
+
height: 100%;
|
183
|
+
cursor: pointer;
|
184
|
+
}
|
185
|
+
|
186
|
+
#settings-dashboard .card .submit-container {
|
201
187
|
height: 35px;
|
188
|
+
width: 24%;
|
202
189
|
}
|
203
190
|
|
204
191
|
#settings-dashboard .card .switch {
|
205
192
|
position: relative;
|
193
|
+
top: 5px;
|
206
194
|
display: inline-block;
|
207
195
|
width: 60px;
|
208
196
|
height: 34px;
|
209
|
-
margin-bottom: 10px;
|
210
|
-
float: right;
|
211
197
|
}
|
212
198
|
|
213
199
|
#settings-dashboard .card .switch input {display:none;}
|
@@ -261,10 +247,45 @@
|
|
261
247
|
#settings-dashboard .card .refresh-button {
|
262
248
|
border: none;
|
263
249
|
outline: none;
|
264
|
-
float: left;
|
265
250
|
background: transparent;
|
266
251
|
}
|
267
252
|
|
253
|
+
.flex-container {
|
254
|
+
display: flex;
|
255
|
+
align-items: center;
|
256
|
+
}
|
257
|
+
|
258
|
+
.flex-container .flex-grow {
|
259
|
+
flex-grow: 4;
|
260
|
+
}
|
261
|
+
|
262
|
+
.flex-container-vertical {
|
263
|
+
display: flex;
|
264
|
+
flex-direction: column;
|
265
|
+
justify-content: space-between;
|
266
|
+
height: 100%;
|
267
|
+
}
|
268
|
+
|
269
|
+
.flex-container.space-between {
|
270
|
+
justify-content: space-between;
|
271
|
+
}
|
272
|
+
|
273
|
+
.flex-container.align-bottom {
|
274
|
+
align-items: flex-end;
|
275
|
+
}
|
276
|
+
|
277
|
+
.flex-container.padded {
|
278
|
+
padding: 5px 0 10px 0;
|
279
|
+
}
|
280
|
+
|
281
|
+
.flex-container.justify-end {
|
282
|
+
justify-content: flex-end;
|
283
|
+
}
|
284
|
+
|
285
|
+
.flex-container > div {
|
286
|
+
flex: 0 1 auto;
|
287
|
+
}
|
288
|
+
|
268
289
|
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
|
269
290
|
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
|
270
291
|
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
|
@@ -283,34 +304,32 @@
|
|
283
304
|
animation:spin 1s linear infinite;
|
284
305
|
}
|
285
306
|
|
286
|
-
#settings-dashboard .card.minimal {
|
287
|
-
min-height: 50px;
|
288
|
-
padding-top: 0;
|
289
|
-
}
|
290
|
-
|
291
|
-
#settings-dashboard .card.minimal label {
|
292
|
-
font-size: 22px;
|
293
|
-
}
|
294
|
-
|
295
307
|
.notice {
|
296
308
|
display: none;
|
297
|
-
|
298
|
-
|
309
|
+
position: relative;
|
310
|
+
top: 10px;
|
299
311
|
text-overflow: ellipsis;
|
300
|
-
white-space: nowrap;
|
301
312
|
overflow: hidden;
|
313
|
+
text-transform: uppercase;
|
302
314
|
font-weight: bolder;
|
315
|
+
font-size: 18px;
|
316
|
+
width: 100%;
|
317
|
+
height: 100%;
|
303
318
|
text-align: center;
|
304
319
|
-webkit-animation: fadeIn 0.5s;
|
305
320
|
animation: fadeIn 0.5s;
|
306
321
|
}
|
307
322
|
|
308
|
-
.notice
|
309
|
-
|
323
|
+
.notice img {
|
324
|
+
width: 25px;
|
310
325
|
}
|
311
326
|
|
312
|
-
.notice.
|
313
|
-
|
327
|
+
.notice.success img {
|
328
|
+
fill: var(--dark-green);
|
329
|
+
}
|
330
|
+
|
331
|
+
.notice.alert img {
|
332
|
+
fill: var(--bright-red);
|
314
333
|
}
|
315
334
|
|
316
335
|
#progress-container {
|
@@ -368,7 +387,7 @@
|
|
368
387
|
position: absolute;
|
369
388
|
right: 30%;
|
370
389
|
top: 165px;
|
371
|
-
z-index:
|
390
|
+
z-index: 3;
|
372
391
|
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
|
373
392
|
-webkit-border-radius: 5px;
|
374
393
|
-moz-border-radius: 5px;
|
@@ -10,15 +10,12 @@ module Sail
|
|
10
10
|
class SettingsController < ApplicationController
|
11
11
|
before_action :set_locale, only: :index
|
12
12
|
after_action :log_update, only: %i[update reset], if: -> { Sail.configuration.enable_logging && @successful_update }
|
13
|
-
|
14
|
-
# rubocop:disable Metrics/AbcSize
|
15
13
|
def index
|
16
14
|
@settings = Setting.by_query(s_params[:query]).ordered_by(s_params[:order_field])
|
17
|
-
@number_of_pages = (@settings.count.to_f /
|
18
|
-
@settings = @settings.paginated(s_params[:page],
|
15
|
+
@number_of_pages = (@settings.count.to_f / Sail::ConstantCollection::SETTINGS_PER_PAGE).ceil
|
16
|
+
@settings = @settings.paginated(s_params[:page], Sail::ConstantCollection::SETTINGS_PER_PAGE)
|
19
17
|
fresh_when(@settings)
|
20
18
|
end
|
21
|
-
# rubocop:enable Metrics/AbcSize
|
22
19
|
|
23
20
|
def update
|
24
21
|
respond_to do |format|
|
@@ -65,14 +62,6 @@ module Sail
|
|
65
62
|
|
66
63
|
private
|
67
64
|
|
68
|
-
def settings_per_page
|
69
|
-
if params[:monitor_mode] == Sail::ConstantCollection::TRUE
|
70
|
-
Sail::ConstantCollection::MINIMAL_SETTINGS_PER_PAGE
|
71
|
-
else
|
72
|
-
Sail::ConstantCollection::SETTINGS_PER_PAGE
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
65
|
def s_params
|
77
66
|
params.permit(:page, :query, :name,
|
78
67
|
:value, :positive, :negative,
|
data/app/models/sail/setting.rb
CHANGED
@@ -40,7 +40,7 @@ module Sail
|
|
40
40
|
elsif select(:id).by_group(query).exists?
|
41
41
|
by_group(query)
|
42
42
|
elsif query.to_s.include?(Sail::ConstantCollection::RECENT)
|
43
|
-
recently_updated(query.delete("recent ").strip)
|
43
|
+
recently_updated(query.delete("recent ").strip.to_i)
|
44
44
|
else
|
45
45
|
by_name(query)
|
46
46
|
end
|
@@ -21,12 +21,6 @@
|
|
21
21
|
<button id="btn-guide" type="button" class="nav-button">
|
22
22
|
<%= I18n.t("sail.guide") %>
|
23
23
|
</button>
|
24
|
-
|
25
|
-
<% if params[:monitor_mode] == Sail::ConstantCollection::TRUE %>
|
26
|
-
<%= link_to(I18n.t("sail.regular_mode"), settings_path, method: :get, class: "nav-button", id: "btn-regular-mode") %>
|
27
|
-
<% else %>
|
28
|
-
<%= link_to(I18n.t("sail.monitor_mode"), settings_path(monitor_mode: "true"), method: :get, class: "nav-button", id: "btn-monitor-mode") %>
|
29
|
-
<% end %>
|
30
24
|
</nav>
|
31
25
|
|
32
26
|
<div class="clearfix"></div>
|
@@ -1,31 +1,43 @@
|
|
1
|
-
<div id="<%= profile.name %>" class="profile-entry">
|
2
|
-
|
1
|
+
<div id="<%= profile.name %>" class="profile-entry flex-container space-between">
|
2
|
+
<div>
|
3
|
+
<% if profile.active? %>
|
3
4
|
<span class="active-indicator <%= profile.dirty? ? "yellow" : "green" %>"
|
4
5
|
title="<%= profile.dirty? ? I18n.t("sail.dirty_profile_tooltip") : I18n.t("sail.clean_profile_tooltip") %>">
|
5
6
|
⬤
|
6
7
|
</span>
|
7
8
|
|
8
|
-
|
9
|
+
<% unless Sail.instrumenter.profile(profile.name).zero? %>
|
9
10
|
<span class="errors-indicator" title="<%= I18n.t("sail.profile_error_tooltip") %>">
|
10
11
|
<%= I18n.t("sail.profile_errors", count: Sail.instrumenter.profile(profile.name)) %>
|
11
12
|
</span>
|
13
|
+
<% end %>
|
12
14
|
<% end %>
|
13
|
-
|
15
|
+
</div>
|
14
16
|
|
15
|
-
<
|
17
|
+
<div>
|
18
|
+
<span class="entry-name"><%= profile.name.titleize %></span>
|
19
|
+
</div>
|
16
20
|
|
17
|
-
|
18
|
-
<
|
19
|
-
|
21
|
+
<div>
|
22
|
+
<div class="flex-container space-between buttons">
|
23
|
+
<div>
|
24
|
+
<%= form_tag(profile_path(name: profile.name), method: :delete, remote: true) do %>
|
25
|
+
<button class="btn-sail"><%= I18n.t("sail.delete") %></button>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
20
28
|
|
21
|
-
|
22
|
-
|
23
|
-
|
29
|
+
<div>
|
30
|
+
<%= form_tag(switch_profile_path(name: profile.name), method: :put, remote: true) do %>
|
31
|
+
<button class="btn-sail" type="submit"><%= I18n.t("sail.activate") %></button>
|
32
|
+
<% end %>
|
33
|
+
</div>
|
24
34
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
35
|
+
<div>
|
36
|
+
<%= form_tag(profiles_path, method: :post, remote: true) do %>
|
37
|
+
<input type="hidden" name="name" value="<%= profile.name %>">
|
38
|
+
<button class="btn-sail" type="submit"><%= I18n.t("sail.save") %></button>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
31
43
|
</div>
|
@@ -12,7 +12,6 @@
|
|
12
12
|
</div>
|
13
13
|
</summary>
|
14
14
|
|
15
|
-
<p>
|
16
15
|
<div class="items-container">
|
17
16
|
<ul>
|
18
17
|
<li><%= I18n.t("sail.by_setting_name_html").html_safe %></li>
|
@@ -21,8 +20,9 @@
|
|
21
20
|
<li><%= I18n.t("sail.by_stale_html").html_safe %></li>
|
22
21
|
<li><%= I18n.t("sail.by_recent_html").html_safe %></li>
|
23
22
|
</ul>
|
23
|
+
|
24
|
+
<p><%= I18n.translate("sail.click_title") %></p>
|
24
25
|
</div>
|
25
|
-
</p>
|
26
26
|
</details>
|
27
27
|
<div class="clearfix"></div>
|
28
28
|
|
@@ -1,68 +1,90 @@
|
|
1
1
|
<% cache setting, expires_in: Sail.configuration.cache_life_span do %>
|
2
2
|
<div class="card">
|
3
|
-
<
|
4
|
-
|
3
|
+
<div class="front">
|
4
|
+
<h3 class="title card-title"><%= setting.display_name %></h3>
|
5
|
+
<hr/>
|
5
6
|
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
<div class="flex-container-vertical">
|
8
|
+
<div>
|
9
|
+
<div class="flex-container space-between">
|
10
|
+
<div>
|
11
|
+
<%= form_tag(reset_setting_path(name: setting.name), method: :put, remote: true) do %>
|
12
|
+
<button class="refresh-button" title="<%= I18n.t("sail.refresh_tooltip") %>">
|
13
|
+
<%= image_tag("sail/refresh.svg", alt: I18n.t("sail.refresh_tooltip")) %>
|
14
|
+
</button>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
10
17
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<div class="label-container">
|
18
|
-
<%= link_to(setting.cast_type, settings_path(query: setting.cast_type), method: :get, class: "tag type-label") %>
|
19
|
-
</div>
|
18
|
+
<div>
|
19
|
+
<span class="relevancy-score" title="<%= I18n.t("sail.relevancy_tooltip") %>"><%= setting.relevancy %></span>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
<div>
|
25
|
+
<div class="flex-container justify-end padded">
|
26
|
+
<div>
|
27
|
+
<%= link_to(setting.cast_type, settings_path(query: setting.cast_type), method: :get, class: "tag type-label") %>
|
28
|
+
</div>
|
26
29
|
|
27
|
-
|
30
|
+
<% if setting.group.present? %>
|
31
|
+
<div>
|
32
|
+
<%= link_to(setting.group, settings_path(query: setting.group), method: :get, class: "tag group-label") %>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
28
35
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
<% if setting.stale? %>
|
37
|
+
<div>
|
38
|
+
<%= link_to(I18n.t("sail.stale"), settings_path(query: Sail::ConstantCollection::STALE), method: :get, class: "tag stale-label", title: I18n.t("sail.stale_tooltip", days: Sail.configuration.days_until_stale)) %>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
41
|
+
</div>
|
42
|
+
</div>
|
34
43
|
|
35
|
-
|
36
|
-
|
37
|
-
|
44
|
+
<div>
|
45
|
+
<%= form_tag(setting_path(name: setting.name), method: :put, remote: true) do %>
|
46
|
+
<div class="flex-container space-between align-bottom">
|
47
|
+
<% if setting.boolean? || setting.ab_test? %>
|
48
|
+
<div>
|
49
|
+
<label class="switch">
|
50
|
+
<input id="<%= "input_for_#{setting.name}" %>" type="checkbox" name="value" <%= setting.value == "true" ? "checked" : "" %>>
|
51
|
+
<span class="slider round"></span>
|
52
|
+
</label>
|
53
|
+
</div>
|
54
|
+
<% elsif setting.range? %>
|
55
|
+
<div class="flex-grow">
|
56
|
+
<input id="<%= "input_for_#{setting.name}" %>" type="range" min="0" max="99" value="<%= setting.value %>" name="value" class="value-slider">
|
57
|
+
</div>
|
58
|
+
<% else %>
|
59
|
+
<div>
|
60
|
+
<input id="<%= "input_for_#{setting.name}" %>" type="text" name="value" class="value-input" value="<%= setting.value %>"/>
|
61
|
+
</div>
|
62
|
+
<% end %>
|
38
63
|
|
39
|
-
|
40
|
-
|
41
|
-
</p>
|
64
|
+
<div class="submit-container">
|
65
|
+
<button id="btn-submit-<%= setting.name %>" type="submit" class="btn-value-submit"><%= I18n.t("sail.save") %></button>
|
42
66
|
|
43
|
-
|
44
|
-
|
45
|
-
|
67
|
+
<span id="success-<%= setting.name %>" class="notice success">
|
68
|
+
<%= image_tag("sail/checkmark.svg") %>
|
69
|
+
</span>
|
46
70
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
<input id="<%= "input_for_#{setting.name}" %>" type="checkbox" name="value" <%= setting.value == "true" ? "checked" : "" %>>
|
53
|
-
<span class="slider round"></span>
|
54
|
-
</label>
|
55
|
-
<% elsif setting.range? %>
|
56
|
-
<input id="<%= "input_for_#{setting.name}" %>" type="range" min="0" max="99" value="<%= setting.value %>" name="value" class="value-slider">
|
57
|
-
<% elsif setting.date? %>
|
58
|
-
<input id="<%= "input_for_#{setting.name}" %>" type="datetime-local" value="<%= formatted_date(setting) %>" name="value" class="date-picker">
|
59
|
-
<% else %>
|
60
|
-
<input id="<%= "input_for_#{setting.name}" %>" type="text" name="value" class="value-input" value="<%= setting.value %>"/>
|
71
|
+
<span id="alert-<%= setting.name %>" class="notice alert">
|
72
|
+
<%= image_tag("sail/error.svg") %>
|
73
|
+
</span>
|
74
|
+
</div>
|
75
|
+
</div>
|
61
76
|
<% end %>
|
62
|
-
|
63
|
-
<button type="submit" class="btn-value-submit"><%= I18n.t('sail.save') %></button>
|
64
77
|
</div>
|
65
78
|
</div>
|
66
|
-
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<div class="back">
|
82
|
+
<h3 class="title card-title"><%= setting.display_name %></h3>
|
83
|
+
<hr/>
|
84
|
+
|
85
|
+
<p class="setting-description" title="<%= setting.description %>">
|
86
|
+
<label for="<%= "input_for_#{setting.name}" %>"><%= setting.description %></label>
|
87
|
+
</p>
|
88
|
+
</div>
|
67
89
|
</div>
|
68
90
|
<% end %>
|
@@ -1,16 +1,10 @@
|
|
1
1
|
<div id="settings-dashboard">
|
2
|
-
<% cache
|
3
|
-
|
4
|
-
<%= render(partial: "search") %>
|
5
|
-
<% end %>
|
2
|
+
<% cache @settings do %>
|
3
|
+
<%= render(partial: "search") %>
|
6
4
|
|
7
5
|
<div id="settings-container">
|
8
6
|
<% if @number_of_pages > 0 %>
|
9
|
-
|
10
|
-
<%= render(partial: "setting_minimal", collection: @settings) %>
|
11
|
-
<% else %>
|
12
|
-
<%= render(partial: "setting", collection: @settings) %>
|
13
|
-
<% end%>
|
7
|
+
<%= render(partial: "setting", collection: @settings) %>
|
14
8
|
<% else %>
|
15
9
|
<h1><%= I18n.t("sail.no_settings") %></h1>
|
16
10
|
<% end %>
|
@@ -22,15 +16,15 @@
|
|
22
16
|
<div class="clearfix"></div>
|
23
17
|
|
24
18
|
<div class="page-links">
|
25
|
-
<%= link_to("", settings_path(page: [params[:page].to_i - 1, 0].max,
|
26
|
-
<%= link_to(1, settings_path(page: 0,
|
19
|
+
<%= link_to("", settings_path(page: [params[:page].to_i - 1, 0].max, query: params[:query]), method: :get, id: "angle-left-link", title: I18n.t("sail.previous_page")) %>
|
20
|
+
<%= link_to(1, settings_path(page: 0, query: params[:query]), method: :get, class: params[:page].to_i.zero? || params[:page].blank? ? "active" : "") %>
|
27
21
|
|
28
22
|
<% if params[:page].to_i - Sail::ConstantCollection::MAX_PAGES > 1 %>
|
29
23
|
●●●
|
30
24
|
<% end %>
|
31
25
|
|
32
26
|
<% ([params[:page].to_i - Sail::ConstantCollection::MAX_PAGES, 1].max...[@number_of_pages - 1, params[:page].to_i + Sail::ConstantCollection::MAX_PAGES].min).each do |page| %>
|
33
|
-
<%= link_to(page + 1, settings_path(page: page,
|
27
|
+
<%= link_to(page + 1, settings_path(page: page, query: params[:query]), method: :get, class: params[:page].to_i == page || params[:page].blank? && page.zero? ? "active" : "") %>
|
34
28
|
<% end %>
|
35
29
|
|
36
30
|
<% if params[:page].to_i + Sail::ConstantCollection::MAX_PAGES < @number_of_pages - 1 %>
|
@@ -38,10 +32,10 @@
|
|
38
32
|
<% end %>
|
39
33
|
|
40
34
|
<% if @number_of_pages > 1 %>
|
41
|
-
<%= link_to(@number_of_pages, settings_path(page: @number_of_pages - 1,
|
35
|
+
<%= link_to(@number_of_pages, settings_path(page: @number_of_pages - 1, query: params[:query]), method: :get, class: params[:page].to_i == @number_of_pages - 1 ? "active" : "") %>
|
42
36
|
<% end %>
|
43
37
|
|
44
|
-
<%= link_to("", settings_path(page: [params[:page].to_i + 1, @number_of_pages - 1].min,
|
38
|
+
<%= link_to("", settings_path(page: [params[:page].to_i + 1, @number_of_pages - 1].min, query: params[:query]), method: :get, id: "angle-right-link", title: I18n.t("sail.next_page")) %>
|
45
39
|
</div>
|
46
40
|
</div>
|
47
41
|
<% end %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
var notice = document.getElementById("<%= @successful_update ? "success-#{@setting.name}" : "alert-#{@setting.name}" %>");
|
2
|
-
var
|
2
|
+
var submit = document.getElementById("btn-submit-<%= @setting.name %>");
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
submit.style.display = "none";
|
5
|
+
notice.style.display = "inline-block";
|
6
6
|
|
7
7
|
setTimeout(function () {
|
8
8
|
notice.style.display = "none";
|
9
|
-
|
9
|
+
submit.style.display = "inline-block";
|
10
10
|
}, 1500);
|
11
11
|
|
12
12
|
if ("<%= @successful_update %>" === "true") {
|
data/config/locales/en.yml
CHANGED
@@ -4,8 +4,6 @@ en:
|
|
4
4
|
save: SAVE
|
5
5
|
activate: ACTIVATE
|
6
6
|
delete: DELETE
|
7
|
-
updated: Updated!
|
8
|
-
failed: Failed!
|
9
7
|
search_placeholder: Setting name, group, cast type, stale or recent x
|
10
8
|
search_tooltip: "When searching for recently updated settings, x is the number of hours since the update (e.g.: recent 2)"
|
11
9
|
main_app: Main app
|
@@ -33,6 +31,7 @@ en:
|
|
33
31
|
by_cast_type_html: "<b>By cast type:</b> will find all settings with the same type (must be exact match)"
|
34
32
|
by_stale_html: "<b>By stale:</b> will find settings that are stale (haven't been updated recently)"
|
35
33
|
by_recent_html: "<b>By recent:</b> will find settings updated in the last X hours (e.g.: recent 50)"
|
34
|
+
click_title: Click a setting's title to view its description.
|
36
35
|
profiles_can_be_used: Profiles can be used to configure many states of settings. They save the values of all settings in a given moment.
|
37
36
|
profile_configuring: Configure settings as desired and create a new profile. Activate profiles to change the value of all settings at once.
|
38
37
|
relevancy_score: Relevancy Score
|
@@ -40,8 +39,6 @@ en:
|
|
40
39
|
available_groups_and_types: Available groups and types
|
41
40
|
groups_are: "The groups currently used are:"
|
42
41
|
types_are: "The cast types currently used are:"
|
43
|
-
regular_mode: Regular mode
|
44
|
-
monitor_mode: Monitor mode
|
45
42
|
how_to_find_settings: How to find settings you are looking for
|
46
43
|
how_to_profiles: How to organize your settings in profiles
|
47
44
|
how_to_relevancy_score: What is the relevancy score and how to use it
|
@@ -17,8 +17,7 @@ module Sail
|
|
17
17
|
STALE = "stale"
|
18
18
|
RECENT = "recent"
|
19
19
|
FIELDS_FOR_SORT = %w[name updated_at cast_type group].freeze
|
20
|
-
SETTINGS_PER_PAGE =
|
21
|
-
MINIMAL_SETTINGS_PER_PAGE = 24
|
20
|
+
SETTINGS_PER_PAGE = 20
|
22
21
|
INPUT_DATE_FORMAT = "%Y-%m-%dT%H:%m:%S"
|
23
22
|
MAX_PAGES = 5
|
24
23
|
end
|
data/lib/sail/engine.rb
CHANGED
@@ -24,8 +24,8 @@ module Sail
|
|
24
24
|
|
25
25
|
initializer "sail.assets.precompile" do |app|
|
26
26
|
app.config.assets.precompile += %w[sail/refresh.svg sail/sort.svg sail/angle-left.svg
|
27
|
-
sail/angle-right.svg sail/link.svg sail/cog.svg sail/
|
28
|
-
sail/application.js]
|
27
|
+
sail/angle-right.svg sail/link.svg sail/cog.svg sail/checkmark.svg
|
28
|
+
sail/error.svg sail/application.css sail/application.js]
|
29
29
|
end
|
30
30
|
|
31
31
|
initializer "sail" do
|
data/lib/sail/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinicius Stock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fugit
|
@@ -262,7 +262,9 @@ files:
|
|
262
262
|
- app/assets/config/sail_manifest.js
|
263
263
|
- app/assets/images/sail/angle-left.svg
|
264
264
|
- app/assets/images/sail/angle-right.svg
|
265
|
+
- app/assets/images/sail/checkmark.svg
|
265
266
|
- app/assets/images/sail/cog.svg
|
267
|
+
- app/assets/images/sail/error.svg
|
266
268
|
- app/assets/images/sail/link.svg
|
267
269
|
- app/assets/images/sail/refresh.svg
|
268
270
|
- app/assets/images/sail/sort.svg
|
@@ -287,7 +289,6 @@ files:
|
|
287
289
|
- app/views/sail/settings/_profiles_modal.html.erb
|
288
290
|
- app/views/sail/settings/_search.html.erb
|
289
291
|
- app/views/sail/settings/_setting.html.erb
|
290
|
-
- app/views/sail/settings/_setting_minimal.html.erb
|
291
292
|
- app/views/sail/settings/_sort_menu.html.erb
|
292
293
|
- app/views/sail/settings/index.html.erb
|
293
294
|
- app/views/sail/settings/update.js.erb
|
@@ -297,6 +298,7 @@ files:
|
|
297
298
|
- lib/generators/sail/install/install_generator.rb
|
298
299
|
- lib/generators/sail/install/templates/create_sail_profiles.rb
|
299
300
|
- lib/generators/sail/install/templates/create_sail_settings.rb
|
301
|
+
- lib/generators/sail/install/templates/sail.yml.tt
|
300
302
|
- lib/generators/sail/update/templates/add_group_to_sail_settings.rb
|
301
303
|
- lib/generators/sail/update/update_generator.rb
|
302
304
|
- lib/sail.rb
|
@@ -345,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
345
347
|
- !ruby/object:Gem::Version
|
346
348
|
version: '0'
|
347
349
|
requirements: []
|
348
|
-
rubygems_version: 3.1.
|
350
|
+
rubygems_version: 3.1.3
|
349
351
|
signing_key:
|
350
352
|
specification_version: 4
|
351
353
|
summary: Sail is a lightweight Rails engine that brings an admin panel for managing
|