avo 2.12.1.pre.1 → 2.13.2.pre.1
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 -1
- data/README.md +2 -1
- data/app/assets/stylesheets/avo.css +1 -1
- data/app/assets/stylesheets/css/fields/progress.css +3 -3
- data/app/assets/stylesheets/css/pagination.css +0 -4
- data/app/assets/stylesheets/css/search.css +1 -1
- data/app/assets/stylesheets/css/sidebar.css +1 -1
- data/app/assets/stylesheets/css/tags.css +7 -0
- data/app/assets/svgs/failed_to_load.svg +4 -5
- data/app/assets/svgs/grid-empty-state.svg +10 -11
- data/app/assets/svgs/table-empty-state.svg +11 -12
- data/app/components/avo/actions_component.html.erb +5 -5
- data/app/components/avo/actions_component.rb +12 -3
- data/app/components/avo/button_component.rb +3 -5
- data/app/components/avo/fields/boolean_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/common/gravatar_viewer_component.html.erb +1 -1
- data/app/components/avo/fields/date_field/edit_component.html.erb +0 -3
- data/app/components/avo/fields/date_time_field/edit_component.html.erb +0 -2
- data/app/components/avo/fields/has_one_field/show_component.html.erb +1 -1
- data/app/components/avo/fields/progress_bar_field/index_component.html.erb +1 -1
- data/app/components/avo/fields/progress_bar_field/show_component.html.erb +1 -1
- data/app/components/avo/fields/tags_field/edit_component.html.erb +1 -1
- data/app/components/avo/item_switcher_component.html.erb +1 -1
- data/app/components/avo/panel_component.html.erb +1 -1
- data/app/components/avo/panel_component.rb +3 -4
- data/app/components/avo/profile_item_component.html.erb +1 -1
- data/app/components/avo/resource_component.rb +6 -4
- data/app/components/avo/sidebar_component.html.erb +1 -1
- data/app/components/avo/views/resource_edit_component.html.erb +1 -1
- data/app/components/avo/views/resource_index_component.html.erb +1 -1
- data/app/components/avo/views/resource_index_component.rb +1 -1
- data/app/components/avo/views/resource_show_component.html.erb +138 -48
- data/app/components/avo/views/resource_show_component.rb +1 -0
- data/app/helpers/avo/resources_helper.rb +2 -2
- data/app/javascript/avo.js +0 -1
- data/app/javascript/js/controllers/fields/trix_field_controller.js +4 -3
- data/app/javascript/js/controllers/item_selector_controller.js +1 -1
- data/app/views/avo/associations/new.html.erb +2 -2
- data/app/views/avo/base/_multiple_select_filter.html.erb +1 -1
- data/app/views/avo/base/_text_filter.html.erb +1 -1
- data/app/views/avo/dashboards/show.html.erb +1 -1
- data/app/views/avo/debug/index.html.erb +1 -1
- data/app/views/avo/debug/report.html.erb +1 -0
- data/app/views/avo/home/index.html.erb +1 -1
- data/app/views/avo/partials/_branding.html.erb +5 -0
- data/app/views/avo/partials/_header.html.erb +1 -1
- data/app/views/avo/partials/_logo.html.erb +2 -2
- data/app/views/avo/private/_links_and_buttons.html.erb +1 -1
- data/app/views/avo/private/design.html.erb +5 -5
- data/app/views/layouts/avo/application.html.erb +2 -1
- data/lib/avo/base_resource.rb +5 -1
- data/lib/avo/concerns/has_editable_controls.rb +34 -0
- data/lib/avo/configuration/branding.rb +57 -0
- data/lib/avo/configuration.rb +5 -0
- data/lib/avo/fields/date_field.rb +1 -3
- data/lib/avo/fields/field_extensions/has_include_blank.rb +1 -1
- data/lib/avo/fields/key_value_field.rb +6 -6
- data/lib/avo/licensing/h_q.rb +12 -4
- data/lib/avo/licensing/pro_license.rb +2 -0
- data/lib/avo/menu/builder.rb +2 -0
- data/lib/avo/resources/controls/action.rb +32 -0
- data/lib/avo/resources/controls/actions_list.rb +19 -0
- data/lib/avo/resources/controls/back_button.rb +13 -0
- data/lib/avo/resources/controls/base_control.rb +59 -0
- data/lib/avo/resources/controls/delete_button.rb +13 -0
- data/lib/avo/resources/controls/detach_button.rb +13 -0
- data/lib/avo/resources/controls/edit_button.rb +13 -0
- data/lib/avo/resources/controls/execution_context.rb +58 -0
- data/lib/avo/resources/controls/items_holder.rb +19 -0
- data/lib/avo/resources/controls/link_to.rb +27 -0
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/templates/action.tt +1 -1
- data/lib/generators/avo/templates/initializer/avo.tt +14 -0
- data/lib/generators/avo/templates/resource_tools/partial.tt +1 -1
- data/lib/generators/avo/templates/standalone_action.tt +1 -1
- data/public/avo-assets/avo.css +760 -202
- data/public/avo-assets/avo.js +2 -2
- data/public/avo-assets/avo.js.map +2 -2
- metadata +15 -11
- data/app/components/avo/button_component.html.erb +0 -1
- data/app/helpers/avo/actions_helper.rb +0 -4
- data/app/helpers/avo/attachments_helper.rb +0 -4
- data/app/views/kaminari/_first_page.html.erb +0 -3
- data/app/views/kaminari/_last_page.html.erb +0 -3
- data/app/views/kaminari/_next_page.html.erb +0 -9
- data/app/views/kaminari/_page.html.erb +0 -12
- data/app/views/kaminari/_prev_page.html.erb +0 -9
- data/lib/avo/concerns/has_model.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc519d3091408bc2355cb12d6b86671f8b77270e479de775d3290a18c7933a5f
|
4
|
+
data.tar.gz: 244a5fcc3837878903f797177cf791a7981f5d1ccd07b60245a9226fde24b978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13d4188612ef439fd452a4e13fdd5d294e44e4024a3c0c23812cf0580bcd76af03a9a06225ac0ea32f1ee4ff938b1b4ce21481b09716f44c4299151472c81e97
|
7
|
+
data.tar.gz: b66aac0a5d64487839e61e5d30409063a877dd65d9d693fc140b17c5222c4605ef5ebfd51b01d55fd7638d2011fcb04e3fa0dd005ba58b89201a683e692fea48
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
![reviewdog](https://github.com/avo-hq/avo/workflows/reviewdog/badge.svg)
|
4
4
|
[![codecov](https://codecov.io/gh/avo-hq/avo/branch/master/graph/badge.svg?token=Q2LMFE4989)](https://codecov.io/gh/avo-hq/avo)
|
5
5
|
[![Maintainability](https://api.codeclimate.com/v1/badges/676a0afa2cc79f03aa29/maintainability)](https://codeclimate.com/github/avo-hq/avo/maintainability)
|
6
|
+
[![Open Source Helpers](https://www.codetriage.com/avo-hq/avo/badges/users.svg)](https://www.codetriage.com/avo-hq/avo)
|
6
7
|
|
7
8
|
![](./public/avo-assets/logo-on-white.png)
|
8
9
|
|
@@ -73,7 +74,7 @@ Please read the [UPGRADE_GUIDE.MD](https://docs.avohq.io/2.0/upgrade.html)
|
|
73
74
|
|
74
75
|
Please read the [RELEASE.MD](./RELEASE.MD)
|
75
76
|
|
76
|
-
# ✨ Contributors
|
77
|
+
# ✨ [Contributors](https://avohq.io/contributors)
|
77
78
|
|
78
79
|
<a href="https://github.com/avo-hq/avo/graphs/contributors">
|
79
80
|
<img src="https://contrib.rocks/image?repo=avo-hq/avo" />
|
@@ -1,13 +1,13 @@
|
|
1
1
|
progress {
|
2
|
-
@apply h-2 bg-white border border-
|
2
|
+
@apply h-2 bg-white border border-slate-400 rounded shadow-inner;
|
3
3
|
}
|
4
4
|
progress[value]::-webkit-progress-bar {
|
5
5
|
@apply bg-white border border-gray-500 rounded shadow-inner;
|
6
6
|
}
|
7
7
|
progress[value]::-webkit-progress-value{
|
8
|
-
@apply bg-
|
8
|
+
@apply bg-primary-500 rounded;
|
9
9
|
|
10
10
|
}
|
11
11
|
progress[value]::-moz-progress-bar {
|
12
|
-
@apply bg-
|
12
|
+
@apply bg-primary-500 rounded appearance-none;
|
13
13
|
}
|
@@ -1,5 +1,12 @@
|
|
1
1
|
tags.tagify {
|
2
2
|
--tag-inset-shadow-size: 3em;
|
3
|
+
--tags-border-color: rgb(var(--color-primary-500));
|
4
|
+
--tags-hover-border-color: rgb(var(--color-primary-500));
|
5
|
+
--tags-hover-border-color: rgb(var(--color-primary-500));
|
6
|
+
}
|
7
|
+
|
8
|
+
.tagify__dropdown {
|
9
|
+
--tagify-dd-color-primary: rgb(var(--color-primary-500));
|
3
10
|
}
|
4
11
|
|
5
12
|
tags.tagify {
|
@@ -1,13 +1,12 @@
|
|
1
1
|
<svg width="275" height="275" viewBox="0 0 275 275" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M137.714 274.227C213.377 274.227 274.714 212.89 274.714 137.227C274.714 61.5636 213.377 0.226593 137.714 0.226593C62.0512 0.226593 0.714233 61.5636 0.714233 137.227C0.714233 212.89 62.0512 274.227 137.714 274.227Z" fill="
|
2
|
+
<path d="M137.714 274.227C213.377 274.227 274.714 212.89 274.714 137.227C274.714 61.5636 213.377 0.226593 137.714 0.226593C62.0512 0.226593 0.714233 61.5636 0.714233 137.227C0.714233 212.89 62.0512 274.227 137.714 274.227Z" fill="rgb(var(--color-primary-100))"/>
|
3
3
|
<rect x="55.5142" y="67.8133" width="164.4" height="32.88" fill="white"/>
|
4
4
|
<path d="M219.914 274.227H55.5142V97.0399C63.2629 97.0312 70.6918 93.9492 76.171 88.4701C81.6502 82.9909 84.7322 75.562 84.7409 67.8133H190.688C190.679 71.6518 191.432 75.4538 192.903 78.9994C194.374 82.5449 196.533 85.7636 199.256 88.4692C201.962 91.1929 205.181 93.353 208.727 94.8242C212.273 96.2953 216.075 97.0484 219.914 97.0399V274.227Z" fill="white"/>
|
5
|
-
<path d="M137.714 186.547C161.926 186.547 181.554 166.919 181.554 142.707C181.554 118.494 161.926 98.8666 137.714 98.8666C113.502 98.8666 93.8743 118.494 93.8743 142.707C93.8743 166.919 113.502 186.547 137.714 186.547Z" fill="
|
5
|
+
<path d="M137.714 186.547C161.926 186.547 181.554 166.919 181.554 142.707C181.554 118.494 161.926 98.8666 137.714 98.8666C113.502 98.8666 93.8743 118.494 93.8743 142.707C93.8743 166.919 113.502 186.547 137.714 186.547Z" fill="rgb(var(--color-primary-500))"/>
|
6
6
|
<path d="M153.214 163.373L137.714 147.874L122.214 163.373L117.048 158.207L132.548 142.707L117.048 127.207L122.214 122.041L137.714 137.54L153.214 122.041L158.381 127.207L142.881 142.707L158.381 158.207L153.214 163.373Z" fill="white"/>
|
7
|
-
<path d="M161.461 197.507H113.968C110.941 197.507 108.488 199.96 108.488 202.987C108.488 206.013 110.941 208.467 113.968 208.467H161.461C164.487 208.467 166.941 206.013 166.941 202.987C166.941 199.96 164.487 197.507 161.461 197.507Z" fill="
|
8
|
-
<path d="M177.901 219.427H97.5275C94.501 219.427 92.0475 221.88 92.0475 224.907C92.0475 227.933 94.501 230.387 97.5275 230.387H177.901C180.927 230.387 183.381 227.933 183.381 224.907C183.381 221.88 180.927 219.427 177.901 219.427Z" fill="
|
7
|
+
<path d="M161.461 197.507H113.968C110.941 197.507 108.488 199.96 108.488 202.987C108.488 206.013 110.941 208.467 113.968 208.467H161.461C164.487 208.467 166.941 206.013 166.941 202.987C166.941 199.96 164.487 197.507 161.461 197.507Z" fill="rgb(var(--color-primary-100))"/>
|
8
|
+
<path d="M177.901 219.427H97.5275C94.501 219.427 92.0475 221.88 92.0475 224.907C92.0475 227.933 94.501 230.387 97.5275 230.387H177.901C180.927 230.387 183.381 227.933 183.381 224.907C183.381 221.88 180.927 219.427 177.901 219.427Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
|
9
9
|
<defs>
|
10
|
-
<linearGradient id="paint0_linear_663_759" x1="137.714" y1="0.226593" x2="137.714" y2="274.227" gradientUnits="userSpaceOnUse">
|
11
10
|
<stop stop-color="#E3ECFA"/>
|
12
11
|
<stop offset="1" stop-color="#DAE7FF"/>
|
13
12
|
</linearGradient>
|
@@ -1,21 +1,20 @@
|
|
1
1
|
<svg width="248" height="287" viewBox="0 0 248 287" fill="none" xmlns="http://www.w3.org/2000/svg" data-target="grid-empty-state-svg">
|
2
|
-
<path d="M124 270.227C192.483 270.227 248 214.71 248 146.227C248 77.7433 192.483 22.2266 124 22.2266C55.5167 22.2266 0 77.7433 0 146.227C0 214.71 55.5167 270.227 124 270.227Z" fill="
|
3
|
-
<g filter="
|
2
|
+
<path d="M124 270.227C192.483 270.227 248 214.71 248 146.227C248 77.7433 192.483 22.2266 124 22.2266C55.5167 22.2266 0 77.7433 0 146.227C0 214.71 55.5167 270.227 124 270.227Z" fill="rgb(var(--color-primary-100))"/>
|
3
|
+
<g filter="rgb(var(--color-primary-100))">
|
4
4
|
<path d="M195.093 93.3198H52.9068C48.3412 93.3198 44.6401 97.0209 44.6401 101.586V275.186C44.6401 279.752 48.3412 283.453 52.9068 283.453H195.093C199.659 283.453 203.36 279.752 203.36 275.186V101.586C203.36 97.0209 199.659 93.3198 195.093 93.3198Z" fill="white"/>
|
5
5
|
</g>
|
6
|
-
<path d="M107.467 118.12H64.48C61.7407 118.12 59.52 120.34 59.52 123.08C59.52 125.819 61.7407 128.04 64.48 128.04H107.467C110.206 128.04 112.427 125.819 112.427 123.08C112.427 120.34 110.206 118.12 107.467 118.12Z" fill="
|
7
|
-
<path d="M137.227 139.613H64.48C61.7407 139.613 59.52 141.834 59.52 144.573C59.52 147.312 61.7407 149.533 64.48 149.533H137.227C139.966 149.533 142.187 147.312 142.187 144.573C142.187 141.834 139.966 139.613 137.227 139.613Z" fill="
|
8
|
-
<path d="M107.467 162.76H64.48C61.7407 162.76 59.52 164.981 59.52 167.72C59.52 170.459 61.7407 172.68 64.48 172.68H107.467C110.206 172.68 112.427 170.459 112.427 167.72C112.427 164.981 110.206 162.76 107.467 162.76Z" fill="
|
9
|
-
<path d="M137.227 184.253H64.48C61.7407 184.253 59.52 186.474 59.52 189.213C59.52 191.953 61.7407 194.173 64.48 194.173H137.227C139.966 194.173 142.187 191.953 142.187 189.213C142.187 186.474 139.966 184.253 137.227 184.253Z" fill="
|
10
|
-
<path d="M107.467 207.4H64.48C61.7407 207.4 59.52 209.621 59.52 212.36C59.52 215.099 61.7407 217.32 64.48 217.32H107.467C110.206 217.32 112.427 215.099 112.427 212.36C112.427 209.621 110.206 207.4 107.467 207.4Z" fill="
|
11
|
-
<path d="M137.227 228.893H64.48C61.7407 228.893 59.52 231.114 59.52 233.853C59.52 236.592 61.7407 238.813 64.48 238.813H137.227C139.966 238.813 142.187 236.592 142.187 233.853C142.187 231.114 139.966 228.893 137.227 228.893Z" fill="
|
6
|
+
<path d="M107.467 118.12H64.48C61.7407 118.12 59.52 120.34 59.52 123.08C59.52 125.819 61.7407 128.04 64.48 128.04H107.467C110.206 128.04 112.427 125.819 112.427 123.08C112.427 120.34 110.206 118.12 107.467 118.12Z" fill="rgb(var(--color-primary-100))"/>
|
7
|
+
<path d="M137.227 139.613H64.48C61.7407 139.613 59.52 141.834 59.52 144.573C59.52 147.312 61.7407 149.533 64.48 149.533H137.227C139.966 149.533 142.187 147.312 142.187 144.573C142.187 141.834 139.966 139.613 137.227 139.613Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
|
8
|
+
<path d="M107.467 162.76H64.48C61.7407 162.76 59.52 164.981 59.52 167.72C59.52 170.459 61.7407 172.68 64.48 172.68H107.467C110.206 172.68 112.427 170.459 112.427 167.72C112.427 164.981 110.206 162.76 107.467 162.76Z" fill="rgb(var(--color-primary-100))"/>
|
9
|
+
<path d="M137.227 184.253H64.48C61.7407 184.253 59.52 186.474 59.52 189.213C59.52 191.953 61.7407 194.173 64.48 194.173H137.227C139.966 194.173 142.187 191.953 142.187 189.213C142.187 186.474 139.966 184.253 137.227 184.253Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
|
10
|
+
<path d="M107.467 207.4H64.48C61.7407 207.4 59.52 209.621 59.52 212.36C59.52 215.099 61.7407 217.32 64.48 217.32H107.467C110.206 217.32 112.427 215.099 112.427 212.36C112.427 209.621 110.206 207.4 107.467 207.4Z" fill="rgb(var(--color-primary-100))"/>
|
11
|
+
<path d="M137.227 228.893H64.48C61.7407 228.893 59.52 231.114 59.52 233.853C59.52 236.592 61.7407 238.813 64.48 238.813H137.227C139.966 238.813 142.187 236.592 142.187 233.853C142.187 231.114 139.966 228.893 137.227 228.893Z" fill="rgb(var(--color-primary-100))" opacity="0.6"/>
|
12
12
|
<g filter="url(#filter1_d_577_1090)">
|
13
|
-
<path d="M195.093 9H52.9068C48.3412 9 44.6401 12.7011 44.6401 17.2667V66.8667C44.6401 71.4322 48.3412 75.1333 52.9068 75.1333H195.093C199.659 75.1333 203.36 71.4322 203.36 66.8667V17.2667C203.36 12.7011 199.659 9 195.093 9Z" fill="
|
13
|
+
<path d="M195.093 9H52.9068C48.3412 9 44.6401 12.7011 44.6401 17.2667V66.8667C44.6401 71.4322 48.3412 75.1333 52.9068 75.1333H195.093C199.659 75.1333 203.36 71.4322 203.36 66.8667V17.2667C203.36 12.7011 199.659 9 195.093 9Z" fill="rgb(var(--color-primary-500))"/>
|
14
14
|
</g>
|
15
|
-
<path d="M107.467 27.1865H64.48C61.7407 27.1865 59.52 29.4072 59.52 32.1465C59.52 34.8859 61.7407 37.1065 64.48 37.1065H107.467C110.206 37.1065 112.427 34.8859 112.427 32.1465C112.427 29.4072 110.206 27.1865 107.467 27.1865Z" fill="
|
15
|
+
<path d="M107.467 27.1865H64.48C61.7407 27.1865 59.52 29.4072 59.52 32.1465C59.52 34.8859 61.7407 37.1065 64.48 37.1065H107.467C110.206 37.1065 112.427 34.8859 112.427 32.1465C112.427 29.4072 110.206 27.1865 107.467 27.1865Z" fill="rgb(var(--color-primary-100))"/>
|
16
16
|
<path d="M137.227 48.6799H64.48C61.7407 48.6799 59.52 50.9006 59.52 53.6399C59.52 56.3793 61.7407 58.5999 64.48 58.5999H137.227C139.966 58.5999 142.187 56.3793 142.187 53.6399C142.187 50.9006 139.966 48.6799 137.227 48.6799Z" fill="white"/>
|
17
17
|
<defs>
|
18
|
-
<filter id="filter0_d_577_1090" x="38.6401" y="84.3198" width="170.72" height="202.133" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
19
18
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
20
19
|
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
21
20
|
<feOffset dy="-3"/>
|
@@ -1,26 +1,26 @@
|
|
1
1
|
<svg width="348" height="250" viewBox="0 0 348 250" fill="none" xmlns="http://www.w3.org/2000/svg" data-target="table-empty-state-svg">
|
2
|
-
<path d="M284.572 0H70.2863C60.4241 0 52.4292 7.99492 52.4292 17.8571V232.143C52.4292 242.005 60.4241 250 70.2863 250H284.572C294.434 250 302.429 242.005 302.429 232.143V17.8571C302.429 7.99492 294.434 0 284.572 0Z" fill="
|
2
|
+
<path d="M284.572 0H70.2863C60.4241 0 52.4292 7.99492 52.4292 17.8571V232.143C52.4292 242.005 60.4241 250 70.2863 250H284.572C294.434 250 302.429 242.005 302.429 232.143V17.8571C302.429 7.99492 294.434 0 284.572 0Z" fill="rgb(var(--color-primary-100))"/>
|
3
3
|
<g filter="url(#filter0_d_577_1275)">
|
4
4
|
<path d="M91.7142 96.4287H332.786C335.154 96.4287 337.425 97.3694 339.099 99.0438C340.774 100.718 341.714 102.989 341.714 105.357V150C341.714 152.368 340.774 154.639 339.099 156.314C337.425 157.988 335.154 158.929 332.786 158.929H91.7142C89.3462 158.929 87.0752 157.988 85.4008 156.314C83.7263 154.639 82.7856 152.368 82.7856 150V105.357C82.7856 102.989 83.7263 100.718 85.4008 99.0438C87.0752 97.3694 89.3462 96.4287 91.7142 96.4287V96.4287Z" fill="white"/>
|
5
5
|
</g>
|
6
|
-
<path d="M223.857 110.714H177.429C174.47 110.714 172.072 113.112 172.072 116.071C172.072 119.03 174.47 121.428 177.429 121.428H223.857C226.816 121.428 229.215 119.03 229.215 116.071C229.215 113.112 226.816 110.714 223.857 110.714Z" fill="
|
7
|
-
<path d="M256 133.928H177.429C174.47 133.928 172.072 136.327 172.072 139.285C172.072 142.244 174.47 144.643 177.429 144.643H256C258.959 144.643 261.357 142.244 261.357 139.285C261.357 136.327 258.959 133.928 256 133.928Z" fill="
|
8
|
-
<path d="M137.251 144.642C146.621 144.642 154.216 137.047 154.216 127.678C154.216 118.309 146.621 110.714 137.251 110.714C127.882 110.714 120.287 118.309 120.287 127.678C120.287 137.047 127.882 144.642 137.251 144.642Z" fill="
|
6
|
+
<path d="M223.857 110.714H177.429C174.47 110.714 172.072 113.112 172.072 116.071C172.072 119.03 174.47 121.428 177.429 121.428H223.857C226.816 121.428 229.215 119.03 229.215 116.071C229.215 113.112 226.816 110.714 223.857 110.714Z" fill="rgb(var(--color-primary-100))"/>
|
7
|
+
<path d="M256 133.928H177.429C174.47 133.928 172.072 136.327 172.072 139.285C172.072 142.244 174.47 144.643 177.429 144.643H256C258.959 144.643 261.357 142.244 261.357 139.285C261.357 136.327 258.959 133.928 256 133.928Z" fill="rgb(var(--color-primary-100))" opacity="0.7"/>
|
8
|
+
<path d="M137.251 144.642C146.621 144.642 154.216 137.047 154.216 127.678C154.216 118.309 146.621 110.714 137.251 110.714C127.882 110.714 120.287 118.309 120.287 127.678C120.287 137.047 127.882 144.642 137.251 144.642Z" fill="rgb(var(--color-primary-500))"/>
|
9
9
|
<path d="M133.905 133V131.668L137.44 128.202C137.778 127.861 138.059 127.558 138.285 127.293C138.51 127.027 138.679 126.771 138.792 126.522C138.905 126.273 138.961 126.008 138.961 125.727C138.961 125.405 138.888 125.13 138.742 124.901C138.596 124.669 138.396 124.49 138.141 124.364C137.885 124.238 137.595 124.175 137.271 124.175C136.936 124.175 136.643 124.245 136.391 124.384C136.139 124.52 135.943 124.714 135.804 124.966C135.668 125.218 135.6 125.518 135.6 125.866H133.845C133.845 125.219 133.993 124.658 134.288 124.18C134.583 123.703 134.989 123.334 135.506 123.072C136.026 122.81 136.623 122.679 137.295 122.679C137.978 122.679 138.578 122.807 139.095 123.062C139.612 123.317 140.013 123.667 140.298 124.111C140.587 124.555 140.731 125.062 140.731 125.632C140.731 126.013 140.658 126.388 140.512 126.756C140.366 127.124 140.109 127.531 139.741 127.979C139.377 128.426 138.865 128.968 138.205 129.604L136.45 131.389V131.459H140.885V133H133.905Z" fill="white"/>
|
10
10
|
<g filter="url(#filter1_d_577_1275)">
|
11
11
|
<path d="M14.9286 173.214H256C258.368 173.214 260.639 174.155 262.313 175.829C263.988 177.504 264.929 179.775 264.929 182.143V226.786C264.929 229.154 263.988 231.425 262.313 233.099C260.639 234.774 258.368 235.714 256 235.714H14.9286C12.5606 235.714 10.2896 234.774 8.61512 233.099C6.94069 231.425 6 229.154 6 226.786V182.143C6 179.775 6.94069 177.504 8.61512 175.829C10.2896 174.155 12.5606 173.214 14.9286 173.214V173.214Z" fill="white"/>
|
12
12
|
</g>
|
13
|
-
<path d="M147.071 187.5H100.643C97.6841 187.5 95.2856 189.898 95.2856 192.857C95.2856 195.816 97.6841 198.214 100.643 198.214H147.071C150.03 198.214 152.429 195.816 152.429 192.857C152.429 189.898 150.03 187.5 147.071 187.5Z" fill="
|
14
|
-
<path d="M179.214 210.714H100.643C97.6841 210.714 95.2856 213.113 95.2856 216.071C95.2856 219.03 97.6841 221.429 100.643 221.429H179.214C182.173 221.429 184.571 219.03 184.571 216.071C184.571 213.113 182.173 210.714 179.214 210.714Z" fill="
|
15
|
-
<path d="M37.2499 221.428C46.619 221.428 54.2142 213.833 54.2142 204.464C54.2142 195.095 46.619 187.5 37.2499 187.5C27.8808 187.5 20.2856 195.095 20.2856 204.464C20.2856 213.833 27.8808 221.428 37.2499 221.428Z" fill="
|
13
|
+
<path d="M147.071 187.5H100.643C97.6841 187.5 95.2856 189.898 95.2856 192.857C95.2856 195.816 97.6841 198.214 100.643 198.214H147.071C150.03 198.214 152.429 195.816 152.429 192.857C152.429 189.898 150.03 187.5 147.071 187.5Z" fill="rgb(var(--color-primary-100))"/>
|
14
|
+
<path d="M179.214 210.714H100.643C97.6841 210.714 95.2856 213.113 95.2856 216.071C95.2856 219.03 97.6841 221.429 100.643 221.429H179.214C182.173 221.429 184.571 219.03 184.571 216.071C184.571 213.113 182.173 210.714 179.214 210.714Z" fill="rgb(var(--color-primary-100))" opacity="0.7"/>
|
15
|
+
<path d="M37.2499 221.428C46.619 221.428 54.2142 213.833 54.2142 204.464C54.2142 195.095 46.619 187.5 37.2499 187.5C27.8808 187.5 20.2856 195.095 20.2856 204.464C20.2856 213.833 27.8808 221.428 37.2499 221.428Z" fill="rgb(var(--color-primary-500))"/>
|
16
16
|
<path d="M36.9077 209.119C36.294 209.119 35.7486 209.014 35.2713 208.804C34.7969 208.594 34.4219 208.301 34.1463 207.926C33.8707 207.551 33.7244 207.118 33.7074 206.626H35.3097C35.3239 206.862 35.402 207.068 35.544 207.244C35.6861 207.418 35.875 207.553 36.1108 207.649C36.3466 207.746 36.6108 207.794 36.9034 207.794C37.2159 207.794 37.4929 207.74 37.7344 207.632C37.9759 207.521 38.1648 207.368 38.3011 207.172C38.4375 206.976 38.5043 206.75 38.5014 206.494C38.5043 206.23 38.4361 205.997 38.2969 205.795C38.1577 205.594 37.956 205.436 37.6918 205.322C37.4304 205.209 37.1151 205.152 36.7457 205.152H35.9744V203.933H36.7457C37.0497 203.933 37.3153 203.881 37.5426 203.776C37.7727 203.67 37.9531 203.523 38.0838 203.332C38.2145 203.139 38.2784 202.916 38.2756 202.663C38.2784 202.416 38.223 202.202 38.1094 202.02C37.9986 201.835 37.8409 201.692 37.6364 201.589C37.4347 201.487 37.1974 201.436 36.9247 201.436C36.6577 201.436 36.4105 201.484 36.1832 201.581C35.956 201.678 35.7727 201.815 35.6335 201.994C35.4943 202.17 35.4205 202.381 35.4119 202.625H33.8906C33.902 202.136 34.0426 201.707 34.3125 201.338C34.5852 200.966 34.9489 200.676 35.4034 200.469C35.858 200.259 36.3679 200.153 36.9332 200.153C37.5156 200.153 38.0213 200.263 38.4503 200.482C38.8821 200.697 39.2159 200.989 39.4517 201.355C39.6875 201.722 39.8054 202.126 39.8054 202.57C39.8082 203.061 39.6634 203.473 39.3707 203.805C39.081 204.138 38.7003 204.355 38.2287 204.457V204.526C38.8423 204.611 39.3125 204.838 39.6392 205.207C39.9688 205.574 40.1321 206.03 40.1293 206.575C40.1293 207.064 39.9901 207.501 39.7116 207.888C39.4361 208.271 39.0554 208.572 38.5696 208.791C38.0866 209.01 37.5327 209.119 36.9077 209.119Z" fill="white"/>
|
17
17
|
<g filter="url(#filter2_d_577_1275)">
|
18
|
-
<path d="M256 19.6428H14.9286C9.99746 19.6428 6 23.6403 6 28.5714V73.2142C6 78.1454 9.99746 82.1428 14.9286 82.1428H256C260.931 82.1428 264.929 78.1454 264.929 73.2142V28.5714C264.929 23.6403 260.931 19.6428 256 19.6428Z" fill="
|
18
|
+
<path d="M256 19.6428H14.9286C9.99746 19.6428 6 23.6403 6 28.5714V73.2142C6 78.1454 9.99746 82.1428 14.9286 82.1428H256C260.931 82.1428 264.929 78.1454 264.929 73.2142V28.5714C264.929 23.6403 260.931 19.6428 256 19.6428Z" ss="hh" fill="rgb(var(--color-primary-500))"/>
|
19
19
|
</g>
|
20
|
-
<path d="M143.5 33.929H97.0715C94.1128 33.929 91.7144 36.3274 91.7144 39.2861C91.7144 42.2448 94.1128 44.6432 97.0715 44.6432H143.5C146.459 44.6432 148.857 42.2448 148.857 39.2861C148.857 36.3274 146.459 33.929 143.5 33.929Z" fill="
|
21
|
-
<path d="M175.643 57.1431H97.0715C94.1128 57.1431 91.7144 59.5415 91.7144 62.5002C91.7144 65.4589 94.1128 67.8574 97.0715 67.8574H175.643C178.602 67.8574 181 65.4589 181 62.5002C181 59.5415 178.602 57.1431 175.643 57.1431Z" fill="
|
20
|
+
<path d="M143.5 33.929H97.0715C94.1128 33.929 91.7144 36.3274 91.7144 39.2861C91.7144 42.2448 94.1128 44.6432 97.0715 44.6432H143.5C146.459 44.6432 148.857 42.2448 148.857 39.2861C148.857 36.3274 146.459 33.929 143.5 33.929Z" fill="rgb(var(--color-primary-100))"/>
|
21
|
+
<path d="M175.643 57.1431H97.0715C94.1128 57.1431 91.7144 59.5415 91.7144 62.5002C91.7144 65.4589 94.1128 67.8574 97.0715 67.8574H175.643C178.602 67.8574 181 65.4589 181 62.5002C181 59.5415 178.602 57.1431 175.643 57.1431Z" fill="rgb(var(--color-primary-100))" opacity="0.7"/>
|
22
22
|
<path d="M60.4643 67.857C69.8334 67.857 77.4286 60.2619 77.4286 50.8928C77.4286 41.5236 69.8334 33.9285 60.4643 33.9285C51.0952 33.9285 43.5 41.5236 43.5 50.8928C43.5 60.2619 51.0952 67.857 60.4643 67.857Z" fill="white"/>
|
23
|
-
<path d="M62.1477 45.6746V55.8564H60.3032V47.4694H60.2435L57.8621 48.9907V47.3003L60.3927 45.6746H62.1477Z" fill="
|
23
|
+
<path d="M62.1477 45.6746V55.8564H60.3032V47.4694H60.2435L57.8621 48.9907V47.3003L60.3927 45.6746H62.1477Z" fill="rgb(var(--color-primary-500))"/>
|
24
24
|
<defs>
|
25
25
|
<filter id="filter0_d_577_1275" x="76.7856" y="93.4287" width="270.929" height="74.5" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
26
26
|
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
@@ -49,7 +49,6 @@
|
|
49
49
|
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_577_1275"/>
|
50
50
|
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_577_1275" result="shape"/>
|
51
51
|
</filter>
|
52
|
-
<linearGradient id="paint0_linear_577_1275" x1="177.429" y1="0" x2="177.429" y2="250" gradientUnits="userSpaceOnUse">
|
53
52
|
<stop stop-color="#E3ECFA"/>
|
54
53
|
<stop offset="1" stop-color="#DAE7FF"/>
|
55
54
|
</linearGradient>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<div class="relative flex flex-col w-full sm:w-auto z-40 js-actions-dropdown"
|
2
2
|
data-controller="toggle-panel actions-picker"
|
3
|
-
data-actions-picker-enabled-class="text-black hover:bg-
|
3
|
+
data-actions-picker-enabled-class="text-black hover:bg-primary-500 hover:text-white"
|
4
4
|
data-actions-picker-disabled-class="cursor-wait text-gray-500"
|
5
5
|
>
|
6
|
-
<%= a_button style:
|
6
|
+
<%= a_button style: @style,
|
7
7
|
type: :button,
|
8
|
-
color:
|
8
|
+
color: @color,
|
9
9
|
class: "focus:outline-none",
|
10
10
|
icon: 'arrow-circle-right',
|
11
11
|
icon_class: 'transform rotate-90',
|
@@ -18,7 +18,7 @@
|
|
18
18
|
data-toggle-panel-target="panel"
|
19
19
|
>
|
20
20
|
<div class="w-full space divide-y">
|
21
|
-
<%
|
21
|
+
<% actions.each_with_index do |action, index| %>
|
22
22
|
<%= link_to action_path(action.param_id),
|
23
23
|
data: {
|
24
24
|
'turbo-frame': 'actions_show',
|
@@ -27,7 +27,7 @@
|
|
27
27
|
'disabled': is_disabled?(action),
|
28
28
|
},
|
29
29
|
title: action.action_name,
|
30
|
-
class: "flex items-center px-4 py-3 w-full font-semibold text-sm #{is_disabled?(action) ? 'text-gray-500' : 'text-black
|
30
|
+
class: "flex items-center px-4 py-3 w-full font-semibold text-sm hover:bg-primary-100 #{is_disabled?(action) ? 'text-gray-500' : 'text-black'}" do %>
|
31
31
|
<%= svg 'play', class: 'h-5 mr-1 inline' %> <%= action.action_name %>
|
32
32
|
<% end %>
|
33
33
|
<% end %>
|
@@ -3,14 +3,23 @@
|
|
3
3
|
class Avo::ActionsComponent < ViewComponent::Base
|
4
4
|
include Avo::ApplicationHelper
|
5
5
|
|
6
|
-
def initialize(actions: [], resource: nil, view: nil)
|
7
|
-
@actions = actions
|
6
|
+
def initialize(actions: [], resource: nil, view: nil, exclude: [], style: :outline, color: :primary)
|
7
|
+
@actions = actions || []
|
8
8
|
@resource = resource
|
9
9
|
@view = view
|
10
|
+
@exclude = exclude
|
11
|
+
@color = color
|
12
|
+
@style = style
|
10
13
|
end
|
11
14
|
|
12
15
|
def render?
|
13
|
-
|
16
|
+
actions.present?
|
17
|
+
end
|
18
|
+
|
19
|
+
def actions
|
20
|
+
@actions.select do |action|
|
21
|
+
!action.class.in?(@exclude)
|
22
|
+
end
|
14
23
|
end
|
15
24
|
|
16
25
|
# When running an action for one record we should do it on a special path.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# A button/link can have the following settings:
|
4
|
-
# style: primary/
|
4
|
+
# style: primary/outline/text
|
5
5
|
# size: :xs :sm, :md, :lg
|
6
6
|
class Avo::ButtonComponent < ViewComponent::Base
|
7
7
|
def initialize(path = nil, size: :md, style: :outline, color: :gray, icon: nil, icon_class: "", is_link: false, rounded: true, compact: false, **args)
|
@@ -43,9 +43,7 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
43
43
|
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}"
|
44
44
|
|
45
45
|
classes += " rounded" if @rounded.present?
|
46
|
-
|
47
46
|
classes += style_classes
|
48
|
-
|
49
47
|
classes += horizontal_padding_classes
|
50
48
|
classes += vertical_padding_classes
|
51
49
|
classes += text_size_classes
|
@@ -75,7 +73,7 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
75
73
|
result.html_safe
|
76
74
|
end
|
77
75
|
|
78
|
-
def
|
76
|
+
def call
|
79
77
|
if is_link?
|
80
78
|
output_link
|
81
79
|
else
|
@@ -151,7 +149,7 @@ class Avo::ButtonComponent < ViewComponent::Base
|
|
151
149
|
def style_classes
|
152
150
|
case @style
|
153
151
|
when :primary
|
154
|
-
" bg-
|
152
|
+
" bg-#{@color}-500 text-white border-#{@color}-500 hover:bg-#{@color}-600 hover:border-#{@color}-600 active:border-#{@color}-600 active:outline-#{@color}-600 active:bg-#{@color}-600"
|
155
153
|
when :outline
|
156
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"
|
157
155
|
when :text
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="h-8 flex items-center">
|
3
3
|
<%= @form.check_box @field.id,
|
4
4
|
checked: @field.value,
|
5
|
-
class: "text-lg h-4 w-4 #{@field.get_html(:classes, view: view, element: :input)}",
|
5
|
+
class: "text-lg h-4 w-4 checked:bg-primary-400 focus:checked:!bg-primary-400 #{@field.get_html(:classes, view: view, element: :input)}",
|
6
6
|
data: @field.get_html(:data, view: view, element: :input),
|
7
7
|
disabled: @field.readonly,
|
8
8
|
style: @field.get_html(:style, view: view, element: :input)
|
@@ -9,4 +9,4 @@
|
|
9
9
|
url = URI::HTTPS.build(host: "www.gravatar.com", path: "/avatar/#{@md5}", query: query)
|
10
10
|
classes = @rounded ? 'rounded-full' : ''
|
11
11
|
%>
|
12
|
-
<%= link_to_if @link_to_resource.present?, image_tag(url.to_s, class: classes), @link, title: @title %>
|
12
|
+
<%= link_to_if @link_to_resource.present?, image_tag(url.to_s, class: classes, width: options[:size], height: options[:size]), @link, title: @title %>
|
@@ -7,7 +7,6 @@
|
|
7
7
|
date_field_picker_format_value: @field.picker_format,
|
8
8
|
date_field_first_day_of_week_value: @field.first_day_of_week,
|
9
9
|
date_field_disable_mobile_value: @field.disable_mobile,
|
10
|
-
date_field_relative_value: @field.relative,
|
11
10
|
} do %>
|
12
11
|
<%= datetime_field "fake_#{@field.id}", "fake",
|
13
12
|
value: @field.edit_formatted_value,
|
@@ -15,7 +14,6 @@
|
|
15
14
|
data: {
|
16
15
|
'date-field-target': 'fakeInput',
|
17
16
|
placeholder: @field.placeholder,
|
18
|
-
relative: @field.relative,
|
19
17
|
**@field.get_html(:data, view: view, element: :input)
|
20
18
|
},
|
21
19
|
disabled: @field.readonly,
|
@@ -28,7 +26,6 @@
|
|
28
26
|
data: {
|
29
27
|
'date-field-target': 'input',
|
30
28
|
placeholder: @field.placeholder,
|
31
|
-
relative: @field.relative,
|
32
29
|
**@field.get_html(:data, view: view, element: :input)
|
33
30
|
},
|
34
31
|
disabled: @field.readonly,
|
@@ -15,7 +15,6 @@
|
|
15
15
|
data: {
|
16
16
|
'date-field-target': 'fakeInput',
|
17
17
|
placeholder: @field.placeholder,
|
18
|
-
relative: @field.relative,
|
19
18
|
**@field.get_html(:data, view: view, element: :input)
|
20
19
|
},
|
21
20
|
disabled: @field.readonly,
|
@@ -28,7 +27,6 @@
|
|
28
27
|
data: {
|
29
28
|
'date-field-target': 'input',
|
30
29
|
placeholder: @field.placeholder,
|
31
|
-
relative: @field.relative,
|
32
30
|
**@field.get_html(:data, view: view, element: :input)
|
33
31
|
},
|
34
32
|
disabled: @field.readonly,
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= render(Avo::LoadingComponent.new(title: @field.name)) %>
|
4
4
|
</turbo-frame>
|
5
5
|
<% else %>
|
6
|
-
<%= render Avo::PanelComponent.new(
|
6
|
+
<%= render Avo::PanelComponent.new(name: @field.name) do |c| %>
|
7
7
|
<% c.tools do %>
|
8
8
|
<% if !@field.readonly && can_attach? %>
|
9
9
|
<%= a_link attach_path, icon: 'heroicons/outline/link', color: :primary, 'data-turbo-frame': 'attach_modal' do %>
|
@@ -4,5 +4,5 @@
|
|
4
4
|
<%= @field.value %><%= @field.value_suffix if @field.value_suffix.present? %>
|
5
5
|
</div>
|
6
6
|
<% end %>
|
7
|
-
<progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block w-
|
7
|
+
<progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block w-auto"></progress>
|
8
8
|
<% end %>
|
@@ -4,5 +4,5 @@
|
|
4
4
|
<%= @field.value %><%= @field.value_suffix if @field.value_suffix.present? %>
|
5
5
|
</div>
|
6
6
|
<% end %>
|
7
|
-
<progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block w-full"></progress>
|
7
|
+
<progress min="0" max="<%= @field.max %>" value="<%= @field.value %>" class="block h-3 w-full"></progress>
|
8
8
|
<% end %>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
%>
|
18
18
|
<%# real field %>
|
19
19
|
<%= @form.text_field @field.id,
|
20
|
-
class: classes("hidden w-full"),
|
20
|
+
class: classes("hidden w-full border-primary-500 focus-within:border-primary-500"),
|
21
21
|
data: {
|
22
22
|
'tags-field-target': 'input',
|
23
23
|
'whitelist-items': @field.suggestions.to_json,
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= render item.partial, tool: item, form: @form %>
|
4
4
|
<% end %>
|
5
5
|
<% elsif item.is_panel? %>
|
6
|
-
<%= render Avo::PanelComponent.new(
|
6
|
+
<%= render Avo::PanelComponent.new(name: item.name, description: item.description, index: index) do |c| %>
|
7
7
|
<% c.body do %>
|
8
8
|
<div class="divide-y">
|
9
9
|
<% item.items.each_with_index do |field, index| %>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<% end %>
|
18
18
|
</div>
|
19
19
|
<% if tools.present? %>
|
20
|
-
<div class="flex-1 w-full flex flex-col sm:flex-row xl:justify-end sm:items-end
|
20
|
+
<div class="flex-1 w-full flex flex-wrap flex-col sm:flex-row xl:justify-end sm:items-end gap-2 mt-4 xl:mt-0" data-target="panel-tools">
|
21
21
|
<%= tools %>
|
22
22
|
</div>
|
23
23
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Avo::PanelComponent < ViewComponent::Base
|
4
|
-
attr_reader :title
|
4
|
+
attr_reader :title # deprecating title in favor of name
|
5
5
|
attr_reader :name
|
6
6
|
attr_reader :classes
|
7
7
|
|
@@ -11,9 +11,9 @@ class Avo::PanelComponent < ViewComponent::Base
|
|
11
11
|
renders_one :footer_tools
|
12
12
|
renders_one :footer
|
13
13
|
|
14
|
-
def initialize(
|
14
|
+
def initialize(name: nil, description: nil, body_classes: nil, data: {}, display_breadcrumbs: false, index: nil, classes: nil, **args)
|
15
15
|
# deprecating title in favor of name
|
16
|
-
@title = title
|
16
|
+
@title = args[:title]
|
17
17
|
@name = name || title
|
18
18
|
@description = description
|
19
19
|
@classes = classes
|
@@ -21,7 +21,6 @@ class Avo::PanelComponent < ViewComponent::Base
|
|
21
21
|
@data = data
|
22
22
|
@display_breadcrumbs = display_breadcrumbs
|
23
23
|
@index = index
|
24
|
-
@view = view
|
25
24
|
end
|
26
25
|
|
27
26
|
private
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= link_to path, class: "flex-1 flex items-center justify-center bg-white text-left cursor-pointer text-gray-800 font-semibold hover:bg-
|
1
|
+
<%= link_to path, class: "flex-1 flex items-center justify-center bg-white text-left cursor-pointer text-gray-800 font-semibold hover:bg-primary-100 block px-4 py-1 w-full py-3 text-center rounded w-full", target: target, title: title do %>
|
2
2
|
<%= helpers.svg(icon, class: 'h-4 mr-1') if icon.present? %> <%= label %>
|
3
3
|
<% end %>
|
@@ -22,6 +22,12 @@ class Avo::ResourceComponent < Avo::BaseComponent
|
|
22
22
|
authorize_association_for("detach")
|
23
23
|
end
|
24
24
|
|
25
|
+
def detach_path
|
26
|
+
return "/" if @reflection.blank?
|
27
|
+
|
28
|
+
helpers.resource_detach_path(params[:resource_name], params[:id], @reflection.name.to_s, @resource.model.id)
|
29
|
+
end
|
30
|
+
|
25
31
|
def can_see_the_edit_button?
|
26
32
|
@resource.authorization.authorize_action(:edit, raise_exception: false)
|
27
33
|
end
|
@@ -30,10 +36,6 @@ class Avo::ResourceComponent < Avo::BaseComponent
|
|
30
36
|
@resource.authorization.authorize_action(:destroy, raise_exception: false)
|
31
37
|
end
|
32
38
|
|
33
|
-
def detach_path
|
34
|
-
helpers.resource_detach_path(params[:resource_name], params[:id], @reflection.name.to_s, @resource.model.id)
|
35
|
-
end
|
36
|
-
|
37
39
|
def destroy_path
|
38
40
|
helpers.resource_path(model: @resource.model, resource: @resource)
|
39
41
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div
|
2
|
-
class="avo-sidebar fixed z-[60] t-0 application-sidebar w-64 flex-1 border-r lg:border-none bg-none h-[calc(100vh-4rem)] bg-
|
2
|
+
class="avo-sidebar fixed z-[60] t-0 application-sidebar w-64 flex-1 border-r lg:border-none bg-none h-[calc(100vh-4rem)] bg-application lg:bg-transparent <%= 'print:hidden' if Avo.configuration.hide_layout_when_printing %> <%= @sidebar_open ? 'flex' : 'hidden' %>"
|
3
3
|
data-sidebar-target="<%= stimulus_target %>"
|
4
4
|
data-transition-enter="transition ease-out duration-100"
|
5
5
|
data-transition-enter-start="transform opacity-0 -translate-x-full"
|
@@ -15,7 +15,7 @@
|
|
15
15
|
},
|
16
16
|
multipart: true do |form| %>
|
17
17
|
<%= render Avo::ReferrerParamsComponent.new back_path: back_path %>
|
18
|
-
<%= render Avo::PanelComponent.new(
|
18
|
+
<%= render Avo::PanelComponent.new(name: title, description: @resource.resource_description, display_breadcrumbs: @reflection.blank?, index: 0, data: { panel_id: "main" }) do |c| %>
|
19
19
|
<% c.tools do %>
|
20
20
|
<%= a_link back_path,
|
21
21
|
style: :text,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
data: {
|
3
3
|
**@resource.stimulus_data_attributes
|
4
4
|
} do %>
|
5
|
-
<%= render Avo::PanelComponent.new(
|
5
|
+
<%= render Avo::PanelComponent.new(name: title, description: description, data: { component: 'resources-index' }, display_breadcrumbs: @reflection.blank?) do |c| %>
|
6
6
|
<% c.tools do %>
|
7
7
|
<% if can_attach? %>
|
8
8
|
<%= a_link attach_path,
|
@@ -125,7 +125,7 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
|
|
125
125
|
def singular_resource_name
|
126
126
|
if @reflection.present?
|
127
127
|
return name.singularize if field.present?
|
128
|
-
|
128
|
+
|
129
129
|
reflection_resource.name
|
130
130
|
else
|
131
131
|
@resource.singular_name || @resource.model_class.model_name.name.downcase
|