mensa 0.1.17 → 0.2.1
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/Gemfile.lock +120 -105
- data/README.md +3 -5
- data/app/components/mensa/view/component.html.slim +4 -4
- data/app/controllers/mensa/tables_controller.rb +1 -0
- data/app/helpers/mensa/tables_helper.rb +0 -1
- data/app/tables/mensa/base.rb +3 -3
- data/app/tables/mensa/config/table_dsl.rb +2 -1
- data/app/tables/mensa/config_readers.rb +5 -3
- data/app/tables/mensa/scope.rb +1 -1
- data/lib/mensa/version.rb +1 -1
- data/mensa.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7393ecb783abf8a65f707744bc94c3dda05fc62b3c607eba3c3700b1ce93fa28
|
|
4
|
+
data.tar.gz: ad6f2d96a68cac83adb19d9e9cb62f9dd0de72d830306a1420b6fbc14e2f71d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4935b9ade5b6a239f40bf81a051c772e469f6abf5ee3d619949940bee52e9ccd54d5c1ab6cb9113dc837e6a196977a6c8cb7bdad72438f5519a9eb5d66a9c1a5
|
|
7
|
+
data.tar.gz: 5a2edf045417c7a48b1fb1ee07291221221b89857f6c94592f9dc8297d40db1fdbe39829f4d7b86cfc8b980d36d5df236cd402bf9c4cb0e18cc7c597bd108a21
|
data/Gemfile.lock
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
GIT
|
|
2
2
|
remote: git@github.com:entdec/satis.git
|
|
3
|
-
revision:
|
|
3
|
+
revision: 1ef5f70700a755f01ed49168929200b2aaec792d
|
|
4
4
|
branch: main
|
|
5
5
|
specs:
|
|
6
|
-
satis (2.1
|
|
6
|
+
satis (2.2.1)
|
|
7
7
|
browser
|
|
8
8
|
diffy
|
|
9
9
|
importmap-rails
|
|
@@ -17,10 +17,10 @@ GIT
|
|
|
17
17
|
PATH
|
|
18
18
|
remote: .
|
|
19
19
|
specs:
|
|
20
|
-
mensa (0.
|
|
20
|
+
mensa (0.2.0)
|
|
21
21
|
caxlsx_rails (~> 0)
|
|
22
22
|
importmap-rails
|
|
23
|
-
pagy (>=
|
|
23
|
+
pagy (>= 43)
|
|
24
24
|
rails (>= 7.1)
|
|
25
25
|
slim
|
|
26
26
|
stimulus-rails
|
|
@@ -31,29 +31,31 @@ PATH
|
|
|
31
31
|
GEM
|
|
32
32
|
remote: https://rubygems.org/
|
|
33
33
|
specs:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
action_text-trix (2.1.15)
|
|
35
|
+
railties
|
|
36
|
+
actioncable (8.1.1)
|
|
37
|
+
actionpack (= 8.1.1)
|
|
38
|
+
activesupport (= 8.1.1)
|
|
37
39
|
nio4r (~> 2.0)
|
|
38
40
|
websocket-driver (>= 0.6.1)
|
|
39
41
|
zeitwerk (~> 2.6)
|
|
40
|
-
actionmailbox (8.
|
|
41
|
-
actionpack (= 8.
|
|
42
|
-
activejob (= 8.
|
|
43
|
-
activerecord (= 8.
|
|
44
|
-
activestorage (= 8.
|
|
45
|
-
activesupport (= 8.
|
|
42
|
+
actionmailbox (8.1.1)
|
|
43
|
+
actionpack (= 8.1.1)
|
|
44
|
+
activejob (= 8.1.1)
|
|
45
|
+
activerecord (= 8.1.1)
|
|
46
|
+
activestorage (= 8.1.1)
|
|
47
|
+
activesupport (= 8.1.1)
|
|
46
48
|
mail (>= 2.8.0)
|
|
47
|
-
actionmailer (8.
|
|
48
|
-
actionpack (= 8.
|
|
49
|
-
actionview (= 8.
|
|
50
|
-
activejob (= 8.
|
|
51
|
-
activesupport (= 8.
|
|
49
|
+
actionmailer (8.1.1)
|
|
50
|
+
actionpack (= 8.1.1)
|
|
51
|
+
actionview (= 8.1.1)
|
|
52
|
+
activejob (= 8.1.1)
|
|
53
|
+
activesupport (= 8.1.1)
|
|
52
54
|
mail (>= 2.8.0)
|
|
53
55
|
rails-dom-testing (~> 2.2)
|
|
54
|
-
actionpack (8.
|
|
55
|
-
actionview (= 8.
|
|
56
|
-
activesupport (= 8.
|
|
56
|
+
actionpack (8.1.1)
|
|
57
|
+
actionview (= 8.1.1)
|
|
58
|
+
activesupport (= 8.1.1)
|
|
57
59
|
nokogiri (>= 1.8.5)
|
|
58
60
|
rack (>= 2.2.4)
|
|
59
61
|
rack-session (>= 1.0.1)
|
|
@@ -61,42 +63,43 @@ GEM
|
|
|
61
63
|
rails-dom-testing (~> 2.2)
|
|
62
64
|
rails-html-sanitizer (~> 1.6)
|
|
63
65
|
useragent (~> 0.16)
|
|
64
|
-
actiontext (8.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
actiontext (8.1.1)
|
|
67
|
+
action_text-trix (~> 2.1.15)
|
|
68
|
+
actionpack (= 8.1.1)
|
|
69
|
+
activerecord (= 8.1.1)
|
|
70
|
+
activestorage (= 8.1.1)
|
|
71
|
+
activesupport (= 8.1.1)
|
|
69
72
|
globalid (>= 0.6.0)
|
|
70
73
|
nokogiri (>= 1.8.5)
|
|
71
|
-
actionview (8.
|
|
72
|
-
activesupport (= 8.
|
|
74
|
+
actionview (8.1.1)
|
|
75
|
+
activesupport (= 8.1.1)
|
|
73
76
|
builder (~> 3.1)
|
|
74
77
|
erubi (~> 1.11)
|
|
75
78
|
rails-dom-testing (~> 2.2)
|
|
76
79
|
rails-html-sanitizer (~> 1.6)
|
|
77
|
-
activejob (8.
|
|
78
|
-
activesupport (= 8.
|
|
80
|
+
activejob (8.1.1)
|
|
81
|
+
activesupport (= 8.1.1)
|
|
79
82
|
globalid (>= 0.3.6)
|
|
80
|
-
activemodel (8.
|
|
81
|
-
activesupport (= 8.
|
|
82
|
-
activerecord (8.
|
|
83
|
-
activemodel (= 8.
|
|
84
|
-
activesupport (= 8.
|
|
83
|
+
activemodel (8.1.1)
|
|
84
|
+
activesupport (= 8.1.1)
|
|
85
|
+
activerecord (8.1.1)
|
|
86
|
+
activemodel (= 8.1.1)
|
|
87
|
+
activesupport (= 8.1.1)
|
|
85
88
|
timeout (>= 0.4.0)
|
|
86
|
-
activestorage (8.
|
|
87
|
-
actionpack (= 8.
|
|
88
|
-
activejob (= 8.
|
|
89
|
-
activerecord (= 8.
|
|
90
|
-
activesupport (= 8.
|
|
89
|
+
activestorage (8.1.1)
|
|
90
|
+
actionpack (= 8.1.1)
|
|
91
|
+
activejob (= 8.1.1)
|
|
92
|
+
activerecord (= 8.1.1)
|
|
93
|
+
activesupport (= 8.1.1)
|
|
91
94
|
marcel (~> 1.0)
|
|
92
|
-
activesupport (8.
|
|
95
|
+
activesupport (8.1.1)
|
|
93
96
|
base64
|
|
94
|
-
benchmark (>= 0.3)
|
|
95
97
|
bigdecimal
|
|
96
98
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
97
99
|
connection_pool (>= 2.2.5)
|
|
98
100
|
drb
|
|
99
101
|
i18n (>= 1.6, < 2)
|
|
102
|
+
json
|
|
100
103
|
logger (>= 1.4.2)
|
|
101
104
|
minitest (>= 5.1)
|
|
102
105
|
securerandom (>= 0.3)
|
|
@@ -105,8 +108,7 @@ GEM
|
|
|
105
108
|
addressable (2.8.7)
|
|
106
109
|
public_suffix (>= 2.0.2, < 7.0)
|
|
107
110
|
base64 (0.3.0)
|
|
108
|
-
|
|
109
|
-
bigdecimal (3.2.2)
|
|
111
|
+
bigdecimal (3.3.1)
|
|
110
112
|
browser (6.2.0)
|
|
111
113
|
builder (3.3.0)
|
|
112
114
|
capybara (3.40.0)
|
|
@@ -118,37 +120,38 @@ GEM
|
|
|
118
120
|
rack-test (>= 0.6.3)
|
|
119
121
|
regexp_parser (>= 1.5, < 3.0)
|
|
120
122
|
xpath (~> 3.2)
|
|
121
|
-
caxlsx (4.
|
|
123
|
+
caxlsx (4.4.0)
|
|
122
124
|
htmlentities (~> 4.3, >= 4.3.4)
|
|
123
125
|
marcel (~> 1.0)
|
|
124
126
|
nokogiri (~> 1.10, >= 1.10.4)
|
|
125
|
-
rubyzip (>=
|
|
127
|
+
rubyzip (>= 2.4, < 4)
|
|
126
128
|
caxlsx_rails (0.6.4)
|
|
127
129
|
actionpack (>= 3.1)
|
|
128
130
|
caxlsx (>= 3.0)
|
|
129
131
|
coderay (1.1.3)
|
|
130
132
|
concurrent-ruby (1.3.5)
|
|
131
|
-
connection_pool (2.5.
|
|
133
|
+
connection_pool (2.5.4)
|
|
132
134
|
crass (1.0.6)
|
|
133
|
-
date (3.
|
|
135
|
+
date (3.5.0)
|
|
134
136
|
diffy (3.4.4)
|
|
135
137
|
drb (2.2.3)
|
|
136
|
-
erb (5.
|
|
138
|
+
erb (5.1.3)
|
|
137
139
|
erubi (1.13.1)
|
|
138
|
-
globalid (1.
|
|
140
|
+
globalid (1.3.0)
|
|
139
141
|
activesupport (>= 6.1)
|
|
140
142
|
htmlentities (4.3.4)
|
|
141
143
|
i18n (1.14.7)
|
|
142
144
|
concurrent-ruby (~> 1.0)
|
|
143
|
-
importmap-rails (2.
|
|
145
|
+
importmap-rails (2.2.2)
|
|
144
146
|
actionpack (>= 6.0.0)
|
|
145
147
|
activesupport (>= 6.0.0)
|
|
146
148
|
railties (>= 6.0.0)
|
|
147
|
-
io-console (0.8.
|
|
148
|
-
irb (1.15.
|
|
149
|
+
io-console (0.8.1)
|
|
150
|
+
irb (1.15.3)
|
|
149
151
|
pp (>= 0.6.0)
|
|
150
152
|
rdoc (>= 4.0.0)
|
|
151
153
|
reline (>= 0.4.2)
|
|
154
|
+
json (2.15.2)
|
|
152
155
|
jsonb_accessor (1.4)
|
|
153
156
|
activerecord (>= 6.1)
|
|
154
157
|
activesupport (>= 6.1)
|
|
@@ -157,17 +160,18 @@ GEM
|
|
|
157
160
|
loofah (2.24.1)
|
|
158
161
|
crass (~> 1.0.2)
|
|
159
162
|
nokogiri (>= 1.12.0)
|
|
160
|
-
mail (2.
|
|
163
|
+
mail (2.9.0)
|
|
164
|
+
logger
|
|
161
165
|
mini_mime (>= 0.1.1)
|
|
162
166
|
net-imap
|
|
163
167
|
net-pop
|
|
164
168
|
net-smtp
|
|
165
|
-
marcel (1.0
|
|
166
|
-
matrix (0.4.
|
|
169
|
+
marcel (1.1.0)
|
|
170
|
+
matrix (0.4.3)
|
|
167
171
|
method_source (1.1.0)
|
|
168
172
|
mini_mime (1.1.5)
|
|
169
|
-
minitest (5.
|
|
170
|
-
net-imap (0.5.
|
|
173
|
+
minitest (5.26.0)
|
|
174
|
+
net-imap (0.5.12)
|
|
171
175
|
date
|
|
172
176
|
net-protocol
|
|
173
177
|
net-pop (0.1.2)
|
|
@@ -176,26 +180,34 @@ GEM
|
|
|
176
180
|
timeout
|
|
177
181
|
net-smtp (0.5.1)
|
|
178
182
|
net-protocol
|
|
179
|
-
nio4r (2.7.
|
|
180
|
-
nokogiri (1.18.
|
|
183
|
+
nio4r (2.7.5)
|
|
184
|
+
nokogiri (1.18.10-aarch64-linux-gnu)
|
|
181
185
|
racc (~> 1.4)
|
|
182
|
-
nokogiri (1.18.
|
|
186
|
+
nokogiri (1.18.10-aarch64-linux-musl)
|
|
183
187
|
racc (~> 1.4)
|
|
184
|
-
nokogiri (1.18.
|
|
188
|
+
nokogiri (1.18.10-arm-linux-gnu)
|
|
185
189
|
racc (~> 1.4)
|
|
186
|
-
nokogiri (1.18.
|
|
190
|
+
nokogiri (1.18.10-arm-linux-musl)
|
|
187
191
|
racc (~> 1.4)
|
|
188
|
-
nokogiri (1.18.
|
|
192
|
+
nokogiri (1.18.10-arm64-darwin)
|
|
189
193
|
racc (~> 1.4)
|
|
190
|
-
nokogiri (1.18.
|
|
194
|
+
nokogiri (1.18.10-x86_64-darwin)
|
|
191
195
|
racc (~> 1.4)
|
|
192
|
-
nokogiri (1.18.
|
|
196
|
+
nokogiri (1.18.10-x86_64-linux-gnu)
|
|
193
197
|
racc (~> 1.4)
|
|
194
|
-
nokogiri (1.18.
|
|
198
|
+
nokogiri (1.18.10-x86_64-linux-musl)
|
|
195
199
|
racc (~> 1.4)
|
|
196
|
-
pagy (
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
pagy (43.0.0)
|
|
201
|
+
json
|
|
202
|
+
yaml
|
|
203
|
+
pg (1.6.2)
|
|
204
|
+
pg (1.6.2-aarch64-linux)
|
|
205
|
+
pg (1.6.2-aarch64-linux-musl)
|
|
206
|
+
pg (1.6.2-arm64-darwin)
|
|
207
|
+
pg (1.6.2-x86_64-darwin)
|
|
208
|
+
pg (1.6.2-x86_64-linux)
|
|
209
|
+
pg (1.6.2-x86_64-linux-musl)
|
|
210
|
+
pp (0.6.3)
|
|
199
211
|
prettyprint
|
|
200
212
|
prettyprint (0.2.0)
|
|
201
213
|
pry (0.15.2)
|
|
@@ -205,10 +217,10 @@ GEM
|
|
|
205
217
|
date
|
|
206
218
|
stringio
|
|
207
219
|
public_suffix (6.0.2)
|
|
208
|
-
puma (
|
|
220
|
+
puma (7.1.0)
|
|
209
221
|
nio4r (~> 2.0)
|
|
210
222
|
racc (1.8.1)
|
|
211
|
-
rack (3.
|
|
223
|
+
rack (3.2.4)
|
|
212
224
|
rack-session (2.1.1)
|
|
213
225
|
base64 (>= 0.1.0)
|
|
214
226
|
rack (>= 3.0.0)
|
|
@@ -216,20 +228,20 @@ GEM
|
|
|
216
228
|
rack (>= 1.3)
|
|
217
229
|
rackup (2.2.1)
|
|
218
230
|
rack (>= 3)
|
|
219
|
-
rails (8.
|
|
220
|
-
actioncable (= 8.
|
|
221
|
-
actionmailbox (= 8.
|
|
222
|
-
actionmailer (= 8.
|
|
223
|
-
actionpack (= 8.
|
|
224
|
-
actiontext (= 8.
|
|
225
|
-
actionview (= 8.
|
|
226
|
-
activejob (= 8.
|
|
227
|
-
activemodel (= 8.
|
|
228
|
-
activerecord (= 8.
|
|
229
|
-
activestorage (= 8.
|
|
230
|
-
activesupport (= 8.
|
|
231
|
+
rails (8.1.1)
|
|
232
|
+
actioncable (= 8.1.1)
|
|
233
|
+
actionmailbox (= 8.1.1)
|
|
234
|
+
actionmailer (= 8.1.1)
|
|
235
|
+
actionpack (= 8.1.1)
|
|
236
|
+
actiontext (= 8.1.1)
|
|
237
|
+
actionview (= 8.1.1)
|
|
238
|
+
activejob (= 8.1.1)
|
|
239
|
+
activemodel (= 8.1.1)
|
|
240
|
+
activerecord (= 8.1.1)
|
|
241
|
+
activestorage (= 8.1.1)
|
|
242
|
+
activesupport (= 8.1.1)
|
|
231
243
|
bundler (>= 1.15.0)
|
|
232
|
-
railties (= 8.
|
|
244
|
+
railties (= 8.1.1)
|
|
233
245
|
rails-dom-testing (2.3.0)
|
|
234
246
|
activesupport (>= 5.0.0)
|
|
235
247
|
minitest
|
|
@@ -237,29 +249,31 @@ GEM
|
|
|
237
249
|
rails-html-sanitizer (1.6.2)
|
|
238
250
|
loofah (~> 2.21)
|
|
239
251
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
240
|
-
railties (8.
|
|
241
|
-
actionpack (= 8.
|
|
242
|
-
activesupport (= 8.
|
|
252
|
+
railties (8.1.1)
|
|
253
|
+
actionpack (= 8.1.1)
|
|
254
|
+
activesupport (= 8.1.1)
|
|
243
255
|
irb (~> 1.13)
|
|
244
256
|
rackup (>= 1.0.0)
|
|
245
257
|
rake (>= 12.2)
|
|
246
258
|
thor (~> 1.0, >= 1.2.2)
|
|
259
|
+
tsort (>= 0.2)
|
|
247
260
|
zeitwerk (~> 2.6)
|
|
248
|
-
rake (13.3.
|
|
249
|
-
rdoc (6.
|
|
261
|
+
rake (13.3.1)
|
|
262
|
+
rdoc (6.15.1)
|
|
250
263
|
erb
|
|
251
264
|
psych (>= 4.0.0)
|
|
252
|
-
|
|
253
|
-
|
|
265
|
+
tsort
|
|
266
|
+
regexp_parser (2.11.3)
|
|
267
|
+
reline (0.6.2)
|
|
254
268
|
io-console (~> 0.5)
|
|
255
|
-
rexml (3.4.
|
|
256
|
-
rubyzip (2.
|
|
269
|
+
rexml (3.4.4)
|
|
270
|
+
rubyzip (3.2.2)
|
|
257
271
|
securerandom (0.4.1)
|
|
258
|
-
selenium-webdriver (4.
|
|
272
|
+
selenium-webdriver (4.38.0)
|
|
259
273
|
base64 (~> 0.2)
|
|
260
274
|
logger (~> 1.4)
|
|
261
275
|
rexml (~> 3.2, >= 3.2.5)
|
|
262
|
-
rubyzip (>= 1.2.2, <
|
|
276
|
+
rubyzip (>= 1.2.2, < 4.0)
|
|
263
277
|
websocket (~> 1.0)
|
|
264
278
|
slim (5.2.1)
|
|
265
279
|
temple (~> 0.10.0)
|
|
@@ -283,23 +297,23 @@ GEM
|
|
|
283
297
|
tailwindcss-ruby (3.4.17-arm64-darwin)
|
|
284
298
|
tailwindcss-ruby (3.4.17-x86_64-darwin)
|
|
285
299
|
tailwindcss-ruby (3.4.17-x86_64-linux)
|
|
286
|
-
temple (0.10.
|
|
300
|
+
temple (0.10.4)
|
|
287
301
|
textacular (5.7.0)
|
|
288
302
|
activerecord (>= 5.0)
|
|
289
|
-
thor (1.
|
|
290
|
-
tilt (2.6.
|
|
291
|
-
timeout (0.4.
|
|
292
|
-
|
|
303
|
+
thor (1.4.0)
|
|
304
|
+
tilt (2.6.1)
|
|
305
|
+
timeout (0.4.4)
|
|
306
|
+
tsort (0.2.0)
|
|
307
|
+
turbo-rails (2.0.20)
|
|
293
308
|
actionpack (>= 7.1.0)
|
|
294
309
|
railties (>= 7.1.0)
|
|
295
310
|
tzinfo (2.0.6)
|
|
296
311
|
concurrent-ruby (~> 1.0)
|
|
297
|
-
uri (1.
|
|
312
|
+
uri (1.1.1)
|
|
298
313
|
useragent (0.16.11)
|
|
299
|
-
view_component (
|
|
300
|
-
activesupport (>=
|
|
314
|
+
view_component (4.1.0)
|
|
315
|
+
activesupport (>= 7.1.0, < 8.2)
|
|
301
316
|
concurrent-ruby (~> 1)
|
|
302
|
-
method_source (~> 1.0)
|
|
303
317
|
websocket (1.2.11)
|
|
304
318
|
websocket-driver (0.8.0)
|
|
305
319
|
base64
|
|
@@ -307,6 +321,7 @@ GEM
|
|
|
307
321
|
websocket-extensions (0.1.5)
|
|
308
322
|
xpath (3.2.0)
|
|
309
323
|
nokogiri (~> 1.8)
|
|
324
|
+
yaml (0.4.0)
|
|
310
325
|
zeitwerk (2.7.3)
|
|
311
326
|
|
|
312
327
|
PLATFORMS
|
data/README.md
CHANGED
|
@@ -76,18 +76,16 @@ You can show your tables on the page using the following:
|
|
|
76
76
|
|
|
77
77
|
#### Views
|
|
78
78
|
|
|
79
|
-
Initial support for views is there, but pretty
|
|
79
|
+
Initial support for views is there, but pretty rudimentary:
|
|
80
80
|
`Mensa::TableView.create(table: "users", name: "Guests", data: {filters: {role: "guest"}})`
|
|
81
81
|
|
|
82
82
|
### Fast
|
|
83
83
|
|
|
84
84
|
Mensa selects only the data it needs, based on the columns. Sometimes it needs additional columns to do it's work, but you don't want them displayed.
|
|
85
|
-
This can be done by adding `internal true` to the column definition
|
|
85
|
+
This can be done by adding `internal true` to the column definition, or shorter: use `internal` instead
|
|
86
86
|
|
|
87
87
|
```ruby
|
|
88
|
-
|
|
89
|
-
internal true # Needed for age below
|
|
90
|
-
end
|
|
88
|
+
internal :born_on
|
|
91
89
|
column :age do
|
|
92
90
|
attribute "EXTRACT(YEAR FROM AGE(born_on))::int"
|
|
93
91
|
end
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
tbody
|
|
11
11
|
= render(Mensa::TableRow::Component.with_collection(table.rows, table: table))
|
|
12
12
|
|
|
13
|
-
- if table.pagy_details&.
|
|
13
|
+
- if table.pagy_details&.last > 1 || table.pagy_details.count == 0
|
|
14
14
|
.paging
|
|
15
|
-
==
|
|
16
|
-
- if table.pagy_details&.
|
|
17
|
-
==
|
|
15
|
+
== table.pagy_details.info_tag
|
|
16
|
+
- if table.pagy_details&.last > 1
|
|
17
|
+
== table.pagy_details.series_nav(anchor_string: 'data-turbo-frame="_self"')
|
|
@@ -18,6 +18,7 @@ module Mensa
|
|
|
18
18
|
config = config.merge(params.permit(:format, :query, :id, :page, :table_view_id, :turbo_frame_id, order: {}, filters: {}).to_h)
|
|
19
19
|
|
|
20
20
|
@table = Mensa.for_name(params[:id], config)
|
|
21
|
+
@table.request = request
|
|
21
22
|
@table.table_view = @view
|
|
22
23
|
@table.original_view_context = helpers
|
|
23
24
|
|
data/app/tables/mensa/base.rb
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module Mensa
|
|
2
2
|
class Base
|
|
3
|
-
include Pagy::
|
|
3
|
+
include Pagy::Method
|
|
4
4
|
include ConfigReaders
|
|
5
5
|
include Scope
|
|
6
6
|
|
|
7
7
|
attr_writer :original_view_context
|
|
8
|
-
attr_accessor :component, :name, :table_view
|
|
8
|
+
attr_accessor :component, :name, :table_view, :request
|
|
9
9
|
attr_reader :config, :params
|
|
10
10
|
|
|
11
|
-
config_reader :model
|
|
11
|
+
config_reader :model, proc: true
|
|
12
12
|
config_reader :link
|
|
13
13
|
config_reader :supports_views?
|
|
14
14
|
config_reader :supports_custom_views?
|
|
@@ -48,8 +48,9 @@ module Mensa::Config
|
|
|
48
48
|
class TableDsl
|
|
49
49
|
include DslLogic
|
|
50
50
|
|
|
51
|
-
option :model, default: -> { self.class.name.demodulize.to_s.classify.constantize rescue raise "No model found for #{self.class.name}" }
|
|
51
|
+
option :model, default: -> { self.class.name.demodulize.to_s.classify.gsub("Table","").singularize.constantize rescue raise "No model found for #{self.class.name}" }
|
|
52
52
|
option :column, dsl_hash: Mensa::Config::ColumnDsl
|
|
53
|
+
option :internal, dsl_hash: Mensa::Config::ColumnDsl, default: {internal: true}
|
|
53
54
|
option :link
|
|
54
55
|
|
|
55
56
|
option :exportable, default: true
|
|
@@ -3,11 +3,13 @@ module Mensa
|
|
|
3
3
|
extend ActiveSupport::Concern
|
|
4
4
|
|
|
5
5
|
class_methods do
|
|
6
|
-
|
|
6
|
+
# Having proc here should not necessary, but not having it gave me issues with row links
|
|
7
|
+
def config_reader(name, proc: false)
|
|
7
8
|
define_method name do
|
|
8
|
-
config[name.to_s.gsub("?", "").to_sym]
|
|
9
|
+
value = config[name.to_s.gsub("?", "").to_sym]
|
|
10
|
+
proc == true && value.is_a?(Proc) ? instance_exec(&value) : value
|
|
9
11
|
end
|
|
10
12
|
end
|
|
11
13
|
end
|
|
12
14
|
end
|
|
13
|
-
end
|
|
15
|
+
end
|
data/app/tables/mensa/scope.rb
CHANGED
|
@@ -72,7 +72,7 @@ module Mensa
|
|
|
72
72
|
def pagy_object
|
|
73
73
|
return if @pagy_details && @records
|
|
74
74
|
|
|
75
|
-
@pagy_details, @records = selected_scope.is_a?(Array) ?
|
|
75
|
+
@pagy_details, @records = selected_scope.is_a?(Array) ? pagy(:offset, ordered_scope, anchor_string: 'data-turbo-frame="_self"') : pagy(:offset, selected_scope, anchor_string: 'data-turbo-frame="_self"')
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
# Though this works, perhaps moving this in column(s) is nicer
|
data/lib/mensa/version.rb
CHANGED
data/mensa.gemspec
CHANGED
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
|
|
32
32
|
spec.add_dependency 'caxlsx_rails', '~> 0'
|
|
33
33
|
spec.add_dependency "rails", ">= 7.1"
|
|
34
|
-
spec.add_dependency 'pagy', '>=
|
|
34
|
+
spec.add_dependency 'pagy', '>=43'
|
|
35
35
|
spec.add_dependency 'textacular', '>=5'
|
|
36
36
|
|
|
37
37
|
spec.add_dependency 'slim'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mensa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom de Grunt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: caxlsx_rails
|
|
@@ -44,14 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
47
|
+
version: '43'
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
54
|
+
version: '43'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: textacular
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|