avo 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +5 -1
- data/Gemfile.lock +94 -70
- data/README.md +11 -0
- data/app/components/avo/fields/common/badge_viewer_component.html.erb +1 -1
- data/app/components/avo/fields/common/multiple_file_viewer_component.html.erb +1 -1
- data/app/components/avo/fields/common/single_file_viewer_component.html.erb +1 -1
- data/app/components/avo/fields/file_field/index_component.html.erb +1 -1
- data/app/components/avo/fields/trix_field/edit_component.html.erb +3 -0
- data/app/components/avo/index/grid_item_component.html.erb +4 -6
- data/app/components/avo/views/resource_index_component.html.erb +48 -46
- data/app/components/avo/views/resource_index_component.rb +1 -1
- data/app/controllers/avo/actions_controller.rb +2 -2
- data/app/controllers/avo/application_controller.rb +11 -10
- data/app/controllers/avo/base_controller.rb +20 -4
- data/app/controllers/avo/relations_controller.rb +1 -1
- data/app/controllers/avo/search_controller.rb +11 -8
- data/app/packs/js/controllers/fields/trix_field_controller.js +16 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/attachments/show.html.erb +1 -1
- data/app/views/avo/base/_actions.html.erb +2 -2
- data/app/views/avo/home/index.html.erb +2 -2
- data/app/views/avo/partials/_javascript.html.erb +1 -1
- data/app/views/avo/partials/_resource_search.html.erb +1 -1
- data/app/views/avo/relations/new.html.erb +1 -1
- data/app/views/avo/sidebar/_sidebar.html.erb +1 -1
- data/config/initializers/friendly_id.rb +107 -0
- data/db/migrate/20210525143134_add_slug_to_users.rb +6 -0
- data/lib/avo/app.rb +3 -1
- data/lib/avo/base_resource.rb +23 -3
- data/lib/avo/configuration.rb +7 -1
- data/lib/avo/fields/belongs_to_field.rb +1 -1
- data/lib/avo/fields/file_field.rb +0 -8
- data/lib/avo/fields/has_and_belongs_to_many_field.rb +4 -4
- data/lib/avo/fields/has_many_field.rb +4 -4
- data/lib/avo/fields/has_one_field.rb +4 -4
- data/lib/avo/fields/trix_field.rb +6 -0
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/field_generator.rb +1 -1
- data/lib/generators/avo/install_generator.rb +1 -1
- data/lib/generators/avo/templates/initializer/avo.tt +1 -0
- data/lib/generators/avo/templates/tool/sidebar_item.tt +1 -1
- data/public/avo-packs/css/application-797341b7.css.map +1 -1
- data/public/avo-packs/css/application-797341b7.css.map.br +0 -0
- data/public/avo-packs/css/application-797341b7.css.map.gz +0 -0
- data/public/avo-packs/js/application-651ed7b9bc727c83f673.js +26 -0
- data/public/avo-packs/js/{application-947ed727440d5b5d73ab.js.LICENSE.txt → application-651ed7b9bc727c83f673.js.LICENSE.txt} +0 -0
- data/public/avo-packs/js/application-651ed7b9bc727c83f673.js.br +0 -0
- data/public/avo-packs/js/application-651ed7b9bc727c83f673.js.gz +0 -0
- data/public/avo-packs/js/application-651ed7b9bc727c83f673.js.map +1 -0
- data/public/avo-packs/js/application-651ed7b9bc727c83f673.js.map.br +0 -0
- data/public/avo-packs/js/application-651ed7b9bc727c83f673.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +8 -8
- metadata +11 -9
- data/public/avo-packs/js/application-947ed727440d5b5d73ab.js +0 -26
- data/public/avo-packs/js/application-947ed727440d5b5d73ab.js.br +0 -0
- data/public/avo-packs/js/application-947ed727440d5b5d73ab.js.gz +0 -0
- data/public/avo-packs/js/application-947ed727440d5b5d73ab.js.map +0 -1
- data/public/avo-packs/js/application-947ed727440d5b5d73ab.js.map.br +0 -0
- data/public/avo-packs/js/application-947ed727440d5b5d73ab.js.map.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78d73971b60df286d59014cbc4880dae16f3b01a1caa0f6f5e36d5df5c3d5eed
|
4
|
+
data.tar.gz: 3961b99da8e7c49ea6495a813e7267f9a4feef6efd60f50ca06fdeaffe57e286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8c3682679faaf8f172a07505b025d86989b6c08e1e5df0e5e61ae8c90c90406099594214cc0acfb767221c248ec5e955f5c512ffddd2755a1c4465f0b61d1e5
|
7
|
+
data.tar.gz: 621f3f3804c7111cc4d3988bbe266290796963f1caa8be70a6e81a6cca637fb59f45fe20f032f00be858514ec38335007c4808ef383bb011e2f92f01c4e6d586
|
data/Gemfile
CHANGED
@@ -26,7 +26,7 @@ gem "pundit"
|
|
26
26
|
# Dependencies for dummy_app
|
27
27
|
#
|
28
28
|
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
29
|
-
gem "rails", "~> 6.
|
29
|
+
gem "rails", "~> 6.1.0"
|
30
30
|
# Use postgresql as the database for Active Record
|
31
31
|
gem "pg", ">= 0.18", "< 2.0"
|
32
32
|
# Use Puma as the app server
|
@@ -128,3 +128,7 @@ gem 'breadcrumbs_on_rails'
|
|
128
128
|
gem 'manifester'
|
129
129
|
|
130
130
|
gem 'ransack'
|
131
|
+
|
132
|
+
gem 'friendly_id', '~> 5.4.0'
|
133
|
+
|
134
|
+
gem "aws-sdk-s3", require: false
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (1.
|
4
|
+
avo (1.8.0)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
breadcrumbs_on_rails
|
@@ -21,38 +21,40 @@ PATH
|
|
21
21
|
GEM
|
22
22
|
remote: https://rubygems.org/
|
23
23
|
specs:
|
24
|
-
actioncable (6.
|
25
|
-
actionpack (= 6.
|
24
|
+
actioncable (6.1.3.2)
|
25
|
+
actionpack (= 6.1.3.2)
|
26
|
+
activesupport (= 6.1.3.2)
|
26
27
|
nio4r (~> 2.0)
|
27
28
|
websocket-driver (>= 0.6.1)
|
28
|
-
actionmailbox (6.
|
29
|
-
actionpack (= 6.
|
30
|
-
activejob (= 6.
|
31
|
-
activerecord (= 6.
|
32
|
-
activestorage (= 6.
|
33
|
-
activesupport (= 6.
|
29
|
+
actionmailbox (6.1.3.2)
|
30
|
+
actionpack (= 6.1.3.2)
|
31
|
+
activejob (= 6.1.3.2)
|
32
|
+
activerecord (= 6.1.3.2)
|
33
|
+
activestorage (= 6.1.3.2)
|
34
|
+
activesupport (= 6.1.3.2)
|
34
35
|
mail (>= 2.7.1)
|
35
|
-
actionmailer (6.
|
36
|
-
actionpack (= 6.
|
37
|
-
actionview (= 6.
|
38
|
-
activejob (= 6.
|
36
|
+
actionmailer (6.1.3.2)
|
37
|
+
actionpack (= 6.1.3.2)
|
38
|
+
actionview (= 6.1.3.2)
|
39
|
+
activejob (= 6.1.3.2)
|
40
|
+
activesupport (= 6.1.3.2)
|
39
41
|
mail (~> 2.5, >= 2.5.4)
|
40
42
|
rails-dom-testing (~> 2.0)
|
41
|
-
actionpack (6.
|
42
|
-
actionview (= 6.
|
43
|
-
activesupport (= 6.
|
44
|
-
rack (~> 2.0, >= 2.0.
|
43
|
+
actionpack (6.1.3.2)
|
44
|
+
actionview (= 6.1.3.2)
|
45
|
+
activesupport (= 6.1.3.2)
|
46
|
+
rack (~> 2.0, >= 2.0.9)
|
45
47
|
rack-test (>= 0.6.3)
|
46
48
|
rails-dom-testing (~> 2.0)
|
47
49
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
48
|
-
actiontext (6.
|
49
|
-
actionpack (= 6.
|
50
|
-
activerecord (= 6.
|
51
|
-
activestorage (= 6.
|
52
|
-
activesupport (= 6.
|
50
|
+
actiontext (6.1.3.2)
|
51
|
+
actionpack (= 6.1.3.2)
|
52
|
+
activerecord (= 6.1.3.2)
|
53
|
+
activestorage (= 6.1.3.2)
|
54
|
+
activesupport (= 6.1.3.2)
|
53
55
|
nokogiri (>= 1.8.5)
|
54
|
-
actionview (6.
|
55
|
-
activesupport (= 6.
|
56
|
+
actionview (6.1.3.2)
|
57
|
+
activesupport (= 6.1.3.2)
|
56
58
|
builder (~> 3.1)
|
57
59
|
erubi (~> 1.4)
|
58
60
|
rails-dom-testing (~> 2.0)
|
@@ -60,25 +62,27 @@ GEM
|
|
60
62
|
active_link_to (1.0.5)
|
61
63
|
actionpack
|
62
64
|
addressable
|
63
|
-
activejob (6.
|
64
|
-
activesupport (= 6.
|
65
|
+
activejob (6.1.3.2)
|
66
|
+
activesupport (= 6.1.3.2)
|
65
67
|
globalid (>= 0.3.6)
|
66
|
-
activemodel (6.
|
67
|
-
activesupport (= 6.
|
68
|
-
activerecord (6.
|
69
|
-
activemodel (= 6.
|
70
|
-
activesupport (= 6.
|
71
|
-
activestorage (6.
|
72
|
-
actionpack (= 6.
|
73
|
-
activejob (= 6.
|
74
|
-
activerecord (= 6.
|
68
|
+
activemodel (6.1.3.2)
|
69
|
+
activesupport (= 6.1.3.2)
|
70
|
+
activerecord (6.1.3.2)
|
71
|
+
activemodel (= 6.1.3.2)
|
72
|
+
activesupport (= 6.1.3.2)
|
73
|
+
activestorage (6.1.3.2)
|
74
|
+
actionpack (= 6.1.3.2)
|
75
|
+
activejob (= 6.1.3.2)
|
76
|
+
activerecord (= 6.1.3.2)
|
77
|
+
activesupport (= 6.1.3.2)
|
75
78
|
marcel (~> 1.0.0)
|
76
|
-
|
79
|
+
mini_mime (~> 1.0.2)
|
80
|
+
activesupport (6.1.3.2)
|
77
81
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
78
|
-
i18n (>=
|
79
|
-
minitest (
|
80
|
-
tzinfo (~>
|
81
|
-
zeitwerk (~> 2.
|
82
|
+
i18n (>= 1.6, < 2)
|
83
|
+
minitest (>= 5.1)
|
84
|
+
tzinfo (~> 2.0)
|
85
|
+
zeitwerk (~> 2.3)
|
82
86
|
addressable (2.7.0)
|
83
87
|
public_suffix (>= 2.0.2, < 5.0)
|
84
88
|
appraisal (2.4.0)
|
@@ -86,6 +90,22 @@ GEM
|
|
86
90
|
rake
|
87
91
|
thor (>= 0.14.0)
|
88
92
|
ast (2.4.2)
|
93
|
+
aws-eventstream (1.1.1)
|
94
|
+
aws-partitions (1.465.0)
|
95
|
+
aws-sdk-core (3.114.1)
|
96
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
97
|
+
aws-partitions (~> 1, >= 1.239.0)
|
98
|
+
aws-sigv4 (~> 1.1)
|
99
|
+
jmespath (~> 1.0)
|
100
|
+
aws-sdk-kms (1.43.0)
|
101
|
+
aws-sdk-core (~> 3, >= 3.112.0)
|
102
|
+
aws-sigv4 (~> 1.1)
|
103
|
+
aws-sdk-s3 (1.95.1)
|
104
|
+
aws-sdk-core (~> 3, >= 3.112.0)
|
105
|
+
aws-sdk-kms (~> 1)
|
106
|
+
aws-sigv4 (~> 1.1)
|
107
|
+
aws-sigv4 (1.2.3)
|
108
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
89
109
|
bcrypt (3.1.16)
|
90
110
|
bindex (0.8.1)
|
91
111
|
bootsnap (1.7.3)
|
@@ -133,6 +153,8 @@ GEM
|
|
133
153
|
faker (2.14.0)
|
134
154
|
i18n (>= 1.6, < 2)
|
135
155
|
ffi (1.15.0)
|
156
|
+
friendly_id (5.4.2)
|
157
|
+
activerecord (>= 4.0.0)
|
136
158
|
fuubar (2.5.0)
|
137
159
|
rspec-core (~> 3.0)
|
138
160
|
ruby-progressbar (~> 1.4)
|
@@ -157,6 +179,7 @@ GEM
|
|
157
179
|
i18n
|
158
180
|
jbuilder (2.10.1)
|
159
181
|
activesupport (>= 5.0.0)
|
182
|
+
jmespath (1.4.0)
|
160
183
|
launchy (2.5.0)
|
161
184
|
addressable (~> 2.7)
|
162
185
|
listen (3.5.1)
|
@@ -178,19 +201,19 @@ GEM
|
|
178
201
|
mime-types-data (~> 3.2015)
|
179
202
|
mime-types-data (3.2021.0225)
|
180
203
|
mini_magick (4.11.0)
|
181
|
-
mini_mime (1.
|
182
|
-
mini_portile2 (2.5.
|
204
|
+
mini_mime (1.0.3)
|
205
|
+
mini_portile2 (2.5.3)
|
183
206
|
minitest (5.14.4)
|
184
207
|
msgpack (1.4.2)
|
185
208
|
multi_xml (0.6.0)
|
186
209
|
nio4r (2.5.7)
|
187
|
-
nokogiri (1.11.
|
210
|
+
nokogiri (1.11.7)
|
188
211
|
mini_portile2 (~> 2.5.0)
|
189
212
|
racc (~> 1.4)
|
190
|
-
nokogiri (1.11.
|
213
|
+
nokogiri (1.11.7-x86_64-linux)
|
191
214
|
racc (~> 1.4)
|
192
215
|
orm_adapter (0.5.0)
|
193
|
-
pagy (
|
216
|
+
pagy (4.8.0)
|
194
217
|
parallel (1.20.1)
|
195
218
|
parser (3.0.0.0)
|
196
219
|
ast (~> 2.4.1)
|
@@ -206,20 +229,20 @@ GEM
|
|
206
229
|
rack
|
207
230
|
rack-test (1.1.0)
|
208
231
|
rack (>= 1.0, < 3)
|
209
|
-
rails (6.
|
210
|
-
actioncable (= 6.
|
211
|
-
actionmailbox (= 6.
|
212
|
-
actionmailer (= 6.
|
213
|
-
actionpack (= 6.
|
214
|
-
actiontext (= 6.
|
215
|
-
actionview (= 6.
|
216
|
-
activejob (= 6.
|
217
|
-
activemodel (= 6.
|
218
|
-
activerecord (= 6.
|
219
|
-
activestorage (= 6.
|
220
|
-
activesupport (= 6.
|
221
|
-
bundler (>= 1.
|
222
|
-
railties (= 6.
|
232
|
+
rails (6.1.3.2)
|
233
|
+
actioncable (= 6.1.3.2)
|
234
|
+
actionmailbox (= 6.1.3.2)
|
235
|
+
actionmailer (= 6.1.3.2)
|
236
|
+
actionpack (= 6.1.3.2)
|
237
|
+
actiontext (= 6.1.3.2)
|
238
|
+
actionview (= 6.1.3.2)
|
239
|
+
activejob (= 6.1.3.2)
|
240
|
+
activemodel (= 6.1.3.2)
|
241
|
+
activerecord (= 6.1.3.2)
|
242
|
+
activestorage (= 6.1.3.2)
|
243
|
+
activesupport (= 6.1.3.2)
|
244
|
+
bundler (>= 1.15.0)
|
245
|
+
railties (= 6.1.3.2)
|
223
246
|
sprockets-rails (>= 2.0.0)
|
224
247
|
rails-controller-testing (1.0.5)
|
225
248
|
actionpack (>= 5.0.1.rc1)
|
@@ -230,12 +253,12 @@ GEM
|
|
230
253
|
nokogiri (>= 1.6)
|
231
254
|
rails-html-sanitizer (1.3.0)
|
232
255
|
loofah (~> 2.3)
|
233
|
-
railties (6.
|
234
|
-
actionpack (= 6.
|
235
|
-
activesupport (= 6.
|
256
|
+
railties (6.1.3.2)
|
257
|
+
actionpack (= 6.1.3.2)
|
258
|
+
activesupport (= 6.1.3.2)
|
236
259
|
method_source
|
237
260
|
rake (>= 0.8.7)
|
238
|
-
thor (
|
261
|
+
thor (~> 1.0)
|
239
262
|
rainbow (3.0.0)
|
240
263
|
rake (13.0.3)
|
241
264
|
ransack (2.4.2)
|
@@ -325,19 +348,18 @@ GEM
|
|
325
348
|
rails (>= 6.0.0)
|
326
349
|
test-prof (0.12.2)
|
327
350
|
thor (1.1.0)
|
328
|
-
thread_safe (0.3.6)
|
329
351
|
tilt (2.0.10)
|
330
352
|
turbo-rails (0.5.9)
|
331
353
|
rails (>= 6.0.0)
|
332
|
-
tzinfo (
|
333
|
-
|
354
|
+
tzinfo (2.0.4)
|
355
|
+
concurrent-ruby (~> 1.0)
|
334
356
|
unicode-display_width (2.0.0)
|
335
357
|
unicode_utils (1.4.0)
|
336
|
-
view_component (2.
|
358
|
+
view_component (2.33.0)
|
337
359
|
activesupport (>= 5.0.0, < 7.0)
|
338
360
|
warden (1.2.9)
|
339
361
|
rack (>= 2.0.9)
|
340
|
-
web-console (4.0
|
362
|
+
web-console (4.1.0)
|
341
363
|
actionview (>= 6.0.0)
|
342
364
|
activemodel (>= 6.0.0)
|
343
365
|
bindex (>= 0.4.0)
|
@@ -355,7 +377,7 @@ GEM
|
|
355
377
|
rack-proxy (>= 0.6.1)
|
356
378
|
railties (>= 5.2)
|
357
379
|
semantic_range (>= 2.3.0)
|
358
|
-
websocket-driver (0.7.
|
380
|
+
websocket-driver (0.7.4)
|
359
381
|
websocket-extensions (>= 0.1.0)
|
360
382
|
websocket-extensions (0.1.5)
|
361
383
|
xpath (3.2.0)
|
@@ -371,6 +393,7 @@ DEPENDENCIES
|
|
371
393
|
addressable
|
372
394
|
appraisal
|
373
395
|
avo!
|
396
|
+
aws-sdk-s3
|
374
397
|
bootsnap (>= 1.4.2)
|
375
398
|
breadcrumbs_on_rails
|
376
399
|
bump
|
@@ -382,6 +405,7 @@ DEPENDENCIES
|
|
382
405
|
dotenv-rails
|
383
406
|
factory_bot_rails
|
384
407
|
faker
|
408
|
+
friendly_id (~> 5.4.0)
|
385
409
|
fuubar
|
386
410
|
gem-release
|
387
411
|
hotwire-rails
|
@@ -396,7 +420,7 @@ DEPENDENCIES
|
|
396
420
|
pg (>= 0.18, < 2.0)
|
397
421
|
puma (~> 5.3.1)
|
398
422
|
pundit
|
399
|
-
rails (~> 6.
|
423
|
+
rails (~> 6.1.0)
|
400
424
|
rails-controller-testing
|
401
425
|
ransack
|
402
426
|
rspec-rails (~> 4.0.0)
|
data/README.md
CHANGED
@@ -52,6 +52,10 @@ And then execute:
|
|
52
52
|
$ bundle install
|
53
53
|
```
|
54
54
|
|
55
|
+
# Quick Purchase
|
56
|
+
|
57
|
+
Use [this](https://buy.stripe.com/9AQ6rX0uIbLF2CQdQQ) link to quickly purchase a Pro license to support this project. Thank you 🙏
|
58
|
+
|
55
59
|
# Contributing
|
56
60
|
|
57
61
|
Please read [CONTRIBUTING.MD](./CONTRIBUTING.MD)
|
@@ -59,3 +63,10 @@ Please read [CONTRIBUTING.MD](./CONTRIBUTING.MD)
|
|
59
63
|
# Upgrade Guide
|
60
64
|
|
61
65
|
Please read the [UPGRADE_GUIDE.MD](https://docs.avohq.io/1.0/upgrade.html)
|
66
|
+
|
67
|
+
# ✨ Contributors
|
68
|
+
|
69
|
+
<a href="https://github.com/avo-hq/avo/graphs/contributors">
|
70
|
+
<img src="https://contrib.rocks/image?repo=avo-hq/avo" />
|
71
|
+
</a>
|
72
|
+
<!-- https://contrib.rocks -->
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: 'text-center', size: :xs do %>
|
18
18
|
<%= helpers.svg 'download' %> <span class="hidden lg:block lg:flex-1"><%= t('avo.download_file') %></span>
|
19
19
|
<% end %>
|
20
|
-
<%= a_link "#{Avo.
|
20
|
+
<%= a_link "#{Avo::App.root_path}/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
|
21
21
|
}/active_storage_attachments/#{@id}/#{@file.id}", color: :red, variant: :outlined, size: :xs, class: 'text-center', 'data-turbo-frame': 'destroy_attachment_form', data: { confirm: t('avo.are_you_sure')} do %>
|
22
22
|
<%= helpers.svg 'trash' %> <span class="hidden lg:block lg:flex-1"><%= t 'avo.delete_file', item: @file.filename %></span>
|
23
23
|
<% end %>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: '', size: :md do %>
|
18
18
|
<%= helpers.svg 'download' %> <%= t('avo.download_file') %>
|
19
19
|
<% end %>
|
20
|
-
<%= a_link "#{Avo.
|
20
|
+
<%= a_link "#{Avo::App.root_path}/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
|
21
21
|
}/active_storage_attachments/#{@id}/#{@file.id}", color: :red, variant: :outlined, size: :md, class: '', 'data-turbo-frame': 'destroy_attachment_form', data: { confirm: t('avo.are_you_sure')} do %>
|
22
22
|
<%= helpers.svg 'trash' %> <%= t 'avo.delete_file', item: @file.filename %>
|
23
23
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= index_field_wrapper field: @field do %>
|
2
2
|
<% if @field.value.present? %>
|
3
3
|
<% if @field.value.attached? && @field.value.representable? && @field.is_image %>
|
4
|
-
<%= link_to_if @field.link_to_resource, image_tag(@field.
|
4
|
+
<%= link_to_if @field.link_to_resource, image_tag(helpers.main_app.url_for(@field.value), class: 'max-h-full'), resource_path, class: 'block h-8' %>
|
5
5
|
<% else %>
|
6
6
|
<%= @field.value.filename %>
|
7
7
|
<% end %>
|
@@ -6,6 +6,9 @@
|
|
6
6
|
data-resource-id="<%= @resource.model.id %>"
|
7
7
|
data-attachments-disabled="<%= @field.attachments_disabled %>"
|
8
8
|
data-attachment-key="<%= @field.attachment_key %>"
|
9
|
+
data-hide-attachment-filename="<%= @field.hide_attachment_filename %>"
|
10
|
+
data-hide-attachment-filesize="<%= @field.hide_attachment_filesize %>"
|
11
|
+
data-hide-attachment-url="<%= @field.hide_attachment_url %>"
|
9
12
|
>
|
10
13
|
<% trix_id = "trix_#{@resource.name.underscore}_#{@field.id}" %>
|
11
14
|
<trix-editor data-trix-field-target="editor" input="<%= trix_id %>" placeholder="<%= @field.placeholder %>"><%== @field.value %></trix-editor>
|
@@ -10,18 +10,16 @@
|
|
10
10
|
<%= link_to_if cover.link_to_resource, image_tag(cover.to_image, class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
|
11
11
|
<% elsif cover.type == 'file' %>
|
12
12
|
<% if cover.value.attached? && cover.value.representable? %>
|
13
|
-
<%= link_to_if cover.link_to_resource, image_tag(cover.variant(resize_to_limit: [480, 480]), class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
|
13
|
+
<%= link_to_if cover.link_to_resource, image_tag(helpers.main_app.url_for(cover.value.variant(resize_to_limit: [480, 480])), class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
|
14
14
|
<% else %>
|
15
15
|
<div class="absolute bg-gray-100 w-full h-full">
|
16
16
|
<%= helpers.svg 'avocado', class: 'relative transform -translate-x-1/2 -translate-y-1/2 h-20 text-gray-400 inset-auto top-1/2 left-1/2' %>
|
17
17
|
</div>
|
18
18
|
<% end %>
|
19
|
+
<% elsif cover.value.present? %>
|
20
|
+
<%= link_to_if cover.link_to_resource, image_tag(cover.value, class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
|
19
21
|
<% else %>
|
20
|
-
|
21
|
-
<%= link_to_if cover.link_to_resource, image_tag(cover.value, class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
|
22
|
-
<% else %>
|
23
|
-
<%= render Avo::Index::GridCoverEmptyStateComponent.new %>
|
24
|
-
<% end %>
|
22
|
+
<%= render Avo::Index::GridCoverEmptyStateComponent.new %>
|
25
23
|
<% end %>
|
26
24
|
</div>
|
27
25
|
<div class="grid grid-cols-1 place-content-between p-4 h-full">
|
@@ -1,62 +1,64 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
<div>
|
2
|
+
<%= render Avo::PanelComponent.new(title: title, body_classes: 'py-4', data: { component: 'resources-index' }, display_breadcrumbs: @reflection.blank?) do |c| %>
|
3
|
+
<% c.tools do %>
|
4
|
+
<%= render 'actions' if @actions.present? %>
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
<% if can_create? %>
|
7
|
+
<%= a_link create_path do %>
|
8
|
+
<%= svg 'plus' %> <%= t('avo.create_new_item', item: @resource.model_class.model_name.human.downcase ) %>
|
9
|
+
<% end %>
|
8
10
|
<% end %>
|
9
|
-
<% end %>
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
<% if can_detach? %>
|
13
|
+
<%= a_link detach_path, color: 'indigo', method: :delete, data: { confirm: "Are you sure you want to detach this #{@resource.singular_name}." } do %>
|
14
|
+
<%= svg 'trash' %> <%= t('avo.detach_item', item: @resource.singular_name).capitalize %>
|
15
|
+
<% end %>
|
14
16
|
<% end %>
|
15
|
-
<% end %>
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
<% if can_attach? %>
|
19
|
+
<%= a_link attach_path, color: 'indigo', 'data-turbo-frame': 'attach_modal' do %>
|
20
|
+
<%= svg 'view-grid-add' %> <%= t('avo.attach_item', item: @resource.singular_name).capitalize %>
|
21
|
+
<% end %>
|
20
22
|
<% end %>
|
21
23
|
<% end %>
|
22
|
-
<% end %>
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
|
38
|
-
<% if view_type.to_sym == :table %>
|
39
|
-
<div class="w-full overflow-auto flex flex-col mt-4">
|
40
|
-
<div class="relative flex-1 flex">
|
41
|
-
<%= render(Avo::Index::ResourceTableComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model)) %>
|
25
|
+
<% c.body do %>
|
26
|
+
<div class="flex justify-between pt-2 pb-2 min-h-16"
|
27
|
+
data-selected-resources-name="<%= @resource.plural_name.downcase %>"
|
28
|
+
data-selected-resources="[]"
|
29
|
+
>
|
30
|
+
<div class="flex items-center px-6 w-64">
|
31
|
+
<%= render partial: 'avo/partials/resource_search', locals: {resource: @resource.route_key} if @resource.search_query.present? %>
|
32
|
+
</div>
|
33
|
+
<div class="flex justify-end items-center px-6 space-x-3">
|
34
|
+
<%= render partial: 'avo/partials/view_toggle_button', locals: { available_view_types: available_view_types, view_type: view_type, turbo_frame: @turbo_frame } if @models.present? %>
|
35
|
+
<%= render 'filters' if @filters.present? %>
|
42
36
|
</div>
|
37
|
+
</div>
|
43
38
|
|
44
|
-
|
45
|
-
|
46
|
-
|
39
|
+
<% if view_type.to_sym == :table %>
|
40
|
+
<div class="w-full overflow-auto flex flex-col mt-4">
|
41
|
+
<div class="relative flex-1 flex">
|
42
|
+
<%= render(Avo::Index::ResourceTableComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model)) %>
|
47
43
|
</div>
|
48
|
-
|
49
|
-
|
44
|
+
|
45
|
+
<% if @models.present? %>
|
46
|
+
<div class="py-4">
|
47
|
+
<%= render partial: 'avo/partials/paginator', locals: { pagy: @pagy, turbo_frame: @turbo_frame || 'none' } %>
|
48
|
+
</div>
|
49
|
+
<% end %>
|
50
|
+
</div>
|
51
|
+
<% end %>
|
50
52
|
<% end %>
|
51
|
-
<% end %>
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
<% c.bare_content do %>
|
55
|
+
<% if view_type.to_sym == :grid %>
|
56
|
+
<%= render Avo::Index::ResourceGridComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model) %>
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
<div class="bg-white rounded-xl shadow-xl mt-8 py-6">
|
59
|
+
<%= render partial: 'avo/partials/paginator', locals: { pagy: @pagy, turbo_frame: @turbo_frame || 'none' } %>
|
60
|
+
</div>
|
61
|
+
<% end %>
|
60
62
|
<% end %>
|
61
63
|
<% end %>
|
62
|
-
|
64
|
+
</div>
|