avo 3.30.4 → 4.0.0.beta.2
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 +18 -1
- data/Gemfile.lock +257 -174
- data/README.md +1 -1
- data/app/assets/builds/avo/application.css +13979 -0
- data/app/assets/builds/avo/application.js +1160 -0
- data/app/assets/builds/avo/application.js.map +7 -0
- data/app/assets/builds/avo/late-registration.js +2 -0
- data/app/assets/builds/avo/late-registration.js.map +7 -0
- data/app/assets/config/avo_manifest.js +2 -1
- data/app/assets/images/avo/placeholder.svg +1 -0
- data/app/assets/stylesheets/application.css +250 -0
- data/app/assets/stylesheets/css/button-group.css +23 -0
- data/app/assets/stylesheets/css/components/avatar.css +128 -0
- data/app/assets/stylesheets/css/components/breadcrumbs.css +43 -0
- data/app/assets/stylesheets/css/components/button.css +343 -0
- data/app/assets/stylesheets/css/components/color_scheme_switcher.css +226 -0
- data/app/assets/stylesheets/css/components/discreet_information.css +49 -0
- data/app/assets/stylesheets/css/components/field-wrapper.css +107 -0
- data/app/assets/stylesheets/css/components/grid.css +120 -0
- data/app/assets/stylesheets/css/components/input.css +312 -0
- data/app/assets/stylesheets/css/components/modal.css +228 -0
- data/app/assets/stylesheets/css/components/tooltip.css +25 -0
- data/app/assets/stylesheets/css/components/ui/badge.css +143 -0
- data/app/assets/stylesheets/css/components/ui/card.css +95 -0
- data/app/assets/stylesheets/css/components/ui/checkbox.css +50 -0
- data/app/assets/stylesheets/css/components/ui/description_list.css +3 -0
- data/app/assets/stylesheets/css/components/ui/dropdown.css +68 -0
- data/app/assets/stylesheets/css/components/ui/file_upload_input.css +94 -0
- data/app/assets/stylesheets/css/components/ui/file_upload_item.css +78 -0
- data/app/assets/stylesheets/css/components/ui/panel.css +59 -0
- data/app/assets/stylesheets/css/components/ui/panel_header.css +48 -0
- data/app/assets/stylesheets/css/components/ui/radio.css +22 -0
- data/app/assets/stylesheets/css/components/ui/tabs.css +74 -0
- data/app/assets/stylesheets/css/css-animations.css +54 -0
- data/app/assets/stylesheets/css/fields/code.css +75 -9
- data/app/assets/stylesheets/css/fields/easy-mde.css +7 -0
- data/app/assets/stylesheets/css/fields/key_value.css +97 -0
- data/app/assets/stylesheets/css/fields/progress.css +4 -4
- data/app/assets/stylesheets/css/fields/status.css +7 -1
- data/app/assets/stylesheets/css/fields/tags.css +33 -16
- data/app/assets/stylesheets/css/fields/tiptap.css +17 -15
- data/app/assets/stylesheets/css/fields/trix.css +62 -2
- data/app/assets/stylesheets/css/fonts.css +24 -24
- data/app/assets/stylesheets/css/layout.css +135 -0
- data/app/assets/stylesheets/css/pagination.css +114 -78
- data/app/assets/stylesheets/css/resource-controls.css +13 -0
- data/app/assets/stylesheets/css/search.css +22 -12
- data/app/assets/stylesheets/css/sidebar.css +310 -24
- data/app/assets/stylesheets/css/table.css +60 -0
- data/app/assets/stylesheets/css/tooltips.css +1 -1
- data/app/assets/stylesheets/css/typography.css +10 -1
- data/app/assets/stylesheets/css/variables.css +318 -0
- data/app/assets/svgs/avo/moon-plus-plus.svg +1 -0
- data/app/components/avo/actions_component.html.erb +30 -36
- data/app/components/avo/actions_component.rb +8 -11
- data/app/components/avo/alert_component.html.erb +3 -3
- data/app/components/avo/alert_component.rb +1 -1
- data/app/components/avo/asset_manager/javascript_component.html.erb +1 -2
- data/app/components/avo/backtrace_alert_component.html.erb +4 -4
- data/app/components/avo/base_component.rb +3 -4
- data/app/components/avo/breadcrumb_element_component.html.erb +17 -0
- data/app/components/avo/breadcrumb_element_component.rb +21 -0
- data/app/components/avo/breadcrumbs_component.html.erb +19 -0
- data/app/components/avo/breadcrumbs_component.rb +5 -0
- data/app/components/avo/button_component.rb +20 -126
- data/app/components/avo/clipboard_component.html.erb +3 -2
- data/app/components/avo/clipboard_component.rb +1 -1
- data/app/components/avo/component_missing_component.rb +11 -0
- data/app/components/avo/cover_component.html.erb +3 -0
- data/app/components/avo/cover_component.rb +25 -0
- data/app/components/avo/debug/status_component.html.erb +59 -0
- data/app/components/avo/debug/status_component.rb +30 -0
- data/app/components/avo/description_list_component.rb +11 -0
- data/app/components/avo/discreet_information_component.html.erb +31 -6
- data/app/components/avo/discreet_information_component.rb +23 -32
- data/app/components/avo/divider_component.html.erb +2 -2
- data/app/components/avo/empty_state_component.html.erb +2 -9
- data/app/components/avo/empty_state_component.rb +0 -8
- data/app/components/avo/field_wrapper_component.html.erb +21 -22
- data/app/components/avo/field_wrapper_component.rb +9 -18
- data/app/components/avo/fields/avatar_field/index_component.html.erb +9 -0
- data/app/components/avo/fields/avatar_field/index_component.rb +4 -0
- data/app/components/avo/fields/badge_field/index_component.html.erb +7 -1
- data/app/components/avo/fields/badge_field/show_component.html.erb +6 -1
- data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +16 -14
- data/app/components/avo/fields/belongs_to_field/edit_component.rb +13 -3
- data/app/components/avo/fields/boolean_field/edit_component.html.erb +2 -2
- data/app/components/avo/fields/boolean_group_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/boolean_group_field/edit_component.rb +2 -3
- data/app/components/avo/fields/code_field/show_component.html.erb +1 -1
- data/app/components/avo/fields/common/boolean_check_component.rb +3 -3
- data/app/components/avo/fields/common/boolean_group_component.html.erb +2 -2
- data/app/components/avo/fields/common/files/controls_component.html.erb +30 -27
- data/app/components/avo/fields/common/files/controls_component.rb +0 -1
- data/app/components/avo/fields/common/files/list_viewer_component.html.erb +4 -5
- data/app/components/avo/fields/common/files/view_type/grid_item_component.html.erb +1 -1
- data/app/components/avo/fields/common/files/view_type/list_item_component.html.erb +7 -19
- data/app/components/avo/fields/common/heading_component.html.erb +2 -2
- data/app/components/avo/fields/common/heading_component.rb +1 -1
- data/app/components/avo/fields/common/key_value_component.html.erb +20 -24
- data/app/components/avo/fields/common/nested_field_component.html.erb +1 -1
- data/app/components/avo/fields/common/nested_field_component.rb +1 -1
- data/app/components/avo/fields/common/progress_bar_component.html.erb +2 -2
- data/app/components/avo/fields/common/stars_component.html.erb +1 -1
- data/app/components/avo/fields/common/status_viewer_component.html.erb +4 -10
- data/app/components/avo/fields/date_field/edit_component.html.erb +14 -1
- data/app/components/avo/fields/date_time_field/edit_component.html.erb +3 -3
- data/app/components/avo/fields/easy_mde_field/show_component.html.erb +1 -1
- data/app/components/avo/fields/edit_component.rb +9 -5
- data/app/components/avo/fields/file_field/edit_component.html.erb +14 -6
- data/app/components/avo/fields/files_field/edit_component.html.erb +11 -4
- data/app/components/avo/fields/has_one_field/show_component.html.erb +10 -9
- data/app/components/avo/fields/heading_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/heading_field/show_component.html.erb +2 -2
- data/app/components/avo/fields/password_field/edit_component.html.erb +5 -7
- data/app/components/avo/fields/progress_bar_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/radio_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/show_component.rb +4 -7
- data/app/components/avo/fields/stars_field/edit_component.html.erb +3 -4
- data/app/components/avo/fields/tags_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/tags_field/tag_component.html.erb +7 -8
- data/app/components/avo/fields/time_field/edit_component.html.erb +3 -3
- data/app/components/avo/fields/tiptap_field/edit_component.html.erb +11 -11
- data/app/components/avo/fields/tiptap_field/show_component.html.erb +4 -4
- data/app/components/avo/fields/trix_field/edit_component.html.erb +2 -2
- data/app/components/avo/filters_component.html.erb +8 -16
- data/app/components/avo/index/field_wrapper_component.html.erb +9 -2
- data/app/components/avo/index/field_wrapper_component.rb +0 -16
- data/app/components/avo/index/grid_cover_empty_state_component.html.erb +16 -2
- data/app/components/avo/index/grid_cover_empty_state_component.rb +90 -0
- data/app/components/avo/index/grid_item_component.html.erb +29 -12
- data/app/components/avo/index/grid_item_component.rb +12 -10
- data/app/components/avo/index/resource_controls_component.html.erb +1 -1
- data/app/components/avo/index/resource_controls_component.rb +7 -17
- data/app/components/avo/index/resource_controls_dropdown_component.html.erb +3 -0
- data/app/components/avo/index/resource_controls_dropdown_component.rb +81 -0
- data/app/components/avo/index/table_row_component.html.erb +11 -11
- data/app/components/avo/items/panel_component.html.erb +8 -18
- data/app/components/avo/items/panel_component.rb +0 -20
- data/app/components/avo/items/switcher_component.html.erb +60 -1
- data/app/components/avo/items/switcher_component.rb +10 -5
- data/app/components/avo/items/visible_items_component.html.erb +2 -1
- data/app/components/avo/items/visible_items_component.rb +1 -0
- data/app/components/avo/media_library/item_details_component.html.erb +2 -2
- data/app/components/avo/media_library/list_component.html.erb +24 -19
- data/app/components/avo/media_library/list_component.rb +2 -2
- data/app/components/avo/media_library/list_item_component.html.erb +3 -3
- data/app/components/avo/modal_component.html.erb +52 -20
- data/app/components/avo/modal_component.rb +7 -12
- data/app/components/avo/paginator_component.html.erb +46 -33
- data/app/components/avo/paginator_component.rb +10 -5
- data/app/components/avo/panel_name_component.html.erb +1 -1
- data/app/components/avo/profile_item_component.html.erb +4 -4
- data/app/components/avo/profile_item_component.rb +2 -4
- data/app/components/avo/referrer_params_component.html.erb +1 -1
- data/app/components/avo/resource_component.rb +8 -19
- data/app/components/avo/resource_listing_component.html.erb +22 -0
- data/app/components/avo/resource_listing_component.rb +28 -0
- data/app/components/avo/resource_sidebar_component.html.erb +2 -2
- data/app/components/avo/resource_sidebar_component.rb +0 -4
- data/app/components/avo/row_component.html.erb +1 -1
- data/app/components/avo/row_selector_component.html.erb +2 -4
- data/app/components/avo/row_selector_component.rb +0 -1
- data/app/components/avo/search_overlay_component.html.erb +6 -0
- data/app/components/avo/search_overlay_component.rb +2 -0
- data/app/components/avo/sidebar/base_item_component.rb +9 -9
- data/app/components/avo/sidebar/group_component.html.erb +23 -27
- data/app/components/avo/sidebar/group_component.rb +4 -0
- data/app/components/avo/sidebar/link_component.html.erb +30 -7
- data/app/components/avo/sidebar/link_component.rb +30 -2
- data/app/components/avo/sidebar/section_component.html.erb +31 -11
- data/app/components/avo/sidebar/section_component.rb +1 -3
- data/app/components/avo/sidebar_component.html.erb +35 -36
- data/app/components/avo/sidebar_component.rb +16 -0
- data/app/components/avo/sidebar_profile_component.html.erb +27 -36
- data/app/components/avo/sidebar_profile_component.rb +14 -0
- data/app/components/avo/tab_group_component.html.erb +21 -9
- data/app/components/avo/tab_group_component.rb +54 -15
- data/app/components/avo/turbo_frame_wrapper_component.html.erb +4 -8
- data/app/components/avo/turbo_frame_wrapper_component.rb +9 -0
- data/app/components/avo/u_i/avatar_component.html.erb +11 -0
- data/app/components/avo/u_i/avatar_component.rb +61 -0
- data/app/components/avo/u_i/badge_component.html.erb +9 -0
- data/app/components/avo/u_i/badge_component.rb +35 -0
- data/app/components/avo/u_i/card_component.html.erb +29 -0
- data/app/components/avo/u_i/card_component.rb +65 -0
- data/app/components/avo/u_i/dropdown_component.html.erb +14 -0
- data/app/components/avo/u_i/dropdown_component.rb +26 -0
- data/app/components/avo/u_i/dropdown_menu_component.html.erb +16 -0
- data/app/components/avo/u_i/dropdown_menu_component.rb +8 -0
- data/app/components/avo/u_i/file_upload_input_component.html.erb +26 -0
- data/app/components/avo/u_i/file_upload_input_component.rb +15 -0
- data/app/components/avo/u_i/file_upload_item_component.html.erb +48 -0
- data/app/components/avo/u_i/file_upload_item_component.rb +17 -0
- data/app/components/avo/u_i/icon_button_component.html.erb +7 -0
- data/app/components/avo/u_i/icon_button_component.rb +22 -0
- data/app/components/avo/u_i/panel_component.html.erb +49 -0
- data/app/components/avo/u_i/panel_component.rb +29 -0
- data/app/components/avo/u_i/panel_header_component.html.erb +37 -0
- data/app/components/avo/u_i/panel_header_component.rb +24 -0
- data/app/components/avo/u_i/search_input_component.html.erb +28 -0
- data/app/components/avo/u_i/search_input_component.rb +12 -0
- data/app/components/avo/u_i/tabs/tab_component.html.erb +26 -0
- data/app/components/avo/u_i/tabs/tab_component.rb +25 -0
- data/app/components/avo/u_i/tabs/tabs_component.html.erb +7 -0
- data/app/components/avo/u_i/tabs/tabs_component.rb +13 -0
- data/app/components/avo/view_types/base_view_type_component.rb +26 -0
- data/app/components/avo/view_types/grid_component.html.erb +18 -0
- data/app/components/avo/view_types/grid_component.rb +4 -0
- data/app/components/avo/view_types/map_component.html.erb +17 -0
- data/app/components/avo/view_types/map_component.rb +110 -0
- data/app/components/avo/view_types/table_component.html.erb +63 -0
- data/app/components/avo/{index/resource_table_component.rb → view_types/table_component.rb} +1 -10
- data/app/components/avo/views/resource_edit_component.html.erb +12 -18
- data/app/components/avo/views/resource_edit_component.rb +1 -27
- data/app/components/avo/views/resource_index_component.html.erb +97 -74
- data/app/components/avo/views/resource_index_component.rb +23 -3
- data/app/components/avo/views/resource_show_component.html.erb +4 -2
- data/app/components/avo/views/resource_show_component.rb +1 -4
- data/app/controllers/avo/associations_controller.rb +1 -1
- data/app/controllers/avo/base_application_controller.rb +7 -5
- data/app/controllers/avo/base_controller.rb +139 -40
- data/app/controllers/avo/debug_controller.rb +0 -29
- data/app/controllers/avo/media_library_controller.rb +17 -1
- data/app/controllers/avo/search_controller.rb +5 -0
- data/app/controllers/concerns/avo/initializes_avo.rb +7 -8
- data/app/helpers/avo/application_helper.rb +60 -46
- data/app/helpers/avo/turbo_stream_actions_helper.rb +10 -1
- data/app/helpers/avo/url_helpers.rb +3 -2
- data/app/javascript/{avo.base.js → application.js} +9 -18
- data/app/javascript/js/application.js +40 -0
- data/app/javascript/js/controllers/action_controller.js +4 -4
- data/app/javascript/js/controllers/actions_overflow_controller.js +21 -6
- data/app/javascript/js/controllers/color_scheme_switcher_controller.js +226 -0
- data/app/javascript/js/controllers/dropdown_menu_controller.js +42 -0
- data/app/javascript/js/controllers/fields/code_field_controller.js +20 -3
- data/app/javascript/js/controllers/fields/easy_mde_controller.js +23 -1
- data/app/javascript/js/controllers/fields/key_value_controller.js +43 -39
- data/app/javascript/js/controllers/fields/panel_refresh_controller.js +4 -0
- data/app/javascript/js/controllers/fields/tags_field_controller.js +2 -2
- data/app/javascript/js/controllers/fields/tags_field_helpers.js +4 -6
- data/app/javascript/js/controllers/grid_cover_empty_state_controller.js +42 -0
- data/app/javascript/js/controllers/item_selector_controller.js +0 -2
- data/app/javascript/js/controllers/loading_button_controller.js +1 -5
- data/app/javascript/js/controllers/map_dark_mode_controller.js +131 -0
- data/app/javascript/js/controllers/menu_controller.js +38 -16
- data/app/javascript/js/controllers/modal_controller.js +16 -0
- data/app/javascript/js/controllers/modal_size_controller.js +83 -0
- data/app/javascript/js/controllers/nested_form_controller.js +2 -2
- data/app/javascript/js/controllers/password_visibility_controller.js +13 -0
- data/app/javascript/js/controllers/preview_controller.js +2 -2
- data/app/javascript/js/controllers/resource_search_controller.js +123 -0
- data/app/javascript/js/controllers/search_controller.js +10 -29
- data/app/javascript/js/controllers/sidebar_controller.js +29 -9
- data/app/javascript/js/controllers/table_row_controller.js +28 -0
- data/app/javascript/js/controllers/tippy_controller.js +1 -1
- data/app/javascript/js/controllers/toggle_controller.js +40 -5
- data/app/javascript/js/controllers.js +14 -2
- data/app/javascript/js/custom-stream-actions.js +10 -8
- data/app/views/avo/actions/show.html.erb +14 -10
- data/app/views/avo/base/_boolean_filter.html.erb +1 -1
- data/app/views/avo/base/_date_time_filter.html.erb +3 -3
- data/app/views/avo/base/_multiple_select_filter.html.erb +1 -1
- data/app/views/avo/base/_new_via_belongs_to.html.erb +2 -3
- data/app/views/avo/base/_text_filter.html.erb +1 -1
- data/app/views/avo/base/preview.html.erb +5 -4
- data/app/views/avo/debug/status.html.erb +5 -92
- data/app/views/avo/debug/status.text.erb +0 -2
- data/app/views/avo/home/_actions.html.erb +1 -1
- data/app/views/avo/home/_dashboards.html.erb +1 -1
- data/app/views/avo/home/_filters.html.erb +1 -1
- data/app/views/avo/home/_resources.html.erb +2 -2
- data/app/views/avo/home/failed_to_load.html.erb +2 -2
- data/app/views/avo/home/index.html.erb +25 -25
- data/app/views/avo/media_library/_form.html.erb +43 -28
- data/app/views/avo/media_library/show.html.erb +7 -3
- data/app/views/avo/modal/_size_selector.html.erb +46 -0
- data/app/views/avo/partials/_alerts.html.erb +1 -1
- data/app/views/avo/partials/_color_scheme_switcher.html.erb +106 -0
- data/app/views/avo/partials/_color_theme_override.html.erb +49 -0
- data/app/views/avo/partials/_confirm_dialog.html.erb +19 -17
- data/app/views/avo/partials/_custom_tools_alert.html.erb +6 -6
- data/app/views/avo/partials/_footer.html.erb +1 -1
- data/app/views/avo/partials/_header.html.erb +1 -1
- data/app/views/avo/partials/_javascript.html.erb +0 -2
- data/app/views/avo/partials/_navbar.html.erb +53 -8
- data/app/views/avo/partials/_sortable_component.html.erb +1 -1
- data/app/views/avo/partials/_table_header.html.erb +28 -19
- data/app/views/avo/partials/_view_toggle_button.html.erb +6 -29
- data/app/views/avo/partials/distribution_chart.html.erb +2 -2
- data/app/views/avo/private/_links_and_buttons.html.erb +12 -8
- data/app/views/avo/private/design.html.erb +8 -4
- data/app/views/avo/sidebar/_license_warning.html.erb +3 -3
- data/app/views/layouts/avo/application.html.erb +39 -17
- data/app/views/layouts/avo/modal.html.erb +7 -0
- data/avo.gemspec +3 -4
- data/config/i18n-tasks.yml +1 -1
- data/config/importmap.rb +1 -0
- data/config/initializers/pagy.rb +5 -25
- data/config/routes/dynamic_routes.rb +4 -0
- data/config/routes.rb +6 -7
- data/db/factories.rb +14 -0
- data/lib/avo/asset_manager.rb +2 -0
- data/lib/avo/avatar.rb +7 -0
- data/lib/avo/base_action.rb +16 -4
- data/lib/avo/concerns/breadcrumbs.rb +7 -66
- data/lib/avo/concerns/form_builder.rb +41 -0
- data/lib/avo/concerns/{has_profile_photo.rb → has_avatar.rb} +8 -4
- data/lib/avo/concerns/{has_cover_photo.rb → has_cover.rb} +4 -4
- data/lib/avo/concerns/has_description.rb +9 -0
- data/lib/avo/concerns/has_item_type.rb +6 -2
- data/lib/avo/concerns/has_items.rb +43 -58
- data/lib/avo/concerns/pagination.rb +29 -19
- data/lib/avo/concerns/row_controls_configuration.rb +22 -15
- data/lib/avo/configuration/branding.rb +7 -7
- data/lib/avo/configuration.rb +92 -45
- data/lib/avo/{cover_photo.rb → cover.rb} +2 -2
- data/lib/avo/current.rb +0 -11
- data/lib/avo/discreet_information.rb +52 -29
- data/lib/avo/dsl/field_parser.rb +1 -1
- data/lib/avo/engine.rb +41 -8
- data/lib/avo/error_manager.rb +1 -1
- data/lib/avo/fields/avatar_field.rb +19 -0
- data/lib/avo/fields/badge_field.rb +23 -3
- data/lib/avo/fields/base_field.rb +46 -1
- data/lib/avo/fields/concerns/dom_id.rb +17 -0
- data/lib/avo/fields/concerns/file_authorization.rb +4 -0
- data/lib/avo/fields/concerns/has_html_attributes.rb +1 -1
- data/lib/avo/fields/concerns/is_searchable.rb +2 -5
- data/lib/avo/fields/concerns/nested.rb +1 -1
- data/lib/avo/fields/files_field.rb +2 -2
- data/lib/avo/fields/frame_base_field.rb +2 -2
- data/lib/avo/fields/id_field.rb +5 -1
- data/lib/avo/fields/progress_bar_field.rb +1 -1
- data/lib/avo/fields/text_field.rb +1 -1
- data/lib/avo/photo_object.rb +12 -1
- data/lib/avo/plugin_manager.rb +4 -0
- data/lib/avo/resources/base.rb +33 -21
- data/lib/avo/resources/controls/actions_list.rb +3 -3
- data/lib/avo/resources/controls/base_control.rb +1 -1
- data/lib/avo/resources/items/card.rb +16 -0
- data/lib/avo/resources/items/header.rb +11 -0
- data/lib/avo/resources/items/holder.rb +18 -23
- data/lib/avo/resources/items/item_group.rb +5 -7
- data/lib/avo/resources/items/sidebar.rb +5 -9
- data/lib/avo/resources/items/tab.rb +8 -8
- data/lib/avo/resources/items/tab_group.rb +8 -10
- data/lib/avo/resources/resource_manager.rb +2 -1
- data/lib/avo/services/hq_reporter.rb +102 -0
- data/lib/avo/services/telemetry_service.rb +0 -1
- data/lib/avo/test_helpers.rb +36 -22
- data/lib/avo/u_i_instance.rb +60 -0
- data/lib/avo/version.rb +1 -1
- data/lib/avo/view_inquirer.rb +6 -1
- data/lib/avo/view_types/view_type_manager.rb +70 -0
- data/lib/avo.rb +30 -45
- data/lib/generators/avo/action_generator.rb +1 -1
- data/lib/generators/avo/resource_generator.rb +43 -0
- data/lib/generators/avo/resource_tool_generator.rb +1 -1
- data/lib/generators/avo/tailwindcss/install_generator.rb +0 -6
- data/lib/generators/avo/templates/cards/partial_card_partial.tt +1 -1
- data/lib/generators/avo/templates/initializer/avo.tt +7 -9
- data/lib/generators/avo/templates/locales/avo.ar.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.de.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.en.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.es.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.fr.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.it.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.ja.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.nb.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.nl.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.nn.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.pl.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.pt-BR.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.pt.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.ro.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.ru.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.tr.yml +25 -0
- data/lib/generators/avo/templates/locales/{avo.uk.yml → avo.ua.yml} +26 -1
- data/lib/generators/avo/templates/locales/avo.zh-TW.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.zh.yml +25 -0
- data/lib/generators/avo/templates/resource/resource.tt +10 -1
- data/lib/generators/avo/templates/resource_tools/partial.tt +20 -22
- data/lib/generators/avo/templates/tailwindcss/avo.tailwind.css +1 -3
- data/lib/generators/avo/templates/tailwindcss/tailwind.config.js +0 -7
- data/lib/generators/avo/templates/tool/view.tt +14 -16
- data/lib/generators/avo/tool_generator.rb +3 -3
- data/lib/generators/avo/version_generator.rb +1 -1
- data/lib/tasks/avo_tasks.rake +29 -25
- metadata +145 -97
- data/app/assets/stylesheets/avo.base.css +0 -130
- data/app/assets/stylesheets/css/breadcrumbs.css +0 -16
- data/app/assets/stylesheets/css/buttons.css +0 -19
- data/app/assets/stylesheets/css/tailwindcss/base.css +0 -1
- data/app/assets/stylesheets/css/tailwindcss/components.css +0 -1
- data/app/assets/stylesheets/css/tailwindcss/utilities.css +0 -1
- data/app/assets/svgs/avo/arrow-down.svg +0 -3
- data/app/assets/svgs/avo/arrow-up.svg +0 -3
- data/app/assets/svgs/avo/detach.svg +0 -8
- data/app/assets/svgs/avo/download-solid-reversed.svg +0 -3
- data/app/assets/svgs/avo/download-solid.svg +0 -3
- data/app/assets/svgs/avo/edit.svg +0 -5
- data/app/assets/svgs/avo/editor-bold.svg +0 -1
- data/app/assets/svgs/avo/editor-italic.svg +0 -1
- data/app/assets/svgs/avo/editor-link.svg +0 -1
- data/app/assets/svgs/avo/editor-list.svg +0 -1
- data/app/assets/svgs/avo/editor-strike.svg +0 -1
- data/app/assets/svgs/avo/editor-underline.svg +0 -1
- data/app/assets/svgs/avo/eye.svg +0 -1
- data/app/assets/svgs/avo/trash-sm.svg +0 -3
- data/app/assets/svgs/avo/trash.svg +0 -7
- data/app/components/avo/cover_photo_component.html.erb +0 -3
- data/app/components/avo/cover_photo_component.rb +0 -19
- data/app/components/avo/fields/common/badge_viewer_component.html.erb +0 -1
- data/app/components/avo/fields/common/badge_viewer_component.rb +0 -33
- data/app/components/avo/index/resource_grid_component.html.erb +0 -23
- data/app/components/avo/index/resource_grid_component.rb +0 -10
- data/app/components/avo/index/resource_map_component.html.erb +0 -16
- data/app/components/avo/index/resource_map_component.rb +0 -114
- data/app/components/avo/index/resource_table_component.html.erb +0 -52
- data/app/components/avo/panel_component.html.erb +0 -63
- data/app/components/avo/panel_component.rb +0 -43
- data/app/components/avo/panel_header_component.html.erb +0 -42
- data/app/components/avo/panel_header_component.rb +0 -31
- data/app/components/avo/profile_photo_component.html.erb +0 -6
- data/app/components/avo/profile_photo_component.rb +0 -9
- data/app/components/avo/sidebar/heading_component.html.erb +0 -21
- data/app/components/avo/sidebar/heading_component.rb +0 -9
- data/app/components/avo/tab_switcher_component.html.erb +0 -20
- data/app/components/avo/tab_switcher_component.rb +0 -45
- data/app/views/avo/base/close_modal_and_reload_field.turbo_stream.erb +0 -8
- data/app/views/avo/debug/report.html.erb +0 -37
- data/app/views/avo/partials/_panel_breadcrumbs.html.erb +0 -3
- data/app/views/avo/partials/_resource_search.html.erb +0 -16
- data/lib/avo/licensing/community_license.rb +0 -6
- data/lib/avo/licensing/h_q.rb +0 -202
- data/lib/avo/licensing/license.rb +0 -76
- data/lib/avo/licensing/license_manager.rb +0 -24
- data/lib/avo/licensing/nil_license.rb +0 -14
- data/lib/avo/licensing/pro_license.rb +0 -20
- data/lib/avo/licensing/request.rb +0 -20
- data/lib/avo/profile_photo.rb +0 -7
- data/lib/avo/services/debug_service.rb +0 -107
- data/public/avo-assets/placeholder.svg +0 -1
- data/tailwind.preset.js +0 -171
- /data/{public/avo-assets → app/assets/images/avo}/favicon.ico +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/logo-on-white.png +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/logo.png +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/logomark.png +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= content_tag :div,
|
|
2
2
|
id: "#{self.class.to_s.underscore}_#{@resource.record_param}",
|
|
3
|
-
class: "
|
|
3
|
+
class: "grid-card",
|
|
4
4
|
data: {
|
|
5
5
|
component_name: self.class.to_s.underscore,
|
|
6
6
|
resource_name: @resource.class.to_s,
|
|
@@ -9,19 +9,36 @@
|
|
|
9
9
|
**(try(:drag_reorder_item_data_attributes) || {}),
|
|
10
10
|
} do %>
|
|
11
11
|
<%= content_tag :div,
|
|
12
|
-
class: class_names("
|
|
12
|
+
class: class_names("grid-card__image", html(:cover, :classes)),
|
|
13
13
|
style: html(:cover, :style) do %>
|
|
14
|
-
<%= render Avo::RowSelectorComponent.new(floating: true, size: :lg, checked: @grid_item_checked) if @resource.record_selector%>
|
|
15
14
|
<%= render_cover %>
|
|
16
|
-
<%=
|
|
15
|
+
<%= render Avo::RowSelectorComponent.new(checked: @grid_item_checked) if @resource.record_selector %>
|
|
17
16
|
<% end %>
|
|
18
|
-
<div class="grid
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
<div class="grid-card__actions-row">
|
|
18
|
+
<%= render_badge %>
|
|
19
|
+
<%= render Avo::UI::DropdownComponent.new do |component| %>
|
|
20
|
+
<% component.with_trigger do %>
|
|
21
|
+
<%= render Avo::ButtonComponent.new(
|
|
22
|
+
icon: "tabler/outline/dots-vertical",
|
|
23
|
+
size: :lg,
|
|
24
|
+
class: "grid-card__action",
|
|
25
|
+
data: {action: component.action}
|
|
26
|
+
) %>
|
|
27
|
+
<% end %>
|
|
28
|
+
<% component.with_items do %>
|
|
29
|
+
<%= render Avo::Index::ResourceControlsDropdownComponent.new(
|
|
30
|
+
resource: @resource,
|
|
31
|
+
reflection: @reflection,
|
|
32
|
+
parent_record: @parent_record,
|
|
33
|
+
parent_resource: @parent_resource,
|
|
34
|
+
view_type: :grid,
|
|
35
|
+
actions: @actions
|
|
36
|
+
) %>
|
|
37
|
+
<% end %>
|
|
38
|
+
<% end %>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="grid-card__content">
|
|
41
|
+
<%= render_title %>
|
|
42
|
+
<%= render_body %>
|
|
26
43
|
</div>
|
|
27
44
|
<% end %>
|
|
@@ -54,7 +54,7 @@ class Avo::Index::GridItemComponent < Avo::BaseComponent
|
|
|
54
54
|
def render_title
|
|
55
55
|
return if @card[:title].blank?
|
|
56
56
|
|
|
57
|
-
content_tag :div, class: "grid
|
|
57
|
+
content_tag :div, class: "grid-card__title #{html(:title, :classes)}", style: html(:title, :style) do
|
|
58
58
|
link_to @card[:title], resource_view_path
|
|
59
59
|
end
|
|
60
60
|
end
|
|
@@ -62,24 +62,26 @@ class Avo::Index::GridItemComponent < Avo::BaseComponent
|
|
|
62
62
|
def render_body
|
|
63
63
|
return if @card[:body].blank?
|
|
64
64
|
|
|
65
|
-
content_tag :div, class: "
|
|
65
|
+
content_tag :div, class: "grid-card__description #{html(:body, :classes)}", style: html(:body, :style) do
|
|
66
66
|
@card[:body]
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def render_badge
|
|
71
|
-
return if @card[:
|
|
71
|
+
return if @card[:badge].blank? || (@card[:badge][:label].blank? && @card[:badge][:icon].blank?)
|
|
72
72
|
|
|
73
|
+
# Wrap BadgeComponent in positioned container to maintain absolute positioning
|
|
73
74
|
content_tag :div,
|
|
74
|
-
class: class_names("
|
|
75
|
-
title: @card[:
|
|
75
|
+
class: class_names("grid-card__badge", html(:badge, :classes)),
|
|
76
|
+
title: @card[:badge][:title],
|
|
76
77
|
style: html(:badge, :style),
|
|
77
78
|
data: {target: :badge, tippy: :tooltip, **(html(:badge, :data).presence || {})} do
|
|
78
|
-
|
|
79
|
+
render Avo::UI::BadgeComponent.new(
|
|
80
|
+
label: @card[:badge][:label],
|
|
81
|
+
color: @card[:badge][:color],
|
|
82
|
+
style: @card[:badge][:style],
|
|
83
|
+
icon: @card[:badge][:icon]
|
|
84
|
+
)
|
|
79
85
|
end
|
|
80
86
|
end
|
|
81
|
-
|
|
82
|
-
def badge_color
|
|
83
|
-
@card[:badge_color] || "gray"
|
|
84
|
-
end
|
|
85
87
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%= content_tag :div, class: "
|
|
1
|
+
<%= content_tag :div, class: class_names("resource-controls flex flex-row justify-evenly items-center ms-2 has-record-selector:ms-0", {"flex-wrap": view_type == "grid", "gap-x-2": view_type != "grid"}) do %>
|
|
2
2
|
<% @resource.render_row_controls(item: singular_resource_name).each do |control| %>
|
|
3
3
|
<%= render_control control %>
|
|
4
4
|
<% end %>
|
|
@@ -74,7 +74,7 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
|
|
|
74
74
|
def render_edit_button(control)
|
|
75
75
|
return unless can_edit?
|
|
76
76
|
|
|
77
|
-
link_to helpers.svg("
|
|
77
|
+
link_to helpers.svg("tabler/outline/edit", class: svg_classes),
|
|
78
78
|
edit_path,
|
|
79
79
|
class: "flex items-center",
|
|
80
80
|
title: control.title,
|
|
@@ -90,7 +90,7 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
|
|
|
90
90
|
def render_show_button(control)
|
|
91
91
|
return unless can_view?
|
|
92
92
|
|
|
93
|
-
link_to helpers.svg("
|
|
93
|
+
link_to helpers.svg("tabler/outline/eye", class: svg_classes),
|
|
94
94
|
show_path,
|
|
95
95
|
class: "flex items-center",
|
|
96
96
|
title: control.title,
|
|
@@ -110,15 +110,10 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
|
|
|
110
110
|
policy_method = is_a_related_resource? ? :can_delete? : :can_see_the_destroy_button?
|
|
111
111
|
return unless send policy_method
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
color: :gray,
|
|
116
|
-
icon: "avo/trash",
|
|
117
|
-
form_class: "flex flex-col sm:flex-row sm:inline-flex",
|
|
113
|
+
link_to svg("tabler/outline/trash", class: svg_classes), helpers.resource_path(record: @resource.record, resource: @resource, **hidden_params),
|
|
114
|
+
class: "flex flex-col sm:flex-row sm:inline-flex",
|
|
118
115
|
title: control.title,
|
|
119
116
|
aria: {label: control.title},
|
|
120
|
-
method: :delete,
|
|
121
|
-
params: hidden_params,
|
|
122
117
|
data: {
|
|
123
118
|
turbo_frame: params[:turbo_frame],
|
|
124
119
|
turbo_confirm: control.confirmation_message,
|
|
@@ -133,16 +128,11 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
|
|
|
133
128
|
def render_detach_button(control)
|
|
134
129
|
return unless can_detach?
|
|
135
130
|
|
|
136
|
-
|
|
137
|
-
style: :icon,
|
|
138
|
-
color: :gray,
|
|
139
|
-
icon: "avo/detach",
|
|
140
|
-
form_class: "flex items-center",
|
|
131
|
+
link_to svg("tabler/outline/unlink", class: svg_classes), helpers.resource_detach_path(params[:resource_name], params[:id], params[:related_name], @resource.record_param, **hidden_params),
|
|
141
132
|
title: control.title,
|
|
142
133
|
aria: {label: control.title},
|
|
143
|
-
method: :delete,
|
|
144
|
-
params: hidden_params,
|
|
145
134
|
data: {
|
|
135
|
+
turbo_method: :delete,
|
|
146
136
|
turbo_frame: params[:turbo_frame],
|
|
147
137
|
turbo_confirm: control.confirmation_message,
|
|
148
138
|
target: "control:detach",
|
|
@@ -159,7 +149,7 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
|
|
|
159
149
|
end
|
|
160
150
|
|
|
161
151
|
def svg_classes
|
|
162
|
-
"
|
|
152
|
+
"h-6"
|
|
163
153
|
end
|
|
164
154
|
|
|
165
155
|
def hidden_params
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Avo::Index::ResourceControlsDropdownComponent < Avo::Index::ResourceControlsComponent
|
|
4
|
+
private
|
|
5
|
+
|
|
6
|
+
def detach_path
|
|
7
|
+
helpers.resource_detach_path(params[:resource_name], params[:id], params[:related_name], @resource.record_param, **hidden_params)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def delete_path
|
|
11
|
+
helpers.resource_path(record: @resource.record, resource: @resource, **hidden_params)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def render_edit_button(control)
|
|
15
|
+
return unless can_edit?
|
|
16
|
+
|
|
17
|
+
link_to edit_path, **control_link_options(control, target: "edit", control_key: :edit) do
|
|
18
|
+
concat svg("tabler/outline/edit")
|
|
19
|
+
concat control_title_without_resource(control.title)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def render_show_button(control)
|
|
24
|
+
return unless can_view?
|
|
25
|
+
|
|
26
|
+
link_to show_path, **control_link_options(control, target: "view", control_key: :show, include_resource_id: false) do
|
|
27
|
+
concat svg("tabler/outline/eye")
|
|
28
|
+
concat control_title_without_resource(control.title)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def render_delete_button(control)
|
|
33
|
+
return unless destroy_permitted?
|
|
34
|
+
|
|
35
|
+
link_to delete_path, **control_link_options(control, target: "destroy", control_key: :destroy,
|
|
36
|
+
turbo_frame: params[:turbo_frame],
|
|
37
|
+
turbo_confirm: control.confirmation_message,
|
|
38
|
+
turbo_method: :delete) do
|
|
39
|
+
concat svg("tabler/outline/trash")
|
|
40
|
+
concat control_title_without_resource(control.title)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def render_detach_button(control)
|
|
45
|
+
return unless can_detach?
|
|
46
|
+
|
|
47
|
+
link_to detach_path, **control_link_options(control, target: "detach", control_key: :detach,
|
|
48
|
+
turbo_frame: params[:turbo_frame],
|
|
49
|
+
turbo_confirm: control.confirmation_message,
|
|
50
|
+
turbo_method: :delete) do
|
|
51
|
+
concat svg("tabler/outline/unlink")
|
|
52
|
+
concat control_title_without_resource(control.title)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def control_link_options(control, target:, control_key:, include_resource_id: true, **extra_data)
|
|
57
|
+
data = {
|
|
58
|
+
target: "control:#{target}",
|
|
59
|
+
control: control_key,
|
|
60
|
+
}
|
|
61
|
+
data["resource-id"] = @resource.record_param if include_resource_id
|
|
62
|
+
data.merge!(extra_data)
|
|
63
|
+
|
|
64
|
+
{
|
|
65
|
+
aria: {label: control.title},
|
|
66
|
+
title: control.title,
|
|
67
|
+
data: data,
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def destroy_permitted?
|
|
72
|
+
# Related resources use can_delete? (authorize_association_for :destroy); index uses can_see_the_destroy_button?
|
|
73
|
+
policy_method = is_a_related_resource? ? :can_delete? : :can_see_the_destroy_button?
|
|
74
|
+
send(policy_method)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def control_title_without_resource(title)
|
|
78
|
+
resource_name = singular_resource_name.humanize
|
|
79
|
+
title.gsub(/\b#{Regexp.escape(resource_name)}\b/i, "").strip
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
<%# hover:z-[21] removed from tr class to solve flickering actions component on row controls and z-20 changed to z-21%>
|
|
1
|
+
<%# hover:z-[21] removed from tr class to solve flickering actions component on row controls and z-20 changed to z-21 %>
|
|
2
2
|
|
|
3
3
|
<%= content_tag :tr,
|
|
4
4
|
id: "#{self.class.to_s.underscore}_#{@resource.record_param}",
|
|
5
|
-
class: class_names("
|
|
5
|
+
class: class_names("table-row group z-21", {"cursor-pointer": click_row_to_view_record}),
|
|
6
6
|
data: {
|
|
7
7
|
index: @index,
|
|
8
|
-
component_name
|
|
8
|
+
component_name:,
|
|
9
9
|
resource_name: @resource.class.to_s,
|
|
10
10
|
record_id: @resource.record_param,
|
|
11
11
|
**(click_row_to_view_record ? {
|
|
12
12
|
visit_path: helpers.resource_show_path(resource: @resource, parent_resource: @parent_resource, parent_record: @parent_record, parent_or_child_resource:),
|
|
13
|
-
action: "click->table-row#visitRecord keydown.enter->table-row#visitRecord keydown.space->table-row#visitRecord"
|
|
13
|
+
action: "click->table-row#visitRecord keydown.enter->table-row#visitRecord keydown.space->table-row#visitRecord mouseenter->table-row#mouseEntered mouseleave->table-row#mouseLeft"
|
|
14
14
|
} : {}),
|
|
15
15
|
**item_selector_data_attributes(@resource, controller: class_names("table-row": click_row_to_view_record)),
|
|
16
16
|
**(try(:drag_reorder_item_data_attributes) || {}),
|
|
17
17
|
} do %>
|
|
18
18
|
<% if @resource.record_selector %>
|
|
19
19
|
<td class="item-selector-cell w-10">
|
|
20
|
-
<div class="flex justify-center
|
|
20
|
+
<div class="flex h-full justify-center">
|
|
21
21
|
<%= render Avo::RowSelectorComponent.new floating: false, index: @index, checked: @row_selector_checked %>
|
|
22
22
|
</div>
|
|
23
23
|
</td>
|
|
24
24
|
<% end %>
|
|
25
|
+
|
|
25
26
|
<% if @resource.render_row_controls_on_the_left? %>
|
|
26
27
|
<td class="<%= @resource.row_controls_classes %>" data-control="resource-controls">
|
|
27
|
-
<div class="flex items-center justify-end
|
|
28
|
-
<%= render resource_controls_component %>
|
|
29
|
-
</div>
|
|
28
|
+
<div class="flex h-full grow-0 items-center justify-end"><%= render resource_controls_component %></div>
|
|
30
29
|
</td>
|
|
31
30
|
<% end %>
|
|
31
|
+
|
|
32
32
|
<% @header_fields.each_with_index do |table_header_lable, index| %>
|
|
33
33
|
<% field = @fields.find { |field| field.table_header_label == table_header_lable } %>
|
|
34
|
+
|
|
34
35
|
<% if field.present? %>
|
|
35
36
|
<%= render field.component_for_view(:index).new(
|
|
36
37
|
field: field,
|
|
@@ -44,11 +45,10 @@
|
|
|
44
45
|
<td class="px-3">—</td>
|
|
45
46
|
<% end %>
|
|
46
47
|
<% end %>
|
|
48
|
+
|
|
47
49
|
<% if @resource.render_row_controls_on_the_right? %>
|
|
48
50
|
<td class="<%= @resource.row_controls_classes %>" data-control="resource-controls">
|
|
49
|
-
<div class="flex items-center justify-end
|
|
50
|
-
<%= render resource_controls_component %>
|
|
51
|
-
</div>
|
|
51
|
+
<div class="flex h-full grow-0 items-center justify-end"><%= render resource_controls_component %></div>
|
|
52
52
|
</td>
|
|
53
53
|
<% end %>
|
|
54
54
|
<% end %>
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
<%= render
|
|
2
|
-
<%
|
|
3
|
-
|
|
4
|
-
<% controls.each do |control| %>
|
|
5
|
-
<%= render_control control %>
|
|
6
|
-
<% end %>
|
|
7
|
-
<% end %>
|
|
8
|
-
<% end %>
|
|
9
|
-
<% c.with_body do %>
|
|
10
|
-
<% content_tag :div, class: "divide-y overflow-auto" do %>
|
|
11
|
-
<%= render Avo::Items::VisibleItemsComponent.new resource: @resource, item: @item, view: @view, form: @form, reflection: @reflection %>
|
|
12
|
-
<% end %>
|
|
1
|
+
<%= render ui.panel(title: @item.title, description: @item.description, index: @index) do |panel| %>
|
|
2
|
+
<% panel.with_body do %>
|
|
3
|
+
<%= render Avo::Items::VisibleItemsComponent.new resource: @resource, item: @item, view: @view, form: @form, parent_component: @parent_component, reflection: @reflection %>
|
|
13
4
|
<% end %>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
|
|
6
|
+
<% if sidebars.any? { |sidebar| sidebar.visible_items.any? } %>
|
|
7
|
+
<% panel.with_sidebar do %>
|
|
8
|
+
<div class="justify-between space-y-4 w-full">
|
|
17
9
|
<% sidebars.each_with_index do |sidebar, index| %>
|
|
18
|
-
|
|
19
|
-
<%= render Avo::ResourceSidebarComponent.new resource: @resource, sidebar: sidebar, params: params, view: view, form: @form, index: index %>
|
|
20
|
-
</div>
|
|
10
|
+
<%= render Avo::ResourceSidebarComponent.new resource: @resource, sidebar: sidebar, params: params, view: view, form: @form, index: index %>
|
|
21
11
|
<% end %>
|
|
22
12
|
</div>
|
|
23
13
|
<% end %>
|
|
@@ -5,7 +5,6 @@ class Avo::Items::PanelComponent < Avo::ResourceComponent
|
|
|
5
5
|
|
|
6
6
|
prop :form
|
|
7
7
|
prop :item
|
|
8
|
-
prop :is_main_panel
|
|
9
8
|
prop :resource
|
|
10
9
|
prop :view
|
|
11
10
|
prop :actions, reader: :public
|
|
@@ -21,24 +20,5 @@ class Avo::Items::PanelComponent < Avo::ResourceComponent
|
|
|
21
20
|
:edit_path,
|
|
22
21
|
:can_see_the_destroy_button?,
|
|
23
22
|
:can_see_the_save_button?,
|
|
24
|
-
:display_breadcrumbs,
|
|
25
23
|
to: :@parent_component
|
|
26
|
-
|
|
27
|
-
def args
|
|
28
|
-
if @is_main_panel
|
|
29
|
-
{
|
|
30
|
-
name: title,
|
|
31
|
-
description: @resource.description,
|
|
32
|
-
display_breadcrumbs: display_breadcrumbs,
|
|
33
|
-
index: 0,
|
|
34
|
-
data: {panel_id: "main"},
|
|
35
|
-
cover_photo: @resource.cover_photo,
|
|
36
|
-
profile_photo: @resource.profile_photo,
|
|
37
|
-
external_link: @resource.get_external_link,
|
|
38
|
-
discreet_information: @resource.discreet_information
|
|
39
|
-
}
|
|
40
|
-
else
|
|
41
|
-
{name: @item.name, description: @item.description, index: @index}
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
24
|
end
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
<% if item.is_panel?
|
|
1
|
+
<% if item.is_panel? %>
|
|
2
2
|
<%= render panel_component %>
|
|
3
|
+
<% elsif item.is_card? %>
|
|
4
|
+
<%= render Avo::UI::CardComponent.new(
|
|
5
|
+
title: item.title,
|
|
6
|
+
description: item.description,
|
|
7
|
+
index:
|
|
8
|
+
) do |card| %>
|
|
9
|
+
<% card.with_body do %>
|
|
10
|
+
<%= render ui.description_list do %>
|
|
11
|
+
<%= render Avo::Items::VisibleItemsComponent.new resource: @resource, item: item, view: @view, form: @form, field_component_extra_args: @field_component_extra_args, reflection: @reflection %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<% end %>
|
|
14
|
+
<% end %>
|
|
3
15
|
<% elsif item.is_tool? %>
|
|
4
16
|
<% if item&.partial.present? %>
|
|
5
17
|
<%= render item.partial, tool: item, form: @form %>
|
|
@@ -16,4 +28,51 @@
|
|
|
16
28
|
<% end %>
|
|
17
29
|
<% elsif item.is_collaboration? %>
|
|
18
30
|
<%= render Avo::Collaborate::TimelineComponent.new(resource: @resource) %>
|
|
31
|
+
<% elsif item.is_header? %>
|
|
32
|
+
<% if @resource.cover.present? && @resource.cover.visible_in_current_view? %>
|
|
33
|
+
<%= render Avo::CoverComponent.new cover: @resource.cover %>
|
|
34
|
+
<% end %>
|
|
35
|
+
|
|
36
|
+
<%= render ui.panel_header(title:, description: @resource.description, index:) do |header| %>
|
|
37
|
+
<% header.with_controls do %>
|
|
38
|
+
<% controls.each do |control| %>
|
|
39
|
+
<%= render_control control %>
|
|
40
|
+
<% end %>
|
|
41
|
+
<% end %>
|
|
42
|
+
|
|
43
|
+
<% if @resource.avatar.present? %>
|
|
44
|
+
<% header.with_avatar do %>
|
|
45
|
+
<%= render Avo::UI::AvatarComponent.new src: helpers.main_app.url_for(@resource.avatar.value), shape: :square, type: :avatar %>
|
|
46
|
+
<% end %>
|
|
47
|
+
<% end %>
|
|
48
|
+
|
|
49
|
+
<% if Rails.env.development? %>
|
|
50
|
+
<% header.with_title_slot do %>
|
|
51
|
+
<%= render Avo::DiscreetInformationComponent.new(
|
|
52
|
+
as: :icon,
|
|
53
|
+
title: t('avo.open_in_your_editor'),
|
|
54
|
+
url: helpers.editor_file_path(@resource),
|
|
55
|
+
icon: "tabler/outline/code"
|
|
56
|
+
) %>
|
|
57
|
+
<% end %>
|
|
58
|
+
<% end %>
|
|
59
|
+
|
|
60
|
+
<% if @resource.get_external_link.present? || @resource.discreet_information.items.any? %>
|
|
61
|
+
<% header.with_discreet_information do %>
|
|
62
|
+
<% if @resource.get_external_link.present? %>
|
|
63
|
+
<%= render Avo::DiscreetInformationComponent.new(
|
|
64
|
+
as: :icon,
|
|
65
|
+
url: @resource.get_external_link,
|
|
66
|
+
target: :_blank,
|
|
67
|
+
title: helpers.t("avo.visit_record_on_external_path"),
|
|
68
|
+
icon: "tabler/outline/external-link"
|
|
69
|
+
) %>
|
|
70
|
+
<% end %>
|
|
71
|
+
|
|
72
|
+
<% @resource.discreet_information.items.each do |item| %>
|
|
73
|
+
<%= render Avo::DiscreetInformationComponent.new(**item) %>
|
|
74
|
+
<% end %>
|
|
75
|
+
<% end %>
|
|
76
|
+
<% end %>
|
|
77
|
+
<% end %>
|
|
19
78
|
<% end %>
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
class Avo::Items::SwitcherComponent < Avo::
|
|
4
|
-
include Turbo::FramesHelper
|
|
5
|
-
|
|
3
|
+
class Avo::Items::SwitcherComponent < Avo::ResourceComponent
|
|
6
4
|
attr_reader :resource
|
|
7
5
|
attr_reader :reflection
|
|
8
6
|
attr_reader :index
|
|
9
7
|
attr_reader :item
|
|
10
8
|
attr_reader :view
|
|
11
9
|
|
|
10
|
+
delegate :controls,
|
|
11
|
+
:title,
|
|
12
|
+
:back_path,
|
|
13
|
+
:edit_path,
|
|
14
|
+
:can_see_the_destroy_button?,
|
|
15
|
+
:can_see_the_save_button?,
|
|
16
|
+
to: :@parent_component
|
|
17
|
+
|
|
12
18
|
def initialize(
|
|
13
19
|
resource: nil,
|
|
14
20
|
reflection: nil,
|
|
@@ -64,7 +70,7 @@ class Avo::Items::SwitcherComponent < Avo::BaseComponent
|
|
|
64
70
|
end
|
|
65
71
|
|
|
66
72
|
def field_component
|
|
67
|
-
final_item = item.dup.hydrate(resource: @resource, record: @resource.record, user: resource.user, view: view)
|
|
73
|
+
final_item = item.dup.hydrate(resource: @resource, record: @resource.record || item.record, user: resource.user, view: view)
|
|
68
74
|
final_item.component_for_view(@view).new(field: final_item, resource: @resource, index: index, form: form, view: @view, turbo_frame_loading: :lazy, **@field_component_extra_args)
|
|
69
75
|
end
|
|
70
76
|
|
|
@@ -73,7 +79,6 @@ class Avo::Items::SwitcherComponent < Avo::BaseComponent
|
|
|
73
79
|
actions: @actions,
|
|
74
80
|
form: form,
|
|
75
81
|
index: index,
|
|
76
|
-
is_main_panel: item.is_main_panel?,
|
|
77
82
|
item: item.hydrate(view: view),
|
|
78
83
|
parent_component: @parent_component,
|
|
79
84
|
parent_record: @parent_record,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="relative flex flex-col w-full max @container/details">
|
|
2
2
|
<%= link_to helpers.svg('heroicons/outline/x-mark', class: "size-6"), helpers.avo.media_library_index_path,
|
|
3
|
-
class: "absolute z-10 inset-auto
|
|
3
|
+
class: "absolute z-10 inset-auto end-0 top-0 mt-2 me-2 block bg-white p-1 rounded-lg text-slate-600 hover:text-slate-900",
|
|
4
4
|
title: t('avo.close'),
|
|
5
5
|
data: {
|
|
6
6
|
tippy: :tooltip,
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<%= link_to "Delete", helpers.avo.media_library_path(@blob), class: "text-red-500", data: {turbo_confirm: "Are you sure you want to destroy this attachment?", turbo_method: :delete} %>
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
|
-
<div class="flex flex-col w-1/2 @3xl/details:w-1/3 border-
|
|
27
|
+
<div class="flex flex-col w-1/2 @3xl/details:w-1/3 border-s border-gray-200">
|
|
28
28
|
<%= render partial: "avo/media_library/information", locals: {blob: @blob} %>
|
|
29
29
|
<%= render partial: "avo/media_library/form", locals: {blob: @blob} %>
|
|
30
30
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<%= render
|
|
1
|
+
<%= render ui.panel(title: t("avo.media_library.title"),
|
|
2
2
|
data: {
|
|
3
3
|
controller: 'media-library',
|
|
4
4
|
media_library_controller_selector_value: params[:controller_selector],
|
|
5
5
|
media_library_controller_name_value: params[:controller_name],
|
|
6
6
|
media_library_item_details_frame_id_value: ::Avo::MEDIA_LIBRARY_ITEM_DETAILS_FRAME_ID,
|
|
7
|
-
} do |
|
|
8
|
-
<%=
|
|
7
|
+
}) do |panel| %>
|
|
8
|
+
<%= panel.with_controls do %>
|
|
9
9
|
<% if false && @attaching %>
|
|
10
10
|
<%= a_button data: {
|
|
11
11
|
action: 'click->media-library#selectItems',
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
<% end %>
|
|
15
15
|
<% end %>
|
|
16
16
|
<% end %>
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
<% panel.with_body do %>
|
|
18
19
|
<% if !@attaching %>
|
|
19
20
|
<%= content_tag :div, class: "p-4 pb-0",
|
|
20
21
|
data: {
|
|
@@ -27,8 +28,7 @@
|
|
|
27
28
|
media_library_attach_target: 'dropzone',
|
|
28
29
|
action: 'click->media-library-attach#triggerFileBrowser',
|
|
29
30
|
} do %>
|
|
30
|
-
<%= helpers.svg 'heroicons/outline/cloud-arrow-up', class: 'size-6 text-gray-400' %>
|
|
31
|
-
Upload a file
|
|
31
|
+
<%= helpers.svg 'heroicons/outline/cloud-arrow-up', class: 'size-6 text-gray-400' %> Upload a file
|
|
32
32
|
<small>Click to browse or drag and drop</small>
|
|
33
33
|
<% end %>
|
|
34
34
|
|
|
@@ -38,23 +38,28 @@
|
|
|
38
38
|
} %>
|
|
39
39
|
<% end %>
|
|
40
40
|
<% end %>
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
|
|
42
|
+
<div class="@container/index grid min-h-24 grow-0 gap-x-4" style="grid-template-areas: 'stack';">
|
|
43
|
+
<div
|
|
44
|
+
class="
|
|
45
|
+
grid min-h-0 min-w-0 auto-rows-max grid-cols-1 gap-4 p-4 @sm/index:grid-cols-2 @lg/index:grid-cols-3
|
|
46
|
+
@3xl/index:grid-cols-4 @5xl/index:grid-cols-6
|
|
47
|
+
"
|
|
48
|
+
style="grid-area: stack;"
|
|
49
|
+
>
|
|
43
50
|
<%= render Avo::MediaLibrary::ListItemComponent.with_collection(@blobs, attaching: @attaching, multiple: @attaching) %>
|
|
44
51
|
</div>
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
|
|
53
|
+
<%# TODO: fix the extra margin %>
|
|
54
|
+
<%= helpers.turbo_frame_tag ::Avo::MEDIA_LIBRARY_ITEM_DETAILS_FRAME_ID, class: 'relative empty:hidden bg-white inset-0 w-full h-full block empty:-ms-4 max-h-full', style: 'grid-area: stack;' %>
|
|
47
55
|
</div>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
|
|
57
|
+
<div class="mt-4 flex w-full flex-1">
|
|
58
|
+
<div class="w-full flex-2 space-y-2 text-center sm:flex sm:items-center sm:justify-between sm:space-y-0 sm:text-start">
|
|
59
|
+
<div class="me-4 text-sm text-slate-600"><%== @pagy.info_tag %></div>
|
|
60
|
+
|
|
53
61
|
<% if @pagy.pages > 1 %>
|
|
54
|
-
|
|
55
|
-
<%# https://github.com/ddnexus/pagy/blob/d70e443872a5b18da4e482454b3c8b4a1c86cb6b/gem/lib/pagy/extras/calendar.rb#L47 %>
|
|
56
|
-
<%#== helpers.pagy_nav(@pagy, xanchor_string: "data-turbo-frame=\"#{@turbo_frame}\"") %>
|
|
57
|
-
<%== helpers.pagy_nav(@pagy) %>
|
|
62
|
+
<%== @pagy.series_nav %>
|
|
58
63
|
<% end %>
|
|
59
64
|
</div>
|
|
60
65
|
</div>
|
|
@@ -4,11 +4,11 @@ module Avo
|
|
|
4
4
|
module MediaLibrary
|
|
5
5
|
class ListComponent < Avo::BaseComponent
|
|
6
6
|
include Avo::ApplicationHelper
|
|
7
|
-
include Pagy::
|
|
7
|
+
include Pagy::Method
|
|
8
8
|
|
|
9
9
|
def initialize(attaching: false, turbo_frame: nil)
|
|
10
10
|
@attaching = attaching
|
|
11
|
-
@pagy, @blobs = pagy(query, limit:)
|
|
11
|
+
@pagy, @blobs = pagy(:offset, query, limit:)
|
|
12
12
|
turbo_frame ||= params[:turbo_frame]
|
|
13
13
|
@turbo_frame = turbo_frame.present? ? CGI.escapeHTML(turbo_frame.to_s) : :_top
|
|
14
14
|
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<%= link_to helpers.avo.media_library_path(blob),
|
|
2
2
|
id: dom_id(blob),
|
|
3
|
-
class: "relative group min-h-full max-w-full flex-1 flex flex-col justify-between gap-2 border border-slate-200 p-1.5 rounded-xl hover:border-blue-500 hover:outline data-[selected=true]:border-blue-500 data-[selected=true]:outline outline-
|
|
3
|
+
class: "relative group min-h-full max-w-full flex-1 flex flex-col justify-between gap-2 border border-slate-200 p-1.5 rounded-xl hover:border-blue-500 hover:outline data-[selected=true]:border-blue-500 data-[selected=true]:outline outline-blue-500",
|
|
4
4
|
data: do %>
|
|
5
5
|
<% if false && @attaching %>
|
|
6
|
-
<div class="absolute bg-blue-500 group-hover:opacity-100 group-data-[selected=true]:opacity-100 opacity-0 inset-auto
|
|
6
|
+
<div class="absolute bg-blue-500 group-hover:opacity-100 group-data-[selected=true]:opacity-100 opacity-0 inset-auto start-0 top-0 text-white rounded-ss-xl rounded-ee-xl -ms-px -mt-px p-2"><div class="border border-white"><%= helpers.svg "heroicons/outline/check", class: 'group-data-[selected=true]:opacity-100 opacity-0 size-4' %></div></div>
|
|
7
7
|
<% end %>
|
|
8
8
|
<div class="flex flex-col h-full aspect-video overflow-hidden rounded-lg justify-center items-center">
|
|
9
9
|
<% if blob.image? %>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
<% end %>
|
|
20
20
|
</div>
|
|
21
|
-
<div class="flex space-x-2 mb-1">
|
|
21
|
+
<div class="flex space-x-2 rtl:space-x-reverse mb-1">
|
|
22
22
|
<% if @display_filename %>
|
|
23
23
|
<span class="text-gray-500 group-hover:text-blue-700 mt-1 text-sm truncate" title="<%= blob.filename %>"><%= blob.filename %></span>
|
|
24
24
|
<% end %>
|