avo 2.5.2.pre.3 → 2.5.2.pre.6
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.lock +1 -3
- data/app/assets/builds/avo.css +133 -8
- data/app/components/avo/button_component.rb +45 -8
- data/app/components/avo/index/field_wrapper_component.html.erb +1 -1
- data/app/components/avo/index/table_row_component.html.erb +1 -1
- data/app/components/avo/sidebar/group_component.html.erb +4 -2
- data/app/components/avo/sidebar/heading_component.html.erb +1 -1
- data/app/components/avo/sidebar/link_component.html.erb +1 -1
- data/app/components/avo/sidebar/link_component.rb +1 -1
- data/app/components/avo/sidebar_component.html.erb +1 -1
- data/app/components/avo/views/resource_index_component.html.erb +2 -2
- data/app/components/avo/views/resource_show_component.html.erb +1 -1
- data/app/controllers/avo/associations_controller.rb +2 -2
- data/app/controllers/avo/private_controller.rb +1 -0
- data/app/controllers/avo/search_controller.rb +2 -2
- data/app/views/avo/partials/_navbar.html.erb +1 -4
- data/app/views/avo/partials/_table_header.html.erb +3 -2
- data/app/views/avo/private/_links_and_buttons.html.erb +1 -1
- data/app/views/layouts/avo/application.html.erb +4 -1
- data/lib/avo/fields/belongs_to_field.rb +4 -4
- data/lib/avo/fields/has_base_field.rb +2 -0
- data/lib/avo/version.rb +1 -1
- data/public/avo-assets/avo.css +57 -22
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 980b088fbe620e1ad2f98a0efac9f17c16200cb75d635d47fc3a9df1671c28d7
|
4
|
+
data.tar.gz: e0e3264226d0bbf1178cf6d481995fac1b657d9cccf04ce1e8f873ae42214e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 454a2ce7f86a0ed90f0f0031efa1d81eadd3f059a7dba0cc73f0e627e13d2d43f6039264dfdebb4ae0fba17e0b5b8598371dfa3a2fc94e9b4920b9c5bae14f5d
|
7
|
+
data.tar.gz: b126d79deff83b72d71cf9674cfe8f0e38f1eb4a48a731c7645f5ccc7414d3e1bb252a6e19ddd5d987e2d98bcc4479c07fd14f53607c1f8771dc1d68cb497721
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (2.5.2.pre.
|
4
|
+
avo (2.5.2.pre.6)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
breadcrumbs_on_rails
|
@@ -248,8 +248,6 @@ GEM
|
|
248
248
|
nokogiri (1.13.4)
|
249
249
|
mini_portile2 (~> 2.8.0)
|
250
250
|
racc (~> 1.4)
|
251
|
-
nokogiri (1.13.4-x86_64-linux)
|
252
|
-
racc (~> 1.4)
|
253
251
|
orm_adapter (0.5.0)
|
254
252
|
pagy (5.10.1)
|
255
253
|
activesupport
|
data/app/assets/builds/avo.css
CHANGED
@@ -6343,6 +6343,21 @@ progress[value]::-moz-progress-bar{
|
|
6343
6343
|
margin-bottom:2px
|
6344
6344
|
}
|
6345
6345
|
|
6346
|
+
.mx-2{
|
6347
|
+
margin-left:0.5rem;
|
6348
|
+
margin-right:0.5rem
|
6349
|
+
}
|
6350
|
+
|
6351
|
+
.my-2{
|
6352
|
+
margin-top:0.5rem;
|
6353
|
+
margin-bottom:0.5rem
|
6354
|
+
}
|
6355
|
+
|
6356
|
+
.my-1\.5{
|
6357
|
+
margin-top:0.375rem;
|
6358
|
+
margin-bottom:0.375rem
|
6359
|
+
}
|
6360
|
+
|
6346
6361
|
.mt-2{
|
6347
6362
|
margin-top:0.5rem
|
6348
6363
|
}
|
@@ -6475,6 +6490,22 @@ progress[value]::-moz-progress-bar{
|
|
6475
6490
|
margin-bottom:0.25rem
|
6476
6491
|
}
|
6477
6492
|
|
6493
|
+
.mr-0\.5{
|
6494
|
+
margin-right:0.125rem
|
6495
|
+
}
|
6496
|
+
|
6497
|
+
.mr-0{
|
6498
|
+
margin-right:0px
|
6499
|
+
}
|
6500
|
+
|
6501
|
+
.ml-2{
|
6502
|
+
margin-left:0.5rem
|
6503
|
+
}
|
6504
|
+
|
6505
|
+
.mr-8{
|
6506
|
+
margin-right:2rem
|
6507
|
+
}
|
6508
|
+
|
6478
6509
|
.block{
|
6479
6510
|
display:block
|
6480
6511
|
}
|
@@ -6719,6 +6750,10 @@ progress[value]::-moz-progress-bar{
|
|
6719
6750
|
flex-grow:0
|
6720
6751
|
}
|
6721
6752
|
|
6753
|
+
.basis-1\/3{
|
6754
|
+
flex-basis:33.333333%
|
6755
|
+
}
|
6756
|
+
|
6722
6757
|
.-translate-x-1\/2{
|
6723
6758
|
--tw-translate-x:-50%;
|
6724
6759
|
transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
|
@@ -6739,6 +6774,11 @@ progress[value]::-moz-progress-bar{
|
|
6739
6774
|
transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
|
6740
6775
|
}
|
6741
6776
|
|
6777
|
+
.rotate-180{
|
6778
|
+
--tw-rotate:180deg;
|
6779
|
+
transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
|
6780
|
+
}
|
6781
|
+
|
6742
6782
|
.transform{
|
6743
6783
|
transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
|
6744
6784
|
}
|
@@ -6912,6 +6952,18 @@ progress[value]::-moz-progress-bar{
|
|
6912
6952
|
margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))
|
6913
6953
|
}
|
6914
6954
|
|
6955
|
+
.space-y-10 > :not([hidden]) ~ :not([hidden]){
|
6956
|
+
--tw-space-y-reverse:0;
|
6957
|
+
margin-top:calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));
|
6958
|
+
margin-bottom:calc(2.5rem * var(--tw-space-y-reverse))
|
6959
|
+
}
|
6960
|
+
|
6961
|
+
.space-y-16 > :not([hidden]) ~ :not([hidden]){
|
6962
|
+
--tw-space-y-reverse:0;
|
6963
|
+
margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));
|
6964
|
+
margin-bottom:calc(4rem * var(--tw-space-y-reverse))
|
6965
|
+
}
|
6966
|
+
|
6915
6967
|
.divide-y > :not([hidden]) ~ :not([hidden]){
|
6916
6968
|
--tw-divide-y-reverse:0;
|
6917
6969
|
border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
@@ -7213,6 +7265,10 @@ progress[value]::-moz-progress-bar{
|
|
7213
7265
|
border-color:rgb(94 100 110 / var(--tw-border-opacity))
|
7214
7266
|
}
|
7215
7267
|
|
7268
|
+
.border-transparent{
|
7269
|
+
border-color:transparent
|
7270
|
+
}
|
7271
|
+
|
7216
7272
|
.bg-red-600{
|
7217
7273
|
--tw-bg-opacity:1;
|
7218
7274
|
background-color:rgb(220 38 38 / var(--tw-bg-opacity))
|
@@ -7449,6 +7505,21 @@ progress[value]::-moz-progress-bar{
|
|
7449
7505
|
padding-bottom:2rem
|
7450
7506
|
}
|
7451
7507
|
|
7508
|
+
.px-8{
|
7509
|
+
padding-left:2rem;
|
7510
|
+
padding-right:2rem
|
7511
|
+
}
|
7512
|
+
|
7513
|
+
.py-1\.5{
|
7514
|
+
padding-top:0.375rem;
|
7515
|
+
padding-bottom:0.375rem
|
7516
|
+
}
|
7517
|
+
|
7518
|
+
.px-5{
|
7519
|
+
padding-left:1.25rem;
|
7520
|
+
padding-right:1.25rem
|
7521
|
+
}
|
7522
|
+
|
7452
7523
|
.pl-4{
|
7453
7524
|
padding-left:1rem
|
7454
7525
|
}
|
@@ -7497,6 +7568,30 @@ progress[value]::-moz-progress-bar{
|
|
7497
7568
|
padding-top:0.5rem
|
7498
7569
|
}
|
7499
7570
|
|
7571
|
+
.pl-8{
|
7572
|
+
padding-left:2rem
|
7573
|
+
}
|
7574
|
+
|
7575
|
+
.pr-6{
|
7576
|
+
padding-right:1.5rem
|
7577
|
+
}
|
7578
|
+
|
7579
|
+
.pr-4{
|
7580
|
+
padding-right:1rem
|
7581
|
+
}
|
7582
|
+
|
7583
|
+
.pr-2{
|
7584
|
+
padding-right:0.5rem
|
7585
|
+
}
|
7586
|
+
|
7587
|
+
.pl-2{
|
7588
|
+
padding-left:0.5rem
|
7589
|
+
}
|
7590
|
+
|
7591
|
+
.pr-0{
|
7592
|
+
padding-right:0px
|
7593
|
+
}
|
7594
|
+
|
7500
7595
|
.text-left{
|
7501
7596
|
text-align:left
|
7502
7597
|
}
|
@@ -7553,14 +7648,6 @@ progress[value]::-moz-progress-bar{
|
|
7553
7648
|
line-height:1rem
|
7554
7649
|
}
|
7555
7650
|
|
7556
|
-
.text-\[15px\]{
|
7557
|
-
font-size:15px
|
7558
|
-
}
|
7559
|
-
|
7560
|
-
.text-\[14px\]{
|
7561
|
-
font-size:14px
|
7562
|
-
}
|
7563
|
-
|
7564
7651
|
.font-semibold{
|
7565
7652
|
font-weight:600
|
7566
7653
|
}
|
@@ -8145,6 +8232,11 @@ trix-editor {
|
|
8145
8232
|
background-color:rgb(230 243 252 / var(--tw-bg-opacity))
|
8146
8233
|
}
|
8147
8234
|
|
8235
|
+
.hover\:bg-gray-50:hover{
|
8236
|
+
--tw-bg-opacity:1;
|
8237
|
+
background-color:rgb(241 242 243 / var(--tw-bg-opacity))
|
8238
|
+
}
|
8239
|
+
|
8148
8240
|
.hover\:text-gray-500:hover{
|
8149
8241
|
--tw-text-opacity:1;
|
8150
8242
|
color:rgb(117 125 138 / var(--tw-text-opacity))
|
@@ -8693,6 +8785,10 @@ trix-editor {
|
|
8693
8785
|
grid-column:span 6 / span 6
|
8694
8786
|
}
|
8695
8787
|
|
8788
|
+
.sm\:block{
|
8789
|
+
display:block
|
8790
|
+
}
|
8791
|
+
|
8696
8792
|
.sm\:flex{
|
8697
8793
|
display:flex
|
8698
8794
|
}
|
@@ -8799,6 +8895,10 @@ trix-editor {
|
|
8799
8895
|
width:66.666667%
|
8800
8896
|
}
|
8801
8897
|
|
8898
|
+
.md\:basis-1\/3{
|
8899
|
+
flex-basis:33.333333%
|
8900
|
+
}
|
8901
|
+
|
8802
8902
|
.md\:grid-cols-3{
|
8803
8903
|
grid-template-columns:repeat(3, minmax(0, 1fr))
|
8804
8904
|
}
|
@@ -8831,6 +8931,10 @@ trix-editor {
|
|
8831
8931
|
}
|
8832
8932
|
|
8833
8933
|
@media (min-width: 1024px){
|
8934
|
+
.lg\:block{
|
8935
|
+
display:block
|
8936
|
+
}
|
8937
|
+
|
8834
8938
|
.lg\:flex{
|
8835
8939
|
display:flex
|
8836
8940
|
}
|
@@ -8865,6 +8969,14 @@ trix-editor {
|
|
8865
8969
|
background-color:transparent
|
8866
8970
|
}
|
8867
8971
|
|
8972
|
+
.lg\:p-4{
|
8973
|
+
padding:1rem
|
8974
|
+
}
|
8975
|
+
|
8976
|
+
.lg\:p-6{
|
8977
|
+
padding:1.5rem
|
8978
|
+
}
|
8979
|
+
|
8868
8980
|
.lg\:px-8{
|
8869
8981
|
padding-left:2rem;
|
8870
8982
|
padding-right:2rem
|
@@ -8880,9 +8992,22 @@ trix-editor {
|
|
8880
8992
|
padding-bottom:2rem
|
8881
8993
|
}
|
8882
8994
|
|
8995
|
+
.lg\:px-2{
|
8996
|
+
padding-left:0.5rem;
|
8997
|
+
padding-right:0.5rem
|
8998
|
+
}
|
8999
|
+
|
8883
9000
|
.lg\:pl-64{
|
8884
9001
|
padding-left:16rem
|
8885
9002
|
}
|
9003
|
+
|
9004
|
+
.lg\:pl-2{
|
9005
|
+
padding-left:0.5rem
|
9006
|
+
}
|
9007
|
+
|
9008
|
+
.lg\:pl-4{
|
9009
|
+
padding-left:1rem
|
9010
|
+
}
|
8886
9011
|
}
|
8887
9012
|
|
8888
9013
|
@media (min-width: 1280px){
|
@@ -38,14 +38,15 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def button_classes
|
41
|
-
classes = "button-component inline-flex flex-grow-0 items-center
|
41
|
+
classes = "button-component inline-flex flex-grow-0 items-center font-semibold leading-6 fill-current whitespace-nowrap transition duration-100 transform transition duration-100 cursor-pointer disabled:cursor-not-allowed disabled:opacity-70 border justify-center active:outline active:outline-1 #{@class}"
|
42
42
|
|
43
43
|
classes += " rounded" if @rounded.present?
|
44
44
|
|
45
45
|
classes += style_classes
|
46
46
|
|
47
|
-
classes +=
|
47
|
+
classes += padding_classes
|
48
48
|
classes += spacing_classes
|
49
|
+
classes += text_size_classes
|
49
50
|
|
50
51
|
classes
|
51
52
|
end
|
@@ -57,10 +58,14 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
57
58
|
def full_content
|
58
59
|
result = ""
|
59
60
|
icon_classes = @icon_class
|
60
|
-
|
61
|
+
# space out the icon from the text if text is present
|
62
|
+
icon_classes += " mr-1" if content.present?
|
63
|
+
# add the icon height
|
64
|
+
icon_classes += icon_size_classes
|
61
65
|
|
66
|
+
# Add the icon
|
62
67
|
result += helpers.svg(@icon, class: icon_classes) if @icon.present?
|
63
|
-
|
68
|
+
|
64
69
|
if content.present?
|
65
70
|
result += "<span>#{content}</span>"
|
66
71
|
end
|
@@ -103,14 +108,44 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
103
108
|
when :sm
|
104
109
|
" py-1"
|
105
110
|
when :md
|
106
|
-
" py-
|
111
|
+
" py-1.5"
|
107
112
|
when :lg
|
113
|
+
" py-2"
|
114
|
+
when :xl
|
108
115
|
" py-3"
|
109
116
|
else
|
110
117
|
""
|
111
118
|
end
|
112
119
|
end
|
113
120
|
|
121
|
+
def padding_classes
|
122
|
+
return " px-1" if @compact
|
123
|
+
|
124
|
+
case @size.to_sym
|
125
|
+
when :xs
|
126
|
+
" px-2"
|
127
|
+
when :sm
|
128
|
+
" px-3"
|
129
|
+
when :md
|
130
|
+
" px-3"
|
131
|
+
when :lg
|
132
|
+
" px-5"
|
133
|
+
when :xl
|
134
|
+
" px-6"
|
135
|
+
else
|
136
|
+
"px-4"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
def text_size_classes
|
141
|
+
case @size.to_sym
|
142
|
+
when :xs
|
143
|
+
" text-xs"
|
144
|
+
else
|
145
|
+
" text-sm"
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
114
149
|
def style_classes
|
115
150
|
case @style
|
116
151
|
when :primary
|
@@ -118,13 +153,13 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
118
153
|
when :outline
|
119
154
|
" bg-white text-#{@color}-500 border-#{@color}-500 hover:bg-#{@color}-100 active:bg-#{@color}-100 active:border-#{@color}-500 active:outline-#{@color}-500"
|
120
155
|
when :text
|
121
|
-
" text-#{@color}-500 active:outline-#{@color}-500
|
156
|
+
" text-#{@color}-500 active:outline-#{@color}-500 hover:bg-gray-100 border-transparent"
|
122
157
|
else
|
123
158
|
""
|
124
159
|
end
|
125
160
|
end
|
126
161
|
|
127
|
-
def
|
162
|
+
def icon_size_classes
|
128
163
|
icon_classes = ""
|
129
164
|
|
130
165
|
case @size
|
@@ -137,10 +172,12 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
137
172
|
# When icon is solo we need to add an offset
|
138
173
|
icon_classes += " my-1" if content.blank?
|
139
174
|
when :md
|
140
|
-
icon_classes += " h-5"
|
175
|
+
icon_classes += " h-4 my-1.5"
|
141
176
|
# When icon is solo we need to add an offset
|
142
177
|
icon_classes += " my-0.5" if content.blank?
|
143
178
|
when :lg
|
179
|
+
icon_classes += " h-5 my-2"
|
180
|
+
when :xl
|
144
181
|
icon_classes += " h-6"
|
145
182
|
end
|
146
183
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<td class="min-h-[3rem] px-3 leading-tight whitespace-nowrap h-full text-slate-800 text-
|
1
|
+
<td class="min-h-[3rem] px-3 leading-tight whitespace-nowrap h-full text-slate-800 text-base <%= classes %>" data-field-id="<%= @field.id %>" data-field-type="<%= @field.type %>">
|
2
2
|
<% if @field.value.blank? && @dash_if_blank %>
|
3
3
|
—
|
4
4
|
<% else %>
|
@@ -7,7 +7,9 @@
|
|
7
7
|
<% end %>
|
8
8
|
>
|
9
9
|
<% if item.name.present? %>
|
10
|
-
<div
|
10
|
+
<div
|
11
|
+
class="flex justify-between px-10 pr-2 pt-2 pb-0 text-gray-400"
|
12
|
+
>
|
11
13
|
<div class="flex items-center text-xs uppercase font-semibold leading-none">
|
12
14
|
<%= item.name %>
|
13
15
|
</div>
|
@@ -17,7 +19,7 @@
|
|
17
19
|
data-menu-target="svg"
|
18
20
|
data-menu-key-param="<%= key %>"
|
19
21
|
>
|
20
|
-
<%= helpers.svg 'heroicons/outline/chevron-down', class: "h-4"%>
|
22
|
+
<%= helpers.svg 'heroicons/outline/chevron-down', class: "h-4 mr-0.5"%>
|
21
23
|
</div>
|
22
24
|
<% end %>
|
23
25
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="flex justify-between px-
|
1
|
+
<div class="flex justify-between px-4 pr-2 py-1 text-gray-500">
|
2
2
|
<div class="flex items-center text-sm uppercase font-semibold leading-none space-x-1">
|
3
3
|
<span class="min-w-[20px]"><%= icon %></span> <span><%= label %></span>
|
4
4
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= send link_method, path, class: classes, active: active, target: target do %>
|
3
3
|
<%= label %>
|
4
4
|
<% if target == :_blank %>
|
5
|
-
<%= helpers.svg('heroicons/outline/external-link', class: 'self-center ml-auto h-3') %>
|
5
|
+
<%= helpers.svg('heroicons/outline/external-link', class: 'self-center ml-auto h-3 mr-2') %>
|
6
6
|
<% end %>
|
7
7
|
<% end %>
|
8
8
|
<% else %>
|
@@ -23,6 +23,6 @@ class Avo::Sidebar::LinkComponent < ViewComponent::Base
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def classes
|
26
|
-
"px-4 flex-1 flex mx-6 leading-none py-2 text-black rounded font-medium hover:bg-gray-100"
|
26
|
+
"px-4 pr-0 flex-1 flex mx-6 leading-none py-2 text-black rounded font-medium hover:bg-gray-100"
|
27
27
|
end
|
28
28
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div
|
2
|
-
class="fixed z-[60] t-0 application-sidebar hidden lg:flex flex-1 border-r lg:border-none bg-none min-w-[16rem] h-[calc(100vh-4rem)] bg-gray-
|
2
|
+
class="fixed z-[60] t-0 application-sidebar hidden lg:flex flex-1 border-r lg:border-none bg-none min-w-[16rem] h-[calc(100vh-4rem)] bg-gray-25 lg:bg-transparent <%= 'print:hidden' if Avo.configuration.hide_layout_when_printing %>"
|
3
3
|
data-mobile-target="sidebar"
|
4
4
|
>
|
5
5
|
<div class="flex flex-col w-full h-full">
|
@@ -59,14 +59,14 @@
|
|
59
59
|
<% c.bare_content do %>
|
60
60
|
<% if view_type.to_sym == :table %>
|
61
61
|
<% if @models.present? %>
|
62
|
-
<div class="mt-
|
62
|
+
<div class="mt-4">
|
63
63
|
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || 'none', index_params: @index_params, resource: @resource, parent_model: @parent_model %>
|
64
64
|
</div>
|
65
65
|
<% end %>
|
66
66
|
<% end %>
|
67
67
|
<% if view_type.to_sym == :grid %>
|
68
68
|
<%= render Avo::Index::ResourceGridComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model) %>
|
69
|
-
<div class="mt-
|
69
|
+
<div class="mt-6">
|
70
70
|
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || 'none', index_params: @index_params, resource: @resource, parent_model: @parent_model %>
|
71
71
|
</div>
|
72
72
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div data-model-id="<%= @resource.model.id %>"
|
2
2
|
data-selected-resources-name="<%= @resource.model_key %>"
|
3
3
|
data-selected-resources='["<%= @resource.model.id %>"]'
|
4
|
-
class="space-y-
|
4
|
+
class="space-y-12"
|
5
5
|
>
|
6
6
|
<% @resource.panels.each_with_index do |resource_panel, index| %>
|
7
7
|
<%= render Avo::PanelComponent.new(title: title, description: @resource.resource_description, display_breadcrumbs: @reflection.blank?, index: index) do |c| %>
|
@@ -46,8 +46,8 @@ module Avo
|
|
46
46
|
query = @authorization.apply_policy @attachment_class
|
47
47
|
|
48
48
|
# Add the association scope to the query scope
|
49
|
-
if @field.
|
50
|
-
query = Avo::Hosts::AssociationScopeHost.new(block: @field.
|
49
|
+
if @field.attach_scope.present?
|
50
|
+
query = Avo::Hosts::AssociationScopeHost.new(block: @field.attach_scope, query: query, parent: @model).handle
|
51
51
|
end
|
52
52
|
|
53
53
|
@options = query.all.map do |model|
|
@@ -51,12 +51,12 @@ module Avo
|
|
51
51
|
# Fetch the field
|
52
52
|
field = belongs_to_field
|
53
53
|
|
54
|
-
if field.
|
54
|
+
if field.attach_scope.present?
|
55
55
|
# Fetch the parent
|
56
56
|
parent = params[:via_reflection_class].safe_constantize.find params[:via_reflection_id]
|
57
57
|
|
58
58
|
# Add to the query
|
59
|
-
query = Avo::Hosts::AssociationScopeHost.new(block: belongs_to_field.
|
59
|
+
query = Avo::Hosts::AssociationScopeHost.new(block: belongs_to_field.attach_scope, query: query, parent: parent).handle
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -4,12 +4,9 @@
|
|
4
4
|
>
|
5
5
|
<div class="flex items-center space-x-2 lg:space-x-0 w-64">
|
6
6
|
<%= a_button class: 'lg:hidden', icon: 'menu', size: :xs, compact: true, style: :text, data: { action: 'click->mobile#toggleSidebar' } %>
|
7
|
-
|
8
7
|
<%= render partial: "avo/partials/logo" %>
|
9
8
|
</div>
|
10
|
-
|
11
|
-
|
12
|
-
<div class="flex-1 flex items-center justify-between lg:justify-start space-x-8 pl-4">
|
9
|
+
<div class="flex-1 flex items-center justify-between lg:justify-start space-x-8 lg:pl-4">
|
13
10
|
<div class="flex">
|
14
11
|
<%= render partial: "avo/partials/global_search" if ::Avo::App.license.has_with_trial(:global_search) && ::Avo.configuration.feature_enabled?(:global_search) %>
|
15
12
|
</div>
|
@@ -29,8 +29,9 @@
|
|
29
29
|
sort_by = field.id
|
30
30
|
sort_direction = 'desc'
|
31
31
|
end
|
32
|
-
classes = "text-gray-500 tracking-tight leading-tight text-
|
33
|
-
|
32
|
+
classes = "text-gray-500 tracking-tight leading-tight text-xs font-semibold"
|
33
|
+
%>
|
34
|
+
<th class="text-left uppercase px-3 py-2 whitespace-nowrap rounded-l">
|
34
35
|
<% if field.sortable %>
|
35
36
|
<%= link_to params.permit!.merge(sort_by: sort_by, sort_direction: sort_direction), class: "flex items-center #{classes} #{'cursor-pointer' if field.sortable}", 'data-turbo-frame': params[:turbo_frame] do %>
|
36
37
|
<%= field.name %>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<div class="flex-1 flex pt-16 relative">
|
26
26
|
<%= render Avo::SidebarComponent.new %>
|
27
27
|
<div class="lg:pl-64 flex-1 flex flex-col min-h-full max-w-full">
|
28
|
-
<div class="content
|
28
|
+
<div class="content p-4 lg:p-6 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
|
29
29
|
<%= render partial: "avo/partials/custom_tools_alert" if @custom_tools_alert_visible %>
|
30
30
|
<div class="flex flex-1 flex-col justify-between items-stretch space-y-8">
|
31
31
|
<%= yield %>
|
@@ -50,5 +50,8 @@
|
|
50
50
|
<% end %>
|
51
51
|
<%= render partial: "avo/partials/scripts" %>
|
52
52
|
<!-- Avo version: <%= Avo::VERSION %> -->
|
53
|
+
<!-- Environment: <%= Rails.env %> -->
|
54
|
+
<!-- License ID: <%= Avo::App.license.id %> -->
|
55
|
+
<!-- License valid?: <%= Avo::App.license.valid ? "valid" : "invalid" %> -->
|
53
56
|
</body>
|
54
57
|
</html>
|
@@ -62,7 +62,7 @@ module Avo
|
|
62
62
|
attr_reader :relation_method
|
63
63
|
attr_reader :types # for Polymorphic associations
|
64
64
|
attr_reader :allow_via_detaching
|
65
|
-
attr_reader :
|
65
|
+
attr_reader :attach_scope
|
66
66
|
attr_reader :polymorphic_help
|
67
67
|
|
68
68
|
def initialize(id, **args, &block)
|
@@ -75,7 +75,7 @@ module Avo
|
|
75
75
|
@types = args[:types]
|
76
76
|
@relation_method = id.to_s.parameterize.underscore
|
77
77
|
@allow_via_detaching = args[:allow_via_detaching] == true
|
78
|
-
@
|
78
|
+
@attach_scope = args[:attach_scope]
|
79
79
|
@polymorphic_help = args[:polymorphic_help]
|
80
80
|
end
|
81
81
|
|
@@ -117,8 +117,8 @@ module Avo
|
|
117
117
|
|
118
118
|
query = Avo::Services::AuthorizationService.apply_policy(user, resource.class.query_scope)
|
119
119
|
|
120
|
-
if
|
121
|
-
query = Avo::Hosts::AssociationScopeHost.new(block:
|
120
|
+
if attach_scope.present?
|
121
|
+
query = Avo::Hosts::AssociationScopeHost.new(block: attach_scope, query: query, parent: get_model).handle
|
122
122
|
end
|
123
123
|
|
124
124
|
query.all.map do |model|
|
@@ -3,12 +3,14 @@ module Avo
|
|
3
3
|
class HasBaseField < BaseField
|
4
4
|
attr_accessor :display
|
5
5
|
attr_accessor :scope
|
6
|
+
attr_accessor :attach_scope
|
6
7
|
attr_accessor :description
|
7
8
|
|
8
9
|
def initialize(id, **args, &block)
|
9
10
|
super(id, **args, &block)
|
10
11
|
|
11
12
|
@scope = args[:scope].present? ? args[:scope] : nil
|
13
|
+
@attach_scope = args[:attach_scope].present? ? args[:attach_scope] : nil
|
12
14
|
@display = args[:display].present? ? args[:display] : :show
|
13
15
|
@searchable = args[:searchable] == true
|
14
16
|
@description = args[:description]
|
data/lib/avo/version.rb
CHANGED
data/public/avo-assets/avo.css
CHANGED
@@ -6323,6 +6323,11 @@ progress[value]::-moz-progress-bar{
|
|
6323
6323
|
margin-bottom:0.25rem
|
6324
6324
|
}
|
6325
6325
|
|
6326
|
+
.my-1\.5{
|
6327
|
+
margin-top:0.375rem;
|
6328
|
+
margin-bottom:0.375rem
|
6329
|
+
}
|
6330
|
+
|
6326
6331
|
.my-0\.5{
|
6327
6332
|
margin-top:0.125rem;
|
6328
6333
|
margin-bottom:0.125rem
|
@@ -6333,6 +6338,11 @@ progress[value]::-moz-progress-bar{
|
|
6333
6338
|
margin-bottom:0px
|
6334
6339
|
}
|
6335
6340
|
|
6341
|
+
.my-2{
|
6342
|
+
margin-top:0.5rem;
|
6343
|
+
margin-bottom:0.5rem
|
6344
|
+
}
|
6345
|
+
|
6336
6346
|
.mx-6{
|
6337
6347
|
margin-left:1.5rem;
|
6338
6348
|
margin-right:1.5rem
|
@@ -6443,6 +6453,14 @@ progress[value]::-moz-progress-bar{
|
|
6443
6453
|
margin-left:50%
|
6444
6454
|
}
|
6445
6455
|
|
6456
|
+
.mr-0\.5{
|
6457
|
+
margin-right:0.125rem
|
6458
|
+
}
|
6459
|
+
|
6460
|
+
.mr-0{
|
6461
|
+
margin-right:0px
|
6462
|
+
}
|
6463
|
+
|
6446
6464
|
.ml-auto{
|
6447
6465
|
margin-left:auto
|
6448
6466
|
}
|
@@ -6455,10 +6473,6 @@ progress[value]::-moz-progress-bar{
|
|
6455
6473
|
margin-top:0px
|
6456
6474
|
}
|
6457
6475
|
|
6458
|
-
.mt-14{
|
6459
|
-
margin-top:3.5rem
|
6460
|
-
}
|
6461
|
-
|
6462
6476
|
.mr-px{
|
6463
6477
|
margin-right:1px
|
6464
6478
|
}
|
@@ -7203,6 +7217,10 @@ progress[value]::-moz-progress-bar{
|
|
7203
7217
|
border-color:rgb(6 107 178 / var(--tw-border-opacity))
|
7204
7218
|
}
|
7205
7219
|
|
7220
|
+
.border-transparent{
|
7221
|
+
border-color:transparent
|
7222
|
+
}
|
7223
|
+
|
7206
7224
|
.border-slate-300{
|
7207
7225
|
--tw-border-opacity:1;
|
7208
7226
|
border-color:rgb(203 213 225 / var(--tw-border-opacity))
|
@@ -7278,14 +7296,14 @@ progress[value]::-moz-progress-bar{
|
|
7278
7296
|
background-color:rgb(47 50 55 / var(--tw-bg-opacity))
|
7279
7297
|
}
|
7280
7298
|
|
7281
|
-
.bg-
|
7299
|
+
.bg-application{
|
7282
7300
|
--tw-bg-opacity:1;
|
7283
|
-
background-color:rgb(
|
7301
|
+
background-color:rgb(229 235 240 / var(--tw-bg-opacity))
|
7284
7302
|
}
|
7285
7303
|
|
7286
|
-
.bg-
|
7304
|
+
.bg-gray-50{
|
7287
7305
|
--tw-bg-opacity:1;
|
7288
|
-
background-color:rgb(
|
7306
|
+
background-color:rgb(241 242 243 / var(--tw-bg-opacity))
|
7289
7307
|
}
|
7290
7308
|
|
7291
7309
|
.bg-blue-500{
|
@@ -7434,6 +7452,16 @@ progress[value]::-moz-progress-bar{
|
|
7434
7452
|
padding-bottom:1rem
|
7435
7453
|
}
|
7436
7454
|
|
7455
|
+
.py-1\.5{
|
7456
|
+
padding-top:0.375rem;
|
7457
|
+
padding-bottom:0.375rem
|
7458
|
+
}
|
7459
|
+
|
7460
|
+
.px-5{
|
7461
|
+
padding-left:1.25rem;
|
7462
|
+
padding-right:1.25rem
|
7463
|
+
}
|
7464
|
+
|
7437
7465
|
.py-24{
|
7438
7466
|
padding-top:6rem;
|
7439
7467
|
padding-bottom:6rem
|
@@ -7449,10 +7477,6 @@ progress[value]::-moz-progress-bar{
|
|
7449
7477
|
padding-bottom:2rem
|
7450
7478
|
}
|
7451
7479
|
|
7452
|
-
.pl-4{
|
7453
|
-
padding-left:1rem
|
7454
|
-
}
|
7455
|
-
|
7456
7480
|
.pb-1{
|
7457
7481
|
padding-bottom:0.25rem
|
7458
7482
|
}
|
@@ -7493,10 +7517,18 @@ progress[value]::-moz-progress-bar{
|
|
7493
7517
|
padding-bottom:75%
|
7494
7518
|
}
|
7495
7519
|
|
7520
|
+
.pr-2{
|
7521
|
+
padding-right:0.5rem
|
7522
|
+
}
|
7523
|
+
|
7496
7524
|
.pt-2{
|
7497
7525
|
padding-top:0.5rem
|
7498
7526
|
}
|
7499
7527
|
|
7528
|
+
.pr-0{
|
7529
|
+
padding-right:0px
|
7530
|
+
}
|
7531
|
+
|
7500
7532
|
.text-left{
|
7501
7533
|
text-align:left
|
7502
7534
|
}
|
@@ -7543,16 +7575,16 @@ progress[value]::-moz-progress-bar{
|
|
7543
7575
|
line-height:1.75rem
|
7544
7576
|
}
|
7545
7577
|
|
7546
|
-
.text-2xl{
|
7547
|
-
font-size:1.5rem;
|
7548
|
-
line-height:2rem
|
7549
|
-
}
|
7550
|
-
|
7551
7578
|
.text-xs{
|
7552
7579
|
font-size:0.75rem;
|
7553
7580
|
line-height:1rem
|
7554
7581
|
}
|
7555
7582
|
|
7583
|
+
.text-2xl{
|
7584
|
+
font-size:1.5rem;
|
7585
|
+
line-height:2rem
|
7586
|
+
}
|
7587
|
+
|
7556
7588
|
.font-semibold{
|
7557
7589
|
font-weight:600
|
7558
7590
|
}
|
@@ -8132,9 +8164,9 @@ trix-editor {
|
|
8132
8164
|
background-color:rgb(6 107 178 / var(--tw-bg-opacity))
|
8133
8165
|
}
|
8134
8166
|
|
8135
|
-
.hover\:bg-
|
8167
|
+
.hover\:bg-gray-50:hover{
|
8136
8168
|
--tw-bg-opacity:1;
|
8137
|
-
background-color:rgb(
|
8169
|
+
background-color:rgb(241 242 243 / var(--tw-bg-opacity))
|
8138
8170
|
}
|
8139
8171
|
|
8140
8172
|
.hover\:text-gray-500:hover{
|
@@ -8857,6 +8889,10 @@ trix-editor {
|
|
8857
8889
|
background-color:transparent
|
8858
8890
|
}
|
8859
8891
|
|
8892
|
+
.lg\:p-6{
|
8893
|
+
padding:1.5rem
|
8894
|
+
}
|
8895
|
+
|
8860
8896
|
.lg\:px-8{
|
8861
8897
|
padding-left:2rem;
|
8862
8898
|
padding-right:2rem
|
@@ -8867,9 +8903,8 @@ trix-editor {
|
|
8867
8903
|
padding-right:1rem
|
8868
8904
|
}
|
8869
8905
|
|
8870
|
-
.lg\:
|
8871
|
-
padding-
|
8872
|
-
padding-bottom:2rem
|
8906
|
+
.lg\:pl-4{
|
8907
|
+
padding-left:1rem
|
8873
8908
|
}
|
8874
8909
|
|
8875
8910
|
.lg\:pl-64{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.2.pre.
|
4
|
+
version: 2.5.2.pre.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-05-
|
12
|
+
date: 2022-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|