Class: SolidusAdmin::Stores::Index::Component
- Inherits:
-
UI::Pages::Index::Component
- Object
- UI::Pages::Index::Component
- SolidusAdmin::Stores::Index::Component
- Defined in:
- app/components/solidus_admin/stores/index/component.rb
Instance Method Summary collapse
- #batch_actions ⇒ Object
- #columns ⇒ Object
- #model_class ⇒ Object
- #page_actions ⇒ Object
- #row_url(store) ⇒ Object
- #search_key ⇒ Object
- #search_url ⇒ Object
Instance Method Details
#batch_actions ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'app/components/solidus_admin/stores/index/component.rb', line 29 def batch_actions [ { label: t('.batch_actions.delete'), action: solidus_admin.stores_path, method: :delete, icon: 'delete-bin-7-line', }, ] end |
#columns ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/components/solidus_admin/stores/index/component.rb', line 40 def columns [ :name, :url, { header: :slug, data: ->(store) do content_tag :div, store.code end }, { header: :default, data: ->(store) do store.default? ? component('ui/badge').yes : component('ui/badge').no end }, ] end |
#model_class ⇒ Object
4 5 6 |
# File 'app/components/solidus_admin/stores/index/component.rb', line 4 def model_class Spree::Store end |
#page_actions ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/components/solidus_admin/stores/index/component.rb', line 20 def page_actions render component("ui/button").new( tag: :a, text: t('.add'), href: spree.new_admin_store_path, icon: "add-line", ) end |
#row_url(store) ⇒ Object
16 17 18 |
# File 'app/components/solidus_admin/stores/index/component.rb', line 16 def row_url(store) spree.edit_admin_store_path(store) end |
#search_key ⇒ Object
8 9 10 |
# File 'app/components/solidus_admin/stores/index/component.rb', line 8 def search_key :name_or_url_or_code_cont end |
#search_url ⇒ Object
12 13 14 |
# File 'app/components/solidus_admin/stores/index/component.rb', line 12 def search_url solidus_admin.stores_path end |