lesli 5.1.13 → 5.1.15

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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/lesli/application.css +527 -10
  3. data/app/controllers/lesli/application_lesli_controller.rb +27 -0
  4. data/app/controllers/lesli/items/attachments_controller.rb +3 -3
  5. data/app/controllers/lesli/items/discussions_controller.rb +2 -2
  6. data/app/controllers/lesli/items/tasks_controller.rb +2 -2
  7. data/app/controllers/lesli/roles_controller.rb +1 -6
  8. data/app/controllers/lesli/users_controller.rb +1 -5
  9. data/app/helpers/lesli/html_helper.rb +5 -5
  10. data/app/helpers/lesli/navigation_helper.rb +5 -5
  11. data/app/interfaces/lesli/customization_interface.rb +11 -31
  12. data/app/interfaces/lesli/responder_interface.rb +11 -4
  13. data/app/models/concerns/lesli/account_initializer.rb +5 -45
  14. data/app/models/concerns/lesli/user_extensions.rb +4 -2
  15. data/app/models/lesli/items/attachment.rb +3 -3
  16. data/app/models/lesli/role.rb +14 -2
  17. data/app/models/lesli/user.rb +7 -0
  18. data/app/operators/lesli/account_operator.rb +84 -0
  19. data/app/operators/lesli/resource_operator.rb +123 -0
  20. data/app/services/lesli/application_lesli_service.rb +33 -116
  21. data/app/services/lesli/resource_service.rb +12 -159
  22. data/app/services/lesli/role_service.rb +11 -229
  23. data/app/services/lesli/user_service.rb +37 -117
  24. data/app/views/lesli/abouts/welcome.html.erb +4 -4
  25. data/app/views/lesli/apps/show.html.erb +1 -1
  26. data/app/views/lesli/errors/not_found.html.erb +9 -16
  27. data/app/views/lesli/errors/unauthorized.html.erb +19 -28
  28. data/app/views/lesli/layouts/application-devise.html.erb +1 -0
  29. data/app/views/lesli/layouts/application-lesli.html.erb +1 -1
  30. data/app/views/lesli/partials/_application-lesli-announcements.html.erb +18 -0
  31. data/app/views/lesli/partials/_application-lesli-assets.html.erb +16 -19
  32. data/app/views/lesli/partials/_application-lesli-header.html.erb +45 -100
  33. data/app/views/lesli/partials/_application-lesli-notifications.html.erb +2 -27
  34. data/app/views/lesli/partials/_application-lesli-turbo.html.erb +5 -0
  35. data/app/views/lesli/shared/dashboards/edit.html.erb +1 -1
  36. data/app/views/lesli/shared/dashboards/show.html.erb +1 -1
  37. data/config/initializers/lesli.rb +7 -2
  38. data/config/locales/translations.en.yml +56 -48
  39. data/config/locales/translations.es.yml +54 -45
  40. data/db/migrate/v1/0000000210_create_lesli_users.rb +1 -0
  41. data/db/seed/xyz.rb +1 -3
  42. data/lib/generators/lesli/base_generator.rb +41 -3
  43. data/lib/generators/lesli/controller/controller_generator.rb +1 -1
  44. data/lib/generators/lesli/controller/templates/controller.rb.tt +12 -7
  45. data/lib/generators/lesli/model/model_generator.rb +1 -1
  46. data/lib/generators/lesli/resource/resource_generator.rb +290 -0
  47. data/lib/generators/lesli/resource/templates/controller.rb.tt +99 -0
  48. data/lib/generators/lesli/resource/templates/locale.en.yml.tt +13 -0
  49. data/lib/generators/lesli/resource/templates/migration.rb.tt +28 -0
  50. data/lib/generators/lesli/resource/templates/model.rb.tt +38 -0
  51. data/lib/generators/lesli/resource/templates/operator.rb.tt +15 -0
  52. data/lib/generators/lesli/resource/templates/service.rb.tt +52 -0
  53. data/lib/generators/lesli/resource/templates/tests/controller_test.rb.tt +14 -0
  54. data/lib/generators/lesli/resource/templates/tests/model_test.rb.tt +24 -0
  55. data/lib/generators/lesli/resource/templates/tests/operator_test.rb.tt +15 -0
  56. data/lib/generators/lesli/resource/templates/tests/service_test.rb.tt +17 -0
  57. data/lib/generators/lesli/resource/templates/views/_form.html.erb.tt +17 -0
  58. data/lib/generators/lesli/resource/templates/views/edit.html.erb.tt +4 -0
  59. data/lib/generators/lesli/resource/templates/views/index.html.erb.tt +22 -0
  60. data/lib/generators/lesli/resource/templates/views/new.html.erb.tt +4 -0
  61. data/lib/generators/lesli/resource/templates/views/show.html.erb.tt +17 -0
  62. data/lib/generators/lesli/scaffold/scaffold_generator.rb +4 -39
  63. data/lib/generators/lesli/service/service_generator.rb +1 -1
  64. data/lib/generators/lesli/service/templates/service.rb.tt +15 -7
  65. data/lib/generators/lesli/views/views_generator.rb +1 -1
  66. data/lib/generators/lesli_generator.rb +11 -0
  67. data/lib/lesli/courier.rb +66 -34
  68. data/lib/lesli/database_tasks.rb +145 -0
  69. data/lib/lesli/version.rb +2 -2
  70. data/lib/tasks/lesli/db.rake +16 -93
  71. data/lib/tasks/lesli/resources.rake +1 -1
  72. data/readme.md +3 -1
  73. metadata +23 -4
  74. data/app/views/lesli/partials/_application-lesli-footer.html.erb +0 -82
  75. data/app/views/lesli/partials/_application-lesli-sidebar.html.erb +0 -50
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e42093c64425af9e68a26e106d438eee2e69c11ead091011ad26eff30b940282
4
- data.tar.gz: 5e56a9246828d3efe4e36354d7fe754a4556af9a0befd4ea9a6169614b94b521
3
+ metadata.gz: 10ebb40b1f83e7bf7a2970d8a9f67c082a2f7a47446130dd969ab209bfb34344
4
+ data.tar.gz: 37bec10c5fa241c51a01ab3a036ef97441c2224d256ef3ad45befff5c4c6183c
5
5
  SHA512:
6
- metadata.gz: a7f90e00184b49ffac1f366897ae89ddbd0dbe6e488aa4952d018f432a6e73f2399f9c8fd3f9b670dbb6d1bff2b6a1660f73a79eb146f5fb08ceed7e5efb2a5b
7
- data.tar.gz: 69a092763f5a8e0c55c03bd7d68aa68b511cc8a5f6bd60aedfdef9fbc601501319f12555f3c95d908e354292d3285d3289c91c01e803d72ed09669775b2f7446
6
+ metadata.gz: 394cfe9a65d5fcfb3eadd7495c24e5b740aade1867b570ae5b536480916aa030599e49222ca1f36c91286ece0828980e7ad7720df54b4122cf1e7e000d82dfb3
7
+ data.tar.gz: fcb499c3ae098e2cd520fa54b421c9131143b97e5f700ec52acc62c10d34016898438e68bd38a3148dba5765d3a79869ce6c69ff4ea2e799c6ee51f946317def
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.4 | MIT License | https://tailwindcss.com */
2
2
  /*!
3
3
 
4
4
  Lesli
@@ -30,42 +30,559 @@ Building a better future, one line of code at a time.
30
30
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
31
  // ·
32
32
  */
33
+ @layer properties;
33
34
  @layer theme, utilities;
34
- @layer theme {
35
- :root, :host {
36
- --spacing: 0.25rem;
37
- }
38
- }
39
35
  @layer utilities {
36
+ .absolute {
37
+ position: absolute;
38
+ }
39
+ .relative {
40
+ position: relative;
41
+ }
42
+ .top-5 {
43
+ top: calc(var(--spacing, 0.25rem) * 5);
44
+ }
45
+ .right-5 {
46
+ right: calc(var(--spacing, 0.25rem) * 5);
47
+ }
48
+ .mt-2 {
49
+ margin-top: calc(var(--spacing, 0.25rem) * 2);
50
+ }
51
+ .mb-5 {
52
+ margin-bottom: calc(var(--spacing, 0.25rem) * 5);
53
+ }
54
+ .mb-10 {
55
+ margin-bottom: calc(var(--spacing, 0.25rem) * 10);
56
+ }
57
+ .block {
58
+ display: block;
59
+ }
60
+ .flex {
61
+ display: flex;
62
+ }
40
63
  .grid {
41
64
  display: grid;
42
65
  }
43
66
  .hidden {
44
67
  display: none;
45
68
  }
69
+ .inline {
70
+ display: inline;
71
+ }
72
+ .h-16 {
73
+ height: calc(var(--spacing, 0.25rem) * 16);
74
+ }
75
+ .min-h-\[210px\] {
76
+ min-height: 210px;
77
+ }
78
+ .w-16 {
79
+ width: calc(var(--spacing, 0.25rem) * 16);
80
+ }
81
+ .w-full {
82
+ width: 100%;
83
+ }
84
+ .transform {
85
+ transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
86
+ }
46
87
  .grid-cols-1 {
47
88
  grid-template-columns: repeat(1, minmax(0, 1fr));
48
89
  }
90
+ .flex-col {
91
+ flex-direction: column;
92
+ }
93
+ .flex-wrap {
94
+ flex-wrap: wrap;
95
+ }
96
+ .items-center {
97
+ align-items: center;
98
+ }
99
+ .justify-center {
100
+ justify-content: center;
101
+ }
102
+ .gap-4 {
103
+ gap: calc(var(--spacing, 0.25rem) * 4);
104
+ }
49
105
  .gap-5 {
50
- gap: calc(var(--spacing) * 5);
106
+ gap: calc(var(--spacing, 0.25rem) * 5);
107
+ }
108
+ .overflow-hidden {
109
+ overflow: hidden;
110
+ }
111
+ .rounded-2xl {
112
+ border-radius: var(--radius-2xl, 1rem);
113
+ }
114
+ .border {
115
+ border-style: var(--tw-border-style);
116
+ border-width: 1px;
117
+ }
118
+ .border-\[var\(--lesli-color-primary\)\] {
119
+ border-color: var(--lesli-color-primary);
120
+ }
121
+ .border-neutral-200 {
122
+ border-color: var(--lesli-color-neutral-200);
123
+ }
124
+ .bg-primary-soft {
125
+ background-color: var(--lesli-color-primary-soft);
126
+ }
127
+ .bg-white {
128
+ background-color: var(--color-white, #fff);
129
+ }
130
+ .px-2 {
131
+ padding-inline: calc(var(--spacing, 0.25rem) * 2);
132
+ }
133
+ .px-4 {
134
+ padding-inline: calc(var(--spacing, 0.25rem) * 4);
135
+ }
136
+ .px-6 {
137
+ padding-inline: calc(var(--spacing, 0.25rem) * 6);
138
+ }
139
+ .py-3 {
140
+ padding-block: calc(var(--spacing, 0.25rem) * 3);
51
141
  }
52
142
  .py-6 {
53
- padding-block: calc(var(--spacing) * 6);
143
+ padding-block: calc(var(--spacing, 0.25rem) * 6);
144
+ }
145
+ .py-8 {
146
+ padding-block: calc(var(--spacing, 0.25rem) * 8);
147
+ }
148
+ .text-center {
149
+ text-align: center;
150
+ }
151
+ .font-\[OpenSans\] {
152
+ font-family: OpenSans;
153
+ }
154
+ .text-base {
155
+ font-size: var(--text-base, 1rem);
156
+ line-height: var(--tw-leading, var(--text-base--line-height, calc(1.5 / 1)));
157
+ }
158
+ .text-lg {
159
+ font-size: var(--text-lg, 1.125rem);
160
+ line-height: var(--tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));
161
+ }
162
+ .text-sm {
163
+ font-size: var(--text-sm, 0.875rem);
164
+ line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
165
+ }
166
+ .text-xl {
167
+ font-size: var(--text-xl, 1.25rem);
168
+ line-height: var(--tw-leading, var(--text-xl--line-height, calc(1.75 / 1.25)));
169
+ }
170
+ .text-\[24px\] {
171
+ font-size: 24px;
172
+ }
173
+ .leading-5 {
174
+ --tw-leading: calc(var(--spacing, 0.25rem) * 5);
175
+ line-height: calc(var(--spacing, 0.25rem) * 5);
176
+ }
177
+ .leading-6 {
178
+ --tw-leading: calc(var(--spacing, 0.25rem) * 6);
179
+ line-height: calc(var(--spacing, 0.25rem) * 6);
180
+ }
181
+ .leading-none {
182
+ --tw-leading: 1;
183
+ line-height: 1;
184
+ }
185
+ .font-medium {
186
+ --tw-font-weight: var(--font-weight-medium, 500);
187
+ font-weight: var(--font-weight-medium, 500);
188
+ }
189
+ .font-normal {
190
+ --tw-font-weight: var(--font-weight-normal, 400);
191
+ font-weight: var(--font-weight-normal, 400);
192
+ }
193
+ .font-semibold {
194
+ --tw-font-weight: var(--font-weight-semibold, 600);
195
+ font-weight: var(--font-weight-semibold, 600);
196
+ }
197
+ .tracking-tight {
198
+ --tw-tracking: var(--tracking-tight, -0.025em);
199
+ letter-spacing: var(--tracking-tight, -0.025em);
200
+ }
201
+ .text-wrap {
202
+ text-wrap: wrap;
203
+ }
204
+ .text-\[var\(--lesli-color-primary\)\] {
205
+ color: var(--lesli-color-primary);
206
+ }
207
+ .text-neutral-500 {
208
+ color: var(--lesli-color-neutral-500);
209
+ }
210
+ .text-neutral-600 {
211
+ color: var(--lesli-color-neutral-600);
212
+ }
213
+ .text-primary {
214
+ color: var(--lesli-color-primary);
215
+ }
216
+ .text-primary-strong {
217
+ color: var(--lesli-color-primary-strong);
218
+ }
219
+ .opacity-0 {
220
+ opacity: 0%;
221
+ }
222
+ .opacity-100 {
223
+ opacity: 100%;
224
+ }
225
+ .shadow-sm {
226
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
227
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
228
+ }
229
+ .outline {
230
+ outline-style: var(--tw-outline-style);
231
+ outline-width: 1px;
232
+ }
233
+ .backdrop-filter {
234
+ -webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
235
+ backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
236
+ }
237
+ .transition {
238
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
239
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1)));
240
+ transition-duration: var(--tw-duration, var(--default-transition-duration, 150ms));
241
+ }
242
+ .transition-all {
243
+ transition-property: all;
244
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1)));
245
+ transition-duration: var(--tw-duration, var(--default-transition-duration, 150ms));
246
+ }
247
+ .duration-200 {
248
+ --tw-duration: 200ms;
249
+ transition-duration: 200ms;
250
+ }
251
+ .ease-out {
252
+ --tw-ease: var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
253
+ transition-timing-function: var(--ease-out, cubic-bezier(0, 0, 0.2, 1));
254
+ }
255
+ @media (hover: hover) {
256
+ :is(:where(.group):hover .group-hover\:translate-x-0\.5) {
257
+ --tw-translate-x: calc(var(--spacing, 0.25rem) * 0.5);
258
+ translate: var(--tw-translate-x) var(--tw-translate-y);
259
+ }
260
+ :is(:where(.group):hover .group-hover\:scale-105) {
261
+ --tw-scale-x: 105%;
262
+ --tw-scale-y: 105%;
263
+ --tw-scale-z: 105%;
264
+ scale: var(--tw-scale-x) var(--tw-scale-y);
265
+ }
266
+ :is(:where(.group):hover .group-hover\:text-neutral-900) {
267
+ color: var(--lesli-color-neutral-900);
268
+ }
269
+ :is(:where(.group):hover .group-hover\:opacity-100) {
270
+ opacity: 100%;
271
+ }
272
+ .hover\:-translate-y-0\.5:hover {
273
+ --tw-translate-y: calc(var(--spacing, 0.25rem) * -0.5);
274
+ translate: var(--tw-translate-x) var(--tw-translate-y);
275
+ }
276
+ .hover\:border-\[var\(--lesli-color-primary\)\]:hover {
277
+ border-color: var(--lesli-color-primary);
278
+ }
279
+ .hover\:bg-neutral-50:hover {
280
+ background-color: var(--lesli-color-neutral-50);
281
+ }
282
+ .hover\:text-neutral-900:hover {
283
+ color: var(--lesli-color-neutral-900);
284
+ }
285
+ .hover\:shadow-lg:hover {
286
+ --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
287
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
288
+ }
289
+ }
290
+ .focus\:ring-2:focus {
291
+ --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
292
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
293
+ }
294
+ .focus\:ring-primary\/30:focus {
295
+ --tw-ring-color: var(--lesli-color-primary);
296
+ @supports (color: color-mix(in lab, red, red)) {
297
+ --tw-ring-color: color-mix(in oklab, var(--lesli-color-primary) 30%, transparent);
298
+ }
299
+ }
300
+ .focus\:outline-none:focus {
301
+ --tw-outline-style: none;
302
+ outline-style: none;
303
+ }
304
+ .focus-visible\:ring-4:focus-visible {
305
+ --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
306
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
307
+ }
308
+ .focus-visible\:ring-\[var\(--lesli-color-primary\)\]\/15:focus-visible {
309
+ --tw-ring-color: var(--lesli-color-primary);
310
+ @supports (color: color-mix(in lab, red, red)) {
311
+ --tw-ring-color: color-mix(in oklab, var(--lesli-color-primary) 15%, transparent);
312
+ }
54
313
  }
55
314
  @media (width >= 40rem) {
56
315
  .sm\:grid-cols-2 {
57
316
  grid-template-columns: repeat(2, minmax(0, 1fr));
58
317
  }
59
318
  .sm\:gap-6 {
60
- gap: calc(var(--spacing) * 6);
319
+ gap: calc(var(--spacing, 0.25rem) * 6);
61
320
  }
62
321
  .sm\:py-8 {
63
- padding-block: calc(var(--spacing) * 8);
322
+ padding-block: calc(var(--spacing, 0.25rem) * 8);
64
323
  }
65
324
  }
66
325
  @media (width >= 64rem) {
67
326
  .lg\:grid-cols-4 {
68
327
  grid-template-columns: repeat(4, minmax(0, 1fr));
69
328
  }
329
+ .lg\:gap-2 {
330
+ gap: calc(var(--spacing, 0.25rem) * 2);
331
+ }
332
+ .lg\:rounded-xl {
333
+ border-radius: var(--radius-xl, 0.75rem);
334
+ }
335
+ .lg\:px-4 {
336
+ padding-inline: calc(var(--spacing, 0.25rem) * 4);
337
+ }
338
+ .lg\:py-2 {
339
+ padding-block: calc(var(--spacing, 0.25rem) * 2);
340
+ }
341
+ .lg\:text-\[18px\] {
342
+ font-size: 18px;
343
+ }
344
+ .lg\:text-neutral-500 {
345
+ color: var(--lesli-color-neutral-500);
346
+ }
347
+ }
348
+ .\[\&_svg\]\:h-12 svg {
349
+ height: calc(var(--spacing, 0.25rem) * 12);
350
+ }
351
+ .\[\&_svg\]\:w-12 svg {
352
+ width: calc(var(--spacing, 0.25rem) * 12);
353
+ }
354
+ .\[\&_svg\]\:fill-\[var\(--lesli-color-primary\)\] svg {
355
+ fill: var(--lesli-color-primary);
356
+ }
357
+ .\[\&_svg_path\]\:fill-\[var\(--lesli-color-primary\)\] svg path {
358
+ fill: var(--lesli-color-primary);
359
+ }
360
+ }
361
+ @property --tw-rotate-x {
362
+ syntax: "*";
363
+ inherits: false;
364
+ }
365
+ @property --tw-rotate-y {
366
+ syntax: "*";
367
+ inherits: false;
368
+ }
369
+ @property --tw-rotate-z {
370
+ syntax: "*";
371
+ inherits: false;
372
+ }
373
+ @property --tw-skew-x {
374
+ syntax: "*";
375
+ inherits: false;
376
+ }
377
+ @property --tw-skew-y {
378
+ syntax: "*";
379
+ inherits: false;
380
+ }
381
+ @property --tw-border-style {
382
+ syntax: "*";
383
+ inherits: false;
384
+ initial-value: solid;
385
+ }
386
+ @property --tw-leading {
387
+ syntax: "*";
388
+ inherits: false;
389
+ }
390
+ @property --tw-font-weight {
391
+ syntax: "*";
392
+ inherits: false;
393
+ }
394
+ @property --tw-tracking {
395
+ syntax: "*";
396
+ inherits: false;
397
+ }
398
+ @property --tw-shadow {
399
+ syntax: "*";
400
+ inherits: false;
401
+ initial-value: 0 0 #0000;
402
+ }
403
+ @property --tw-shadow-color {
404
+ syntax: "*";
405
+ inherits: false;
406
+ }
407
+ @property --tw-shadow-alpha {
408
+ syntax: "<percentage>";
409
+ inherits: false;
410
+ initial-value: 100%;
411
+ }
412
+ @property --tw-inset-shadow {
413
+ syntax: "*";
414
+ inherits: false;
415
+ initial-value: 0 0 #0000;
416
+ }
417
+ @property --tw-inset-shadow-color {
418
+ syntax: "*";
419
+ inherits: false;
420
+ }
421
+ @property --tw-inset-shadow-alpha {
422
+ syntax: "<percentage>";
423
+ inherits: false;
424
+ initial-value: 100%;
425
+ }
426
+ @property --tw-ring-color {
427
+ syntax: "*";
428
+ inherits: false;
429
+ }
430
+ @property --tw-ring-shadow {
431
+ syntax: "*";
432
+ inherits: false;
433
+ initial-value: 0 0 #0000;
434
+ }
435
+ @property --tw-inset-ring-color {
436
+ syntax: "*";
437
+ inherits: false;
438
+ }
439
+ @property --tw-inset-ring-shadow {
440
+ syntax: "*";
441
+ inherits: false;
442
+ initial-value: 0 0 #0000;
443
+ }
444
+ @property --tw-ring-inset {
445
+ syntax: "*";
446
+ inherits: false;
447
+ }
448
+ @property --tw-ring-offset-width {
449
+ syntax: "<length>";
450
+ inherits: false;
451
+ initial-value: 0px;
452
+ }
453
+ @property --tw-ring-offset-color {
454
+ syntax: "*";
455
+ inherits: false;
456
+ initial-value: #fff;
457
+ }
458
+ @property --tw-ring-offset-shadow {
459
+ syntax: "*";
460
+ inherits: false;
461
+ initial-value: 0 0 #0000;
462
+ }
463
+ @property --tw-outline-style {
464
+ syntax: "*";
465
+ inherits: false;
466
+ initial-value: solid;
467
+ }
468
+ @property --tw-backdrop-blur {
469
+ syntax: "*";
470
+ inherits: false;
471
+ }
472
+ @property --tw-backdrop-brightness {
473
+ syntax: "*";
474
+ inherits: false;
475
+ }
476
+ @property --tw-backdrop-contrast {
477
+ syntax: "*";
478
+ inherits: false;
479
+ }
480
+ @property --tw-backdrop-grayscale {
481
+ syntax: "*";
482
+ inherits: false;
483
+ }
484
+ @property --tw-backdrop-hue-rotate {
485
+ syntax: "*";
486
+ inherits: false;
487
+ }
488
+ @property --tw-backdrop-invert {
489
+ syntax: "*";
490
+ inherits: false;
491
+ }
492
+ @property --tw-backdrop-opacity {
493
+ syntax: "*";
494
+ inherits: false;
495
+ }
496
+ @property --tw-backdrop-saturate {
497
+ syntax: "*";
498
+ inherits: false;
499
+ }
500
+ @property --tw-backdrop-sepia {
501
+ syntax: "*";
502
+ inherits: false;
503
+ }
504
+ @property --tw-duration {
505
+ syntax: "*";
506
+ inherits: false;
507
+ }
508
+ @property --tw-ease {
509
+ syntax: "*";
510
+ inherits: false;
511
+ }
512
+ @property --tw-translate-x {
513
+ syntax: "*";
514
+ inherits: false;
515
+ initial-value: 0;
516
+ }
517
+ @property --tw-translate-y {
518
+ syntax: "*";
519
+ inherits: false;
520
+ initial-value: 0;
521
+ }
522
+ @property --tw-translate-z {
523
+ syntax: "*";
524
+ inherits: false;
525
+ initial-value: 0;
526
+ }
527
+ @property --tw-scale-x {
528
+ syntax: "*";
529
+ inherits: false;
530
+ initial-value: 1;
531
+ }
532
+ @property --tw-scale-y {
533
+ syntax: "*";
534
+ inherits: false;
535
+ initial-value: 1;
536
+ }
537
+ @property --tw-scale-z {
538
+ syntax: "*";
539
+ inherits: false;
540
+ initial-value: 1;
541
+ }
542
+ @layer properties {
543
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
544
+ *, ::before, ::after, ::backdrop {
545
+ --tw-rotate-x: initial;
546
+ --tw-rotate-y: initial;
547
+ --tw-rotate-z: initial;
548
+ --tw-skew-x: initial;
549
+ --tw-skew-y: initial;
550
+ --tw-border-style: solid;
551
+ --tw-leading: initial;
552
+ --tw-font-weight: initial;
553
+ --tw-tracking: initial;
554
+ --tw-shadow: 0 0 #0000;
555
+ --tw-shadow-color: initial;
556
+ --tw-shadow-alpha: 100%;
557
+ --tw-inset-shadow: 0 0 #0000;
558
+ --tw-inset-shadow-color: initial;
559
+ --tw-inset-shadow-alpha: 100%;
560
+ --tw-ring-color: initial;
561
+ --tw-ring-shadow: 0 0 #0000;
562
+ --tw-inset-ring-color: initial;
563
+ --tw-inset-ring-shadow: 0 0 #0000;
564
+ --tw-ring-inset: initial;
565
+ --tw-ring-offset-width: 0px;
566
+ --tw-ring-offset-color: #fff;
567
+ --tw-ring-offset-shadow: 0 0 #0000;
568
+ --tw-outline-style: solid;
569
+ --tw-backdrop-blur: initial;
570
+ --tw-backdrop-brightness: initial;
571
+ --tw-backdrop-contrast: initial;
572
+ --tw-backdrop-grayscale: initial;
573
+ --tw-backdrop-hue-rotate: initial;
574
+ --tw-backdrop-invert: initial;
575
+ --tw-backdrop-opacity: initial;
576
+ --tw-backdrop-saturate: initial;
577
+ --tw-backdrop-sepia: initial;
578
+ --tw-duration: initial;
579
+ --tw-ease: initial;
580
+ --tw-translate-x: 0;
581
+ --tw-translate-y: 0;
582
+ --tw-translate-z: 0;
583
+ --tw-scale-x: 1;
584
+ --tw-scale-y: 1;
585
+ --tw-scale-z: 1;
586
+ }
70
587
  }
71
588
  }
@@ -46,11 +46,13 @@ module Lesli
46
46
 
47
47
  protect_from_forgery with: :exception
48
48
 
49
+ around_action :use_user_timezone
49
50
  before_action :set_locale
50
51
  before_action :authenticate_request if defined?(LesliShield)
51
52
  before_action :authorize_request if defined?(LesliShield)
52
53
  before_action :set_customizer
53
54
  before_action :set_requester
55
+ before_action :load_announcements
54
56
  after_action :log_requests if defined?(LesliAudit)
55
57
 
56
58
  layout "lesli/layouts/application-lesli"
@@ -67,5 +69,30 @@ module Lesli
67
69
  payload[:session_id] = session[:user_session_id]
68
70
  current_user.log(**payload)
69
71
  end
72
+
73
+ private
74
+
75
+ def use_user_timezone(&action)
76
+ # Keep the profile zone scoped to this request, including services and views.
77
+ user = current_user if respond_to?(:current_user, true)
78
+ zone = user ? user.effective_time_zone :
79
+ Time.find_zone!(Lesli.config.datetime&.dig(:time_zone).presence || Rails.application.config.time_zone)
80
+ Time.use_zone(zone, &action)
81
+ end
82
+
83
+ def load_announcements
84
+ @lesli_announcements = []
85
+ @lesli_announcements_enabled = false
86
+ return unless request.format.html? && !turbo_frame_request?
87
+ return unless respond_to?(:current_user, true) && current_user
88
+
89
+ announcements = Lesli::Courier.new(:LesliBell)
90
+ .from(:announcement_service, current_user)
91
+ .call(:list, path: request.path)
92
+ return unless announcements
93
+
94
+ @lesli_announcements_enabled = true
95
+ @lesli_announcements = announcements.to_a
96
+ end
70
97
  end
71
98
  end
@@ -66,7 +66,7 @@ module Lesli
66
66
  respond_with_lesli(
67
67
  turbo: [
68
68
  stream_notification_success(
69
- I18n.t("lesli.items.attachments.created")
69
+ I18n.t("lesli.items.attachments_created")
70
70
  ),
71
71
  attachments_stream
72
72
  ],
@@ -97,11 +97,11 @@ module Lesli
97
97
  respond_with_lesli(
98
98
  turbo: [
99
99
  stream_notification_success(
100
- I18n.t("lesli.items.attachments.deleted")
100
+ I18n.t("lesli.items.attachments_deleted")
101
101
  ),
102
102
  attachments_stream
103
103
  ],
104
- json: { message: I18n.t("lesli.items.attachments.deleted") },
104
+ json: { message: I18n.t("lesli.items.attachments_deleted") },
105
105
  redirect: return_path
106
106
  )
107
107
  else
@@ -42,7 +42,7 @@ module Lesli
42
42
  )
43
43
  refresh_discussions
44
44
 
45
- message = I18n.t("lesli.items.discussions.created")
45
+ message = I18n.t("lesli.items.discussions_created")
46
46
  respond_with_lesli(
47
47
  turbo: [
48
48
  stream_notification_success(message),
@@ -135,7 +135,7 @@ module Lesli
135
135
 
136
136
  def respond_with_comment_errors(comment)
137
137
  refresh_discussions
138
- message = I18n.t("lesli.items.discussions.invalid")
138
+ message = I18n.t("lesli.items.discussions_invalid")
139
139
  respond_with_lesli(
140
140
  turbo: [
141
141
  stream_notification_danger(message),
@@ -43,7 +43,7 @@ module Lesli
43
43
  )
44
44
  refresh_tasks
45
45
 
46
- message = I18n.t("lesli.items.tasks.created")
46
+ message = I18n.t("lesli.items.tasks_created")
47
47
  respond_with_lesli(
48
48
  turbo: [
49
49
  stream_notification_success(message),
@@ -160,7 +160,7 @@ module Lesli
160
160
 
161
161
  def task_status_message
162
162
  status = @task.done? ? :completed : :reopened
163
- I18n.t("lesli.items.tasks.#{status}")
163
+ I18n.t("lesli.items.tasks_#{status}")
164
164
  end
165
165
 
166
166
  def tasks_stream(task: nil)
@@ -32,14 +32,9 @@ Building a better future, one line of code at a time.
32
32
 
33
33
  module Lesli
34
34
  class RolesController < ApplicationLesliController
35
- before_action :set_role, only: []
36
35
 
37
36
  def list
38
- respond_to do |format|
39
- format.json {
40
- respond_with_successful(RoleService.new(current_user, query).list(params))
41
- }
42
- end
37
+ respond_with_lesli(json: RoleService.new(current_user, query).list)
43
38
  end
44
39
  end
45
40
  end