Class: SolidusAdmin::OptionTypes::Index::Component
- Inherits:
-
UI::Pages::Index::Component
- Object
- UI::Pages::Index::Component
- SolidusAdmin::OptionTypes::Index::Component
- Defined in:
- app/components/solidus_admin/option_types/index/component.rb
Instance Method Summary collapse
- #batch_actions ⇒ Object
- #columns ⇒ Object
- #model_class ⇒ Object
- #name_column ⇒ Object
- #next_page_path ⇒ Object
- #page_actions ⇒ Object
- #presentation_column ⇒ Object
- #prev_page_path ⇒ Object
- #row_url(option_type) ⇒ Object
- #sortable_options ⇒ Object
Instance Method Details
#batch_actions ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 36 def batch_actions [ { label: t('.batch_actions.delete'), action: solidus_admin.option_types_path, method: :delete, icon: 'delete-bin-7-line', }, ] end |
#columns ⇒ Object
47 48 49 50 51 52 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 47 def columns [ name_column, presentation_column, ] end |
#model_class ⇒ Object
4 5 6 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 4 def model_class Spree::OptionType end |
#name_column ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 54 def name_column { header: :name, data: ->(option_type) do content_tag :div, option_type.name end } end |
#next_page_path ⇒ Object
32 33 34 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 32 def next_page_path solidus_admin.url_for(**request.params, page: @page.next_param, only_path: true) unless @page.last? end |
#page_actions ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 19 def page_actions render component("ui/button").new( tag: :a, text: t('.add'), href: spree.new_admin_option_type_path, icon: "add-line", ) end |
#presentation_column ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 63 def presentation_column { header: :presentation, data: ->(option_type) do content_tag :div, option_type.presentation end } end |
#prev_page_path ⇒ Object
28 29 30 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 28 def prev_page_path solidus_admin.url_for(**request.params, page: @page.number - 1, only_path: true) unless @page.first? end |
#row_url(option_type) ⇒ Object
8 9 10 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 8 def row_url(option_type) spree.edit_admin_option_type_path(option_type) end |
#sortable_options ⇒ Object
12 13 14 15 16 17 |
# File 'app/components/solidus_admin/option_types/index/component.rb', line 12 def { url: ->(option_type) { solidus_admin.move_option_type_path(option_type) }, param: 'position', } end |