Class: SolidusAdmin::Properties::Index::Component
- Inherits:
-
UI::Pages::Index::Component
- Object
- UI::Pages::Index::Component
- SolidusAdmin::Properties::Index::Component
- Defined in:
- app/components/solidus_admin/properties/index/component.rb
Instance Method Summary collapse
- #batch_actions ⇒ Object
- #columns ⇒ Object
- #edit_path(property) ⇒ Object
- #model_class ⇒ Object
- #name_column ⇒ Object
- #page_actions ⇒ Object
- #presentation_column ⇒ Object
- #search_key ⇒ Object
- #search_url ⇒ Object
- #title ⇒ Object
- #turbo_frames ⇒ Object
Instance Method Details
#batch_actions ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 38 def batch_actions [ { label: t('.batch_actions.delete'), action: solidus_admin.properties_path(**search_filter_params), method: :delete, icon: 'delete-bin-7-line', }, ] end |
#columns ⇒ Object
49 50 51 52 53 54 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 49 def columns [ name_column, presentation_column, ] end |
#edit_path(property) ⇒ Object
20 21 22 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 20 def edit_path(property) solidus_admin.edit_property_path(property, **search_filter_params) end |
#model_class ⇒ Object
4 5 6 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 4 def model_class Spree::Property end |
#name_column ⇒ Object
56 57 58 59 60 61 62 63 64 65 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 56 def name_column { header: :name, data: ->(property) do link_to property.name, edit_path(property), data: { turbo_frame: :resource_modal }, class: 'body-link' end } end |
#page_actions ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 28 def page_actions render component("ui/button").new( tag: :a, text: t('.add'), href: solidus_admin.new_property_path(**search_filter_params), data: { turbo_frame: :resource_modal }, icon: "add-line", ) end |
#presentation_column ⇒ Object
67 68 69 70 71 72 73 74 75 76 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 67 def presentation_column { header: :presentation, data: ->(property) do link_to property.presentation, edit_path(property), data: { turbo_frame: :resource_modal }, class: 'body-link' end } end |
#search_key ⇒ Object
12 13 14 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 12 def search_key :name_cont end |
#search_url ⇒ Object
16 17 18 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 16 def search_url solidus_admin.properties_path end |
#title ⇒ Object
8 9 10 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 8 def title t('solidus_admin.properties.title') end |
#turbo_frames ⇒ Object
24 25 26 |
# File 'app/components/solidus_admin/properties/index/component.rb', line 24 def turbo_frames %w[resource_modal] end |