x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!DOCTYPE html><html> <head> <title>Demo</title> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="csrf-param" content="authenticity_token" /> <meta name="csrf-token" content="yp6NXS903LDvLyYh3Zn-Im_WT75gecsrmobl-SidVkTH0TpoWHR8ROsD2Tsf4FAuhpI3Nl217-GL0sykVpqJpQ" /> <!-- ATTENTION: The following line is required for Turbo dialog works see: https://github.com/hotwired/turbo/issues/1191#issuecomment-1952959217 --> <meta name="turbo-prefetch" content="false"> <link rel="stylesheet" href="/assets/monaco-editor-d026e4e8.css" /> <link rel="stylesheet" href="/assets/tailwind-e1c99e10.css" data-turbo-track="reload" /> <link rel="stylesheet" href="/assets/elevate-b9e6a9e3.css" /> <script type="importmap" data-turbo-track="reload"> { "imports": { "application": "/assets/application-e52719f5.js", "monaco_environment": "/assets/monaco_environment-7d1d7ad9.js", "@hotwired/turbo-rails": "/assets/turbo.min-9fd88cd5.js", "@hotwired/stimulus": "/assets/stimulus.min-4b1e420e.js", "elevate": "/assets/elevate-77c908f2.js", "@rails/request.js": "/assets/@rails--request.js-22cecb25.js", "date-fns": "/assets/date-fns-20af076e.js", "date-fns-tz": "/assets/date-fns-tz-52b54186.js", "flatpickr": "/assets/flatpickr-bc43d5e1.js", "flatpickr/dist/plugins/confirmDate/confirmDate": "/assets/flatpickr--confirmDate-5274819e.js", "intl-tel-input": "/assets/intl-tel-input-8efbd706.js", "nanostores": "/assets/nanostores-84ef9e44.js", "sortablejs": "/assets/sortablejs-764cc38c.js", "tom-select": "/assets/tom-select-d8b91703.js", "@37signals/lexxy": "/assets/@37signals--lexxy-ee545715.js", "monaco-editor": "https://esm.sh/monaco-editor@0.56.0" } } </script> <link rel="modulepreload" href="/assets/application-e52719f5.js"> <link rel="modulepreload" href="/assets/monaco_environment-7d1d7ad9.js"> <link rel="modulepreload" href="/assets/turbo.min-9fd88cd5.js"> <link rel="modulepreload" href="/assets/stimulus.min-4b1e420e.js"> <link rel="modulepreload" href="/assets/elevate-77c908f2.js"> <link rel="modulepreload" href="/assets/@rails--request.js-22cecb25.js"> <link rel="modulepreload" href="/assets/date-fns-20af076e.js"> <link rel="modulepreload" href="/assets/date-fns-tz-52b54186.js"> <link rel="modulepreload" href="/assets/flatpickr-bc43d5e1.js"> <link rel="modulepreload" href="/assets/flatpickr--confirmDate-5274819e.js"> <link rel="modulepreload" href="/assets/intl-tel-input-8efbd706.js"> <link rel="modulepreload" href="/assets/nanostores-84ef9e44.js"> <link rel="modulepreload" href="/assets/sortablejs-764cc38c.js"> <link rel="modulepreload" href="/assets/tom-select-d8b91703.js"> <script type="module"> import "application" </script> </head> <body> <div id="elevate-toast-host" data-controller="toast" data-turbo-permanent="true" data-toast-position-value="top-center" data-toast-layout-value="default" data-toast-auto-dismiss-duration-value="4000" data-toast-limit-value="3" data-toast-gap-value="14" class="elevate-toast elevate-toast--position--top-center"> <ol data-toast-target="container" class="relative flex flex-col-reverse sm:flex-col gap-0 pointer-events-auto [&>li]:pointer-events-auto" style="height: 0px;"></ol> <div data-toast-target="livePolite" role="status" aria-live="polite" aria-atomic="true" class="sr-only"></div> <div data-toast-target="liveAssertive" role="alert" aria-live="assertive" aria-atomic="true" class="sr-only"></div> <template data-toast-template data-toast-type="default"> <li class="toast-item"> <div class="elevate-toast--content"> <div class="elevate-toast--row"> <div class="elevate-toast--plate elevate-toast--plate--default" aria-hidden="true"> <span class="elevate-toast--plate-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"> <circle cx="9" cy="9" r="7.4"></circle> <circle cx="9" cy="9" r="1.4" fill="currentColor" stroke="none"></circle> </svg> </span> </div> <div class="elevate-toast--text"> <p class="elevate-toast--title" data-toast-slot="message"></p> <p class="elevate-toast--description" data-toast-slot="description"></p> </div> <button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close"> <span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span> </button> </div> </div> </li> </template> <template data-toast-template data-toast-type="success"> <li class="toast-item"> <div class="elevate-toast--content"> <div class="elevate-toast--row"> <div class="elevate-toast--plate elevate-toast--plate--success" aria-hidden="true"> <span class="elevate-toast--plate-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"> <circle cx="9" cy="9" r="7.4"></circle> <path d="M5.6 9.2 L8 11.6 L12.4 6.8"></path> </svg> </span> </div> <div class="elevate-toast--text"> <p class="elevate-toast--title" data-toast-slot="message"></p> <p class="elevate-toast--description" data-toast-slot="description"></p> </div> <button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close"> <span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span> </button> </div> </div> </li> </template> <template data-toast-template data-toast-type="error"> <li class="toast-item"> <div class="elevate-toast--content"> <div class="elevate-toast--row"> <div class="elevate-toast--plate elevate-toast--plate--error" aria-hidden="true"> <span class="elevate-toast--plate-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"> <circle cx="9" cy="9" r="7.4"></circle> <path d="M6.2 6.2 L11.8 11.8 M11.8 6.2 L6.2 11.8"></path> </svg> </span> </div> <div class="elevate-toast--text"> <p class="elevate-toast--title" data-toast-slot="message"></p> <p class="elevate-toast--description" data-toast-slot="description"></p> </div> <button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close"> <span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span> </button> </div> </div> </li> </template> <template data-toast-template data-toast-type="info"> <li class="toast-item"> <div class="elevate-toast--content"> <div class="elevate-toast--row"> <div class="elevate-toast--plate elevate-toast--plate--info" aria-hidden="true"> <span class="elevate-toast--plate-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"> <circle cx="9" cy="9" r="7.4"></circle> <path d="M9 8 L9 12.4"></path> <circle cx="9" cy="5.6" r="0.5" fill="currentColor" stroke="none"></circle> </svg> </span> </div> <div class="elevate-toast--text"> <p class="elevate-toast--title" data-toast-slot="message"></p> <p class="elevate-toast--description" data-toast-slot="description"></p> </div> <button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close"> <span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span> </button> </div> </div> </li> </template> <template data-toast-template data-toast-type="warning"> <li class="toast-item"> <div class="elevate-toast--content"> <div class="elevate-toast--row"> <div class="elevate-toast--plate elevate-toast--plate--warning" aria-hidden="true"> <span class="elevate-toast--plate-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"> <path d="M9 2.4 L16.2 14.6 L1.8 14.6 Z"></path> <path d="M9 7.2 L9 10.6"></path> <circle cx="9" cy="12.6" r="0.5" fill="currentColor" stroke="none"></circle> </svg> </span> </div> <div class="elevate-toast--text"> <p class="elevate-toast--title" data-toast-slot="message"></p> <p class="elevate-toast--description" data-toast-slot="description"></p> </div> <button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close"> <span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span> </button> </div> </div> </li> </template> <template data-toast-template data-toast-type="danger"> <li class="toast-item"> <div class="elevate-toast--content"> <div class="elevate-toast--row"> <div class="elevate-toast--plate elevate-toast--plate--danger" aria-hidden="true"> <span class="elevate-toast--plate-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"> <path d="M9 1.8 L15.6 5.4 L15.6 10 C15.6 13.4 12.6 15.6 9 16.6 C5.4 15.6 2.4 13.4 2.4 10 L2.4 5.4 Z"></path> <path d="M9 6.4 L9 10"></path> <circle cx="9" cy="12" r="0.5" fill="currentColor" stroke="none"></circle> </svg> </span> </div> <div class="elevate-toast--text"> <p class="elevate-toast--title" data-toast-slot="message"></p> <p class="elevate-toast--description" data-toast-slot="description"></p> </div> <button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close"> <span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span> </button> </div> </div> </li> </template> <template data-toast-template data-toast-type="loading"> <li class="toast-item"> <div class="elevate-toast--content"> <div class="elevate-toast--row"> <div class="elevate-toast--plate elevate-toast--plate--loading" role="progressbar" aria-label="Loading…"> <span class="elevate-toast--plate-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 18" fill="none" focusable="false" aria-hidden="true"> <circle cx="9" cy="9" r="7" stroke="currentColor" stroke-opacity="0.2" stroke-width="1.6"></circle> <path d="M9 2 A7 7 0 0 1 16 9" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"></path> </svg> </span> </div> <div class="elevate-toast--text"> <p class="elevate-toast--title" data-toast-slot="message"></p> <p class="elevate-toast--description" data-toast-slot="description"></p> </div> <button type="button" class="elevate-toast--close" data-toast-slot="close" aria-label="Close"> <span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span> </button> </div> </div> </li> </template> <template data-toast-template-rich> <li class="toast-item"> <div class="elevate-toast--content elevate-toast--content--rich"> <div data-toast-slot="content"></div> <button type="button" class="elevate-toast--close elevate-toast--close--floating" data-toast-slot="close" aria-label="Close"><span class="elevate-toast--close-icon elevate-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 14 14" fill="none" focusable="false" aria-hidden="true"> <path d="M3.5 3.5 L10.5 10.5 M10.5 3.5 L3.5 10.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> </span></button></div> </li> </template> </div> <main class="container mx-auto mt-12 px-5"> <div data-controller="elevate-collection-page" data-action="turbo:frame-missing->elevate-collection-page#recover turbo:fetch-request-error->elevate-collection-page#warn" data-elevate-collection-page-error-value="Could not refresh the list" class="elevate-collection-page"> <div class="elevate-collection-page--header"> <div class="elevate-collection-page--heading"> <div class="elevate-collection-page--title-line"> <h1 class="elevate-collection-page--title">Members</h1> <span class="elevate-collection-page--count">3</span> </div> </div> </div> <turbo-frame id="collection_page_custom_footer" data-turbo-action="advance"> <div class="elevate-collection-page--body"> <div data-controller="elevate-table-busy" class="elevate-table elevate-table--sticky-header"> <div class="contents"> <table class="elevate-table--table"> <thead class="elevate-table--head"> <tr> <th scope="col" class="elevate-table--th elevate-table--th-clip"> <span class="elevate-table--th-inner"> First name </span></th> <th scope="col" class="elevate-table--th elevate-table--th-clip"> <span class="elevate-table--th-inner"> Last name </span></th> <th scope="col" class="elevate-table--th elevate-table--th-clip"> <span class="elevate-table--th-inner"> Email </span></th> </tr> </thead> <tbody class="elevate-table--body"> <tr class="elevate-table--row"> <th scope="row" title="Marie" class="elevate-table--cell elevate-table--cell-primary elevate-table--cell-clip"> Marie </th> <td title="Curie" class="elevate-table--cell elevate-table--cell-clip"> Curie </td> <td title="marie.curie@botyglot.example" class="elevate-table--cell elevate-table--cell-clip"> marie.curie@botyglot.example </td> </tr> <tr class="elevate-table--row"> <th scope="row" title="Ada" class="elevate-table--cell elevate-table--cell-primary elevate-table--cell-clip"> Ada </th> <td title="Lovelace" class="elevate-table--cell elevate-table--cell-clip"> Lovelace </td> <td title="ada.lovelace@botyglot.example" class="elevate-table--cell elevate-table--cell-clip"> ada.lovelace@botyglot.example </td> </tr> <tr class="elevate-table--row"> <th scope="row" title="Grace" class="elevate-table--cell elevate-table--cell-primary elevate-table--cell-clip"> Grace </th> <td title="Hopper" class="elevate-table--cell elevate-table--cell-clip"> Hopper </td> <td title="grace.hopper@botyglot.example" class="elevate-table--cell elevate-table--cell-clip"> grace.hopper@botyglot.example </td> </tr> </tbody> </table> <div class="elevate-table--foot"> <a href="#export" class="">Export the full list instead of paginating it</a> </div> </div> </div> </div> </turbo-frame></div> </main> </body></html>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<% pagy = Elevate::PagyBuilder.build_pagy(count: members.size, limit: 10, page: 1) %><%= elevate_collection_page(title: "Members", count: members.size, collection: members, frame_id: "collection_page_custom_footer", pagy: pagy) do |collection_page| %> <% collection_page.with_footer do %> <%= elevate_link(url: "#export", scheme: :none) { "Export the full list instead of paginating it" } %> <% end %> <% collection_page.with_table do |table| %> <% table.with_column(type: :string, primary: true) do |col| %> First name <% col.with_row { |member| member.first_name } %> <% end %> <% table.with_column(type: :string) do |col| %> Last name <% col.with_row { |member| member.last_name } %> <% end %> <% table.with_column(type: :string) do |col| %> Email <% col.with_row { |member| member.email } %> <% end %> <% end %><% end %>collection_page.with_footer replaces the bricks pagy: would have composed — the caller
takes over the footer entirely, still inside the table's own card.
No params configured.
app/components/elevate/collection_page/collection_page.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@layer components { .elevate-collection-page { @apply flex flex-col gap-[16px] px-[24px] py-[20px]; container-type: inline-size; } .elevate-collection-page > turbo-frame, .elevate-collection-page--body { @apply flex flex-col flex-1 min-h-0; } .elevate-collection-page--breadcrumb { @apply text-[12.5px] text-secondary-500; } .elevate-collection-page--header { @apply flex items-start justify-between gap-[24px]; } .elevate-collection-page--heading { @apply flex min-w-0 flex-col gap-[3px]; } .elevate-collection-page--title-line { @apply flex items-center gap-[10px]; } .elevate-collection-page--title { @apply text-[20px] font-semibold leading-[28px] tracking-[-0.2px] text-secondary-900; } .elevate-collection-page--count { @apply inline-flex h-[20px] items-center rounded-full bg-secondary-100 px-[8px] text-[12px] font-semibold tabular-nums text-secondary-700; } .elevate-collection-page--subtitle { @apply text-[13px] leading-[18px] text-secondary-500; } .elevate-collection-page--actions { @apply flex flex-none items-center gap-[8px]; } /* The empty list's call to action is a copy of the header's primary action, so it wears the same shape. */ .elevate-collection-page--actions .elevate-button.elevate-button--size-s, .elevate-collection-page .elevate-empty-state--actions .elevate-button.elevate-button--size-s { @apply gap-[6px] font-semibold leading-none; } .elevate-collection-page--actions .elevate-button .elevate-button--leading-visual, .elevate-collection-page .elevate-empty-state--actions .elevate-button .elevate-button--leading-visual { @apply m-0 size-[14px]; } .elevate-collection-page--toolbar { @apply flex flex-wrap items-center gap-[8px]; } .elevate-collection-page--toolbar form[id$='_search_bar'] { @apply m-0; } .elevate-collection-page--toolbar-end { @apply ms-auto flex items-center gap-[8px]; } .elevate-collection-page--more { @apply grid h-[34px] w-[34px] cursor-pointer place-items-center rounded-[8px] border border-secondary-200 bg-white text-secondary-700 hover:bg-secondary-100; } /* Toolbar controls run 32px, header actions 34px — same trigger, smaller square. */ .elevate-collection-page--view-more { @apply h-[32px] w-[32px]; } .elevate-collection-page--more:focus-visible { @apply outline-2 outline-offset-2 outline-primary-700; } .elevate-collection-page--more .elevate-icon svg { @apply size-[16px]; } .elevate-collection-page--more ~ .elevate-dropdown--menu-container { @apply w-[200px]; } .elevate-collection-page--menu-item { @apply block w-full rounded-[7px] px-[10px] py-[6px] text-[12.5px] font-medium text-secondary-700 no-underline; } a.elevate-collection-page--menu-item:hover { @apply bg-secondary-100 text-secondary-900; } .elevate-collection-page--menu-item:focus-visible { @apply outline-2 outline-offset-2 outline-primary-700; } .elevate-collection-page--menu-item[aria-disabled='true'] { @apply cursor-not-allowed text-secondary-500; } .elevate-collection-page--menu-item-danger { @apply text-danger-700; } a.elevate-collection-page--menu-item-danger:hover { @apply bg-danger-50; } .elevate-collection-page--menu-separator { @apply my-[4px] h-px bg-secondary-100; } /* The narrow-layout duplicate of an inline action, and the "…" trigger when it exists only to hold those duplicates — both sit in the DOM at every width, and only swap visibility with `.elevate-collection-page--action-inline` under the container query below. */ .elevate-collection-page--action-folded { @apply hidden; } .elevate-collection-page--more-fold-only { @apply hidden; } @container (max-width: 639px) { /* Doubled to outweigh `.elevate-button.elevate-button--align-*`, which sets display. */ .elevate-collection-page--action-inline.elevate-collection-page--action-inline { @apply hidden; } .elevate-collection-page--action-folded { @apply block; } .elevate-collection-page--more-fold-only { @apply grid; } .elevate-collection-page--action-label { @apply hidden; } }}app/components/elevate/collection_page/collection_page_controller.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Controller } from "@hotwired/stimulus"// A link inside the list's turbo-frame that leads to a page without that frame — a record, a// related model — would leave "Content missing" in the list. The page follows it instead, as a// full visit of the response it already holds. A reload that fails says so rather than going// silent.export default class extends Controller { static values = { error: { type: String, default: "Could not refresh the list" } } recover(event) { event.preventDefault() event.detail.visit(event.detail.response) } warn() { window.toast?.(this.errorValue, { type: "error" }) }}