solidus_admin 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +61 -7
- data/Rakefile +1 -0
- data/app/assets/builds/solidus_admin/tailwind.css +197 -162
- data/app/assets/stylesheets/solidus_admin/dark.css +1 -0
- data/app/assets/stylesheets/solidus_admin/dimmed.css +1 -0
- data/app/components/solidus_admin/adjustment_reasons/edit/component.html.erb +27 -0
- data/app/components/solidus_admin/adjustment_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/adjustment_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/adjustment_reasons/index/component.rb +26 -19
- data/app/components/solidus_admin/adjustment_reasons/new/component.html.erb +28 -0
- data/app/components/solidus_admin/adjustment_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/adjustment_reasons/new/component.yml +8 -0
- data/app/components/solidus_admin/base_component.rb +4 -1
- data/app/components/solidus_admin/option_types/index/component.rb +21 -7
- data/app/components/solidus_admin/orders/index/component.rb +28 -23
- data/app/components/solidus_admin/orders/index/component.yml +1 -1
- data/app/components/solidus_admin/orders/show/address/component.html.erb +56 -54
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb +27 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/spree_line_item/component.rb +14 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/spree_order/component.rb +11 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/spree_shipment/component.rb +15 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/component.rb +147 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/component.yml +21 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/source/component.rb +26 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/source/spree_tax_rate/component.rb +17 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/source/spree_unit_cancel/component.rb +7 -0
- data/app/components/solidus_admin/orders/show/component.html.erb +7 -3
- data/app/components/solidus_admin/orders/show/component.rb +8 -0
- data/app/components/solidus_admin/orders/show/email/component.html.erb +18 -13
- data/app/components/solidus_admin/orders/show/email/component.rb +0 -4
- data/app/components/solidus_admin/orders/show/summary/component.html.erb +1 -1
- data/app/components/solidus_admin/payment_methods/index/component.rb +29 -19
- data/app/components/solidus_admin/payment_methods/index/component.yml +0 -5
- data/app/components/solidus_admin/products/index/component.rb +25 -15
- data/app/components/solidus_admin/products/index/component.yml +0 -2
- data/app/components/solidus_admin/products/show/component.html.erb +14 -3
- data/app/components/solidus_admin/products/status/component.rb +4 -1
- data/app/components/solidus_admin/products/status/component.yml +1 -0
- data/app/components/solidus_admin/properties/index/component.rb +18 -19
- data/app/components/solidus_admin/refund_reasons/edit/component.html.erb +27 -0
- data/app/components/solidus_admin/refund_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/refund_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/refund_reasons/index/component.rb +26 -19
- data/app/components/solidus_admin/refund_reasons/new/component.html.erb +27 -0
- data/app/components/solidus_admin/refund_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/refund_reasons/new/component.yml +6 -0
- data/app/components/solidus_admin/refunds_and_returns/component.rb +33 -13
- data/app/components/solidus_admin/reimbursement_types/index/component.rb +7 -25
- data/app/components/solidus_admin/return_reasons/edit/component.html.erb +26 -0
- data/app/components/solidus_admin/return_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/return_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/return_reasons/index/component.rb +27 -19
- data/app/components/solidus_admin/return_reasons/new/component.html.erb +27 -0
- data/app/components/solidus_admin/return_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/return_reasons/new/component.yml +8 -0
- data/app/components/solidus_admin/roles/edit/component.html.erb +33 -0
- data/app/components/solidus_admin/roles/edit/component.rb +20 -0
- data/app/components/solidus_admin/roles/edit/component.yml +19 -0
- data/app/components/solidus_admin/roles/index/component.rb +70 -0
- data/app/components/solidus_admin/roles/index/component.yml +6 -0
- data/app/components/solidus_admin/roles/new/component.html.erb +33 -0
- data/app/components/solidus_admin/roles/new/component.rb +20 -0
- data/app/components/solidus_admin/roles/new/component.yml +19 -0
- data/app/components/solidus_admin/shipping/component.rb +23 -11
- data/app/components/solidus_admin/shipping_categories/edit/component.html.erb +16 -0
- data/app/components/solidus_admin/shipping_categories/edit/component.rb +12 -0
- data/app/components/solidus_admin/shipping_categories/edit/component.yml +6 -0
- data/app/components/solidus_admin/shipping_categories/index/component.rb +37 -20
- data/app/components/solidus_admin/shipping_categories/new/component.html.erb +17 -0
- data/app/components/solidus_admin/shipping_categories/new/component.rb +12 -0
- data/app/components/solidus_admin/shipping_categories/new/component.yml +6 -0
- data/app/components/solidus_admin/shipping_methods/index/component.rb +19 -19
- data/app/components/solidus_admin/stock_items/edit/component.html.erb +66 -72
- data/app/components/solidus_admin/stock_items/edit/component.rb +0 -5
- data/app/components/solidus_admin/stock_items/index/component.rb +13 -20
- data/app/components/solidus_admin/stock_locations/index/component.rb +19 -11
- data/app/components/solidus_admin/stock_locations/index/component.yml +0 -3
- data/app/components/solidus_admin/store_credit_reasons/edit/component.html.erb +26 -0
- data/app/components/solidus_admin/store_credit_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/store_credit_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/store_credit_reasons/index/component.rb +26 -19
- data/app/components/solidus_admin/store_credit_reasons/new/component.html.erb +27 -0
- data/app/components/solidus_admin/store_credit_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/store_credit_reasons/new/component.yml +8 -0
- data/app/components/solidus_admin/stores/index/component.rb +18 -19
- data/app/components/solidus_admin/tax_categories/edit/component.html.erb +28 -0
- data/app/components/solidus_admin/tax_categories/edit/component.rb +12 -0
- data/app/components/solidus_admin/tax_categories/edit/component.yml +8 -0
- data/app/components/solidus_admin/tax_categories/index/component.rb +28 -21
- data/app/components/solidus_admin/tax_categories/new/component.html.erb +28 -0
- data/app/components/solidus_admin/tax_categories/new/component.rb +12 -0
- data/app/components/solidus_admin/tax_categories/new/component.yml +8 -0
- data/app/components/solidus_admin/tax_rates/index/component.rb +21 -17
- data/app/components/solidus_admin/taxes/component.rb +8 -8
- data/app/components/solidus_admin/taxonomies/index/component.rb +18 -12
- data/app/components/solidus_admin/ui/button/component.rb +1 -1
- data/app/components/solidus_admin/ui/checkbox_row/component.html.erb +29 -0
- data/app/components/solidus_admin/ui/checkbox_row/component.rb +11 -0
- data/app/components/solidus_admin/ui/forms/address/component.html.erb +27 -9
- data/app/components/solidus_admin/ui/forms/address/component.js +38 -13
- data/app/components/solidus_admin/ui/forms/search/component.html.erb +2 -3
- data/app/components/solidus_admin/ui/forms/search/component.js +3 -3
- data/app/components/solidus_admin/ui/modal/component.html.erb +7 -7
- data/app/components/solidus_admin/ui/modal/component.js +7 -0
- data/app/components/solidus_admin/ui/modal/component.rb +1 -1
- data/app/components/solidus_admin/ui/pages/index/component.html.erb +44 -0
- data/app/components/solidus_admin/ui/pages/index/component.rb +105 -0
- data/app/components/solidus_admin/ui/panel/component.html.erb +5 -16
- data/app/components/solidus_admin/ui/panel/component.rb +11 -7
- data/app/components/solidus_admin/ui/table/component.html.erb +2 -1
- data/app/components/solidus_admin/ui/table/component.js +31 -2
- data/app/components/solidus_admin/ui/table/component.rb +24 -8
- data/app/components/solidus_admin/ui/table/component.yml +1 -0
- data/app/components/solidus_admin/ui/thumbnail/component.rb +1 -1
- data/app/components/solidus_admin/ui/thumbnail_with_caption/component.html.erb +17 -0
- data/app/components/solidus_admin/ui/thumbnail_with_caption/component.rb +15 -0
- data/app/components/solidus_admin/users/addresses/component.html.erb +46 -0
- data/app/components/solidus_admin/users/addresses/component.rb +61 -0
- data/app/components/solidus_admin/users/addresses/component.yml +14 -0
- data/app/components/solidus_admin/users/edit/api_access/component.html.erb +49 -0
- data/app/components/solidus_admin/users/edit/api_access/component.js +9 -0
- data/app/components/solidus_admin/users/edit/api_access/component.rb +7 -0
- data/app/components/solidus_admin/users/edit/api_access/component.yml +10 -0
- data/app/components/solidus_admin/users/edit/component.html.erb +52 -0
- data/app/components/solidus_admin/users/edit/component.rb +51 -0
- data/app/components/solidus_admin/users/edit/component.yml +12 -0
- data/app/components/solidus_admin/users/index/component.rb +25 -16
- data/app/components/solidus_admin/users/index/component.yml +0 -3
- data/app/components/solidus_admin/users/items/component.html.erb +41 -0
- data/app/components/solidus_admin/users/items/component.rb +170 -0
- data/app/components/solidus_admin/users/items/component.yml +16 -0
- data/app/components/solidus_admin/users/orders/component.html.erb +42 -0
- data/app/components/solidus_admin/users/orders/component.rb +131 -0
- data/app/components/solidus_admin/users/orders/component.yml +12 -0
- data/app/components/solidus_admin/users/stats/component.html.erb +11 -0
- data/app/components/solidus_admin/users/stats/component.rb +9 -0
- data/app/components/solidus_admin/users/stats/component.yml +2 -0
- data/app/components/solidus_admin/users_and_roles/component.rb +24 -0
- data/app/components/solidus_admin/users_and_roles/component.yml +2 -0
- data/app/components/solidus_admin/zones/index/component.rb +19 -11
- data/app/controllers/solidus_admin/addresses_controller.rb +6 -1
- data/app/controllers/solidus_admin/adjustment_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/adjustments_controller.rb +57 -0
- data/app/controllers/solidus_admin/customers_controller.rb +5 -1
- data/app/controllers/solidus_admin/orders_controller.rb +5 -1
- data/app/controllers/solidus_admin/products_controller.rb +11 -0
- data/app/controllers/solidus_admin/properties_controller.rb +1 -1
- data/app/controllers/solidus_admin/refund_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/reimbursement_types_controller.rb +0 -5
- data/app/controllers/solidus_admin/return_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/roles_controller.rb +118 -0
- data/app/controllers/solidus_admin/shipping_categories_controller.rb +87 -10
- data/app/controllers/solidus_admin/shipping_methods_controller.rb +0 -5
- data/app/controllers/solidus_admin/stock_items_controller.rb +6 -6
- data/app/controllers/solidus_admin/stock_locations_controller.rb +0 -5
- data/app/controllers/solidus_admin/store_credit_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/stores_controller.rb +0 -5
- data/app/controllers/solidus_admin/tax_categories_controller.rb +89 -10
- data/app/controllers/solidus_admin/tax_rates_controller.rb +0 -5
- data/app/controllers/solidus_admin/users_controller.rb +85 -6
- data/app/controllers/solidus_admin/zones_controller.rb +0 -5
- data/app/helpers/solidus_admin/last_login_helper.rb +16 -0
- data/app/helpers/solidus_admin/permission_sets_helper.rb +32 -0
- data/app/views/layouts/solidus_admin/application.html.erb +2 -1
- data/app/views/layouts/solidus_admin/preview.html.erb +2 -0
- data/config/initializers/view_component.rb +1 -1
- data/config/locales/adjustment_reasons.en.yml +5 -1
- data/config/locales/adjustments.en.yml +10 -0
- data/config/locales/refund_reasons.en.yml +10 -0
- data/config/locales/return_reasons.en.yml +5 -1
- data/config/locales/roles.en.yml +10 -0
- data/config/locales/shipping_categories.en.yml +4 -0
- data/config/locales/store_credit_reasons.en.yml +5 -1
- data/config/locales/tax_categories.en.yml +4 -0
- data/config/locales/users.en.yml +10 -0
- data/config/routes.rb +24 -7
- data/docs/components.md +109 -0
- data/docs/{customizing_view_components.md → customizing_components.md} +2 -7
- data/docs/index_pages.md +146 -0
- data/docs/{customizing_menu_items.md → menu_items.md} +1 -1
- data/docs/stimulusjs.md +85 -0
- data/docs/{customizing_tailwindcss.md → tailwindcss.md} +27 -8
- data/lib/solidus_admin/component_registry.rb +40 -0
- data/lib/solidus_admin/configuration.rb +5 -27
- data/lib/solidus_admin/install_tailwindcss.rb +3 -1
- data/lib/solidus_admin/testing_support/admin_assets.rb +10 -0
- data/lib/solidus_admin/testing_support/component_helpers.rb +27 -0
- data/lib/solidus_admin/testing_support/dummy_app/rake_tasks.rb +60 -0
- data/lib/solidus_admin/testing_support/feature_helpers.rb +34 -0
- data/lib/solidus_admin/version.rb +1 -1
- data/solidus_admin.gemspec +7 -3
- metadata +111 -59
- data/app/components/solidus_admin/adjustment_reasons/index/component.html.erb +0 -32
- data/app/components/solidus_admin/adjustment_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/option_types/index/component.html.erb +0 -30
- data/app/components/solidus_admin/orders/index/component.html.erb +0 -35
- data/app/components/solidus_admin/payment_methods/index/component.html.erb +0 -38
- data/app/components/solidus_admin/products/index/component.html.erb +0 -34
- data/app/components/solidus_admin/promotion_categories/index/component.html.erb +0 -26
- data/app/components/solidus_admin/promotion_categories/index/component.rb +0 -57
- data/app/components/solidus_admin/promotion_categories/index/component.yml +0 -4
- data/app/components/solidus_admin/promotions/index/component.html.erb +0 -34
- data/app/components/solidus_admin/promotions/index/component.rb +0 -97
- data/app/components/solidus_admin/promotions/index/component.yml +0 -14
- data/app/components/solidus_admin/properties/index/component.html.erb +0 -34
- data/app/components/solidus_admin/properties/index/component.yml +0 -4
- data/app/components/solidus_admin/refund_reasons/index/component.html.erb +0 -31
- data/app/components/solidus_admin/refund_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/refunds_and_returns/component.html.erb +0 -26
- data/app/components/solidus_admin/reimbursement_types/index/component.html.erb +0 -22
- data/app/components/solidus_admin/reimbursement_types/index/component.yml +0 -4
- data/app/components/solidus_admin/return_reasons/index/component.html.erb +0 -31
- data/app/components/solidus_admin/return_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/shipping/component.html.erb +0 -30
- data/app/components/solidus_admin/shipping_categories/index/component.html.erb +0 -32
- data/app/components/solidus_admin/shipping_categories/index/component.yml +0 -4
- data/app/components/solidus_admin/shipping_methods/index/component.html.erb +0 -32
- data/app/components/solidus_admin/shipping_methods/index/component.yml +0 -4
- data/app/components/solidus_admin/stock_items/index/component.html.erb +0 -26
- data/app/components/solidus_admin/stock_locations/index/component.html.erb +0 -32
- data/app/components/solidus_admin/store_credit_reasons/index/component.html.erb +0 -31
- data/app/components/solidus_admin/store_credit_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/stores/index/component.html.erb +0 -34
- data/app/components/solidus_admin/stores/index/component.yml +0 -4
- data/app/components/solidus_admin/tax_categories/index/component.html.erb +0 -32
- data/app/components/solidus_admin/tax_categories/index/component.yml +0 -6
- data/app/components/solidus_admin/tax_rates/index/component.html.erb +0 -32
- data/app/components/solidus_admin/tax_rates/index/component.yml +0 -4
- data/app/components/solidus_admin/taxes/component.html.erb +0 -24
- data/app/components/solidus_admin/taxonomies/index/component.html.erb +0 -28
- data/app/components/solidus_admin/taxonomies/index/component.yml +0 -4
- data/app/components/solidus_admin/users/index/component.html.erb +0 -34
- data/app/components/solidus_admin/zones/index/component.html.erb +0 -35
- data/app/components/solidus_admin/zones/index/component.yml +0 -4
- data/app/controllers/solidus_admin/promotion_categories_controller.rb +0 -38
- data/app/controllers/solidus_admin/promotions_controller.rb +0 -46
- data/config/locales/promotion_categories.en.yml +0 -6
- data/config/locales/promotions.en.yml +0 -6
- data/config/locales/refund_reasons_.en.yml +0 -6
- /data/app/components/solidus_admin/{option_types → ui/pages}/index/component.yml +0 -0
@@ -1,32 +0,0 @@
|
|
1
|
-
<%= render component('shipping').new(current_class: Spree::StockLocation) do |layout| %>
|
2
|
-
<% layout.with_actions do %>
|
3
|
-
<%= render component("ui/button").new(
|
4
|
-
tag: :a,
|
5
|
-
text: t('.add'),
|
6
|
-
href: spree.new_admin_stock_location_path,
|
7
|
-
icon: "add-line",
|
8
|
-
class: "align-self-end w-full",
|
9
|
-
) %>
|
10
|
-
<% end %>
|
11
|
-
|
12
|
-
<%= render component('ui/table').new(
|
13
|
-
id: stimulus_id,
|
14
|
-
data: {
|
15
|
-
class: Spree::StockLocation,
|
16
|
-
rows: @page.records,
|
17
|
-
url: ->(stock_location) { spree.edit_admin_stock_location_path(stock_location) },
|
18
|
-
prev: prev_page_path,
|
19
|
-
next: next_page_path,
|
20
|
-
columns: columns,
|
21
|
-
batch_actions: batch_actions,
|
22
|
-
},
|
23
|
-
search: {
|
24
|
-
name: :q,
|
25
|
-
value: params[:q],
|
26
|
-
url: solidus_admin.stock_locations_path,
|
27
|
-
searchbar_key: :name_or_description_cont,
|
28
|
-
scopes: scopes,
|
29
|
-
filters: filters,
|
30
|
-
},
|
31
|
-
) %>
|
32
|
-
<% end %>
|
@@ -1,31 +0,0 @@
|
|
1
|
-
<%= render component('refunds_and_returns').new(current_class: Spree::StoreCreditReason) do |layout| %>
|
2
|
-
<% layout.with_actions do %>
|
3
|
-
<%= render component("ui/button").new(
|
4
|
-
tag: :a,
|
5
|
-
text: t('.add'),
|
6
|
-
href: spree.new_admin_store_credit_reason_path,
|
7
|
-
icon: "add-line",
|
8
|
-
class: "align-self-end w-full",
|
9
|
-
) %>
|
10
|
-
<% end %>
|
11
|
-
<%= render component('ui/table').new(
|
12
|
-
id: stimulus_id,
|
13
|
-
data: {
|
14
|
-
class: Spree::StoreCreditReason,
|
15
|
-
rows: @page.records,
|
16
|
-
url: ->(store_credit_reason) { spree.edit_admin_store_credit_reason_path(store_credit_reason) },
|
17
|
-
prev: prev_page_path,
|
18
|
-
next: next_page_path,
|
19
|
-
columns: columns,
|
20
|
-
batch_actions: batch_actions,
|
21
|
-
},
|
22
|
-
search: {
|
23
|
-
name: :q,
|
24
|
-
value: params[:q],
|
25
|
-
url: solidus_admin.store_credit_reasons_path,
|
26
|
-
searchbar_key: :name_cont,
|
27
|
-
scopes: scopes,
|
28
|
-
filters: filters,
|
29
|
-
},
|
30
|
-
) %>
|
31
|
-
<% end %>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<%= page do %>
|
2
|
-
<%= page_header do %>
|
3
|
-
<%= page_header_title title %>
|
4
|
-
<%= page_header_actions do %>
|
5
|
-
<%= render component("ui/button").new(
|
6
|
-
tag: :a,
|
7
|
-
text: t('.add'),
|
8
|
-
href: spree.new_admin_store_path,
|
9
|
-
icon: "add-line",
|
10
|
-
) %>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<%= render component('ui/table').new(
|
15
|
-
id: stimulus_id,
|
16
|
-
data: {
|
17
|
-
class: Spree::Store,
|
18
|
-
rows: @page.records,
|
19
|
-
url: ->(store) { spree.edit_admin_store_path(store) },
|
20
|
-
prev: prev_page_path,
|
21
|
-
next: next_page_path,
|
22
|
-
columns: columns,
|
23
|
-
batch_actions: batch_actions,
|
24
|
-
},
|
25
|
-
search: {
|
26
|
-
name: :q,
|
27
|
-
value: params[:q],
|
28
|
-
url: solidus_admin.stores_path,
|
29
|
-
searchbar_key: :name_or_url_or_code_cont,
|
30
|
-
scopes: scopes,
|
31
|
-
filters: filters,
|
32
|
-
},
|
33
|
-
) %>
|
34
|
-
<% end %>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<%= render component('taxes').new(model_class: Spree::TaxCategory) do |layout| %>
|
2
|
-
<% layout.with_actions do %>
|
3
|
-
<%= render component("ui/button").new(
|
4
|
-
tag: :a,
|
5
|
-
text: t('.add'),
|
6
|
-
href: spree.new_admin_tax_category_path,
|
7
|
-
icon: "add-line",
|
8
|
-
class: "align-self-end w-full",
|
9
|
-
) %>
|
10
|
-
<% end %>
|
11
|
-
|
12
|
-
<%= render component('ui/table').new(
|
13
|
-
id: stimulus_id,
|
14
|
-
data: {
|
15
|
-
class: Spree::TaxCategory,
|
16
|
-
rows: @page.records,
|
17
|
-
url: ->(tax_category) { spree.edit_admin_tax_category_path(tax_category) },
|
18
|
-
prev: prev_page_path,
|
19
|
-
next: next_page_path,
|
20
|
-
columns: columns,
|
21
|
-
batch_actions: batch_actions,
|
22
|
-
},
|
23
|
-
search: {
|
24
|
-
name: :q,
|
25
|
-
value: params[:q],
|
26
|
-
url: solidus_admin.tax_categories_path,
|
27
|
-
searchbar_key: :name_or_description_cont,
|
28
|
-
scopes: scopes,
|
29
|
-
filters: filters,
|
30
|
-
},
|
31
|
-
) %>
|
32
|
-
<% end %>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<%= render component('taxes').new(model_class: Spree::TaxRate) do |layout| %>
|
2
|
-
<% layout.with_actions do %>
|
3
|
-
<%= render component("ui/button").new(
|
4
|
-
tag: :a,
|
5
|
-
text: t('.add'),
|
6
|
-
href: spree.new_admin_tax_rate_path,
|
7
|
-
icon: "add-line",
|
8
|
-
class: "align-self-end w-full",
|
9
|
-
) %>
|
10
|
-
<% end %>
|
11
|
-
|
12
|
-
<%= render component('ui/table').new(
|
13
|
-
id: stimulus_id,
|
14
|
-
data: {
|
15
|
-
class: Spree::TaxRate,
|
16
|
-
rows: @page.records,
|
17
|
-
url: ->(tax_rate) { spree.edit_admin_tax_rate_path(tax_rate) },
|
18
|
-
prev: prev_page_path,
|
19
|
-
next: next_page_path,
|
20
|
-
columns: columns,
|
21
|
-
batch_actions: batch_actions,
|
22
|
-
},
|
23
|
-
search: {
|
24
|
-
name: :q,
|
25
|
-
value: params[:q],
|
26
|
-
url: solidus_admin.tax_rates_path,
|
27
|
-
searchbar_key: :name_or_description_cont,
|
28
|
-
scopes: scopes,
|
29
|
-
filters: filters,
|
30
|
-
},
|
31
|
-
) %>
|
32
|
-
<% end %>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<%= page do %>
|
2
|
-
<%= page_header do %>
|
3
|
-
<%= page_header_title safe_join([
|
4
|
-
tag.div(t(".title")),
|
5
|
-
tag.div(t(".subtitle"), class: "font-normal text-sm text-gray-500"),
|
6
|
-
]) %>
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
<%= page_header do %>
|
10
|
-
<% title = capture do %>
|
11
|
-
<% tabs.each do %>
|
12
|
-
<%= render(component('ui/button').new(tag: :a, scheme: :ghost, **_1)) %>
|
13
|
-
<% end %>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<%= page_header_title title %>
|
17
|
-
|
18
|
-
<%= page_header_actions do %>
|
19
|
-
<%= actions %>
|
20
|
-
<% end %>
|
21
|
-
<% end %>
|
22
|
-
|
23
|
-
<%= content %>
|
24
|
-
<% end %>
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<%= page do %>
|
2
|
-
<%= page_header do %>
|
3
|
-
<%= page_header_title title %>
|
4
|
-
<%= page_header_actions do %>
|
5
|
-
<%= render component("ui/button").new(
|
6
|
-
tag: :a,
|
7
|
-
text: t('.add'),
|
8
|
-
href: spree.new_admin_taxonomy_path,
|
9
|
-
icon: "add-line",
|
10
|
-
) %>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<%= render component('ui/table').new(
|
15
|
-
id: stimulus_id,
|
16
|
-
data: {
|
17
|
-
class: Spree::Taxonomy,
|
18
|
-
rows: @page.records,
|
19
|
-
url: ->(taxonomy) { spree.edit_admin_taxonomy_path(taxonomy) },
|
20
|
-
columns: columns,
|
21
|
-
batch_actions: batch_actions,
|
22
|
-
},
|
23
|
-
sortable: {
|
24
|
-
url: ->(taxonomy) { solidus_admin.move_taxonomy_path(taxonomy) },
|
25
|
-
param: 'position',
|
26
|
-
},
|
27
|
-
) %>
|
28
|
-
<% end %>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<%= page do %>
|
2
|
-
<%= page_header do %>
|
3
|
-
<%= page_header_title title %>
|
4
|
-
<%= page_header_actions do %>
|
5
|
-
<%= render component("ui/button").new(
|
6
|
-
tag: :a,
|
7
|
-
text: t('.add'),
|
8
|
-
href: spree.new_admin_user_path,
|
9
|
-
icon: "add-line",
|
10
|
-
) %>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<%= render component('ui/table').new(
|
15
|
-
id: stimulus_id,
|
16
|
-
data: {
|
17
|
-
class: Spree.user_class,
|
18
|
-
rows: @page.records,
|
19
|
-
url: ->(user) { spree.admin_user_path(user) },
|
20
|
-
prev: prev_page_path,
|
21
|
-
next: next_page_path,
|
22
|
-
columns: columns,
|
23
|
-
batch_actions: batch_actions,
|
24
|
-
},
|
25
|
-
search: {
|
26
|
-
name: :q,
|
27
|
-
value: params[:q],
|
28
|
-
url: solidus_admin.users_path,
|
29
|
-
searchbar_key: :email_cont,
|
30
|
-
scopes: scopes,
|
31
|
-
filters: filters,
|
32
|
-
},
|
33
|
-
) %>
|
34
|
-
<% end %>
|
@@ -1,35 +0,0 @@
|
|
1
|
-
<%= page do %>
|
2
|
-
<%= page_header do %>
|
3
|
-
<%= page_header_title title %>
|
4
|
-
<%= page_header_actions do %>
|
5
|
-
<%= render component("ui/button").new(
|
6
|
-
tag: :a,
|
7
|
-
text: t('.add'),
|
8
|
-
href: spree.new_admin_zone_path,
|
9
|
-
icon: "add-line",
|
10
|
-
class: "align-self-end w-full",
|
11
|
-
) %>
|
12
|
-
<% end %>
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
<%= render component('ui/table').new(
|
16
|
-
id: stimulus_id,
|
17
|
-
data: {
|
18
|
-
class: Spree::Zone,
|
19
|
-
rows: @page.records,
|
20
|
-
url: ->(zone) { spree.edit_admin_zone_path(zone) },
|
21
|
-
prev: prev_page_path,
|
22
|
-
next: next_page_path,
|
23
|
-
columns: columns,
|
24
|
-
batch_actions: batch_actions,
|
25
|
-
},
|
26
|
-
search: {
|
27
|
-
name: :q,
|
28
|
-
value: params[:q],
|
29
|
-
url: solidus_admin.zones_path,
|
30
|
-
searchbar_key: :name_or_description_cont,
|
31
|
-
scopes: scopes,
|
32
|
-
filters: filters,
|
33
|
-
},
|
34
|
-
) %>
|
35
|
-
<% end %>
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module SolidusAdmin
|
4
|
-
class PromotionCategoriesController < SolidusAdmin::BaseController
|
5
|
-
include SolidusAdmin::ControllerHelpers::Search
|
6
|
-
|
7
|
-
before_action :load_promotion_category, only: [:move]
|
8
|
-
|
9
|
-
def index
|
10
|
-
promotion_categories = apply_search_to(
|
11
|
-
Spree::PromotionCategory.all,
|
12
|
-
param: :q,
|
13
|
-
)
|
14
|
-
|
15
|
-
set_page_and_extract_portion_from(promotion_categories)
|
16
|
-
|
17
|
-
respond_to do |format|
|
18
|
-
format.html { render component('promotion_categories/index').new(page: @page) }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def destroy
|
23
|
-
@promotion_categories = Spree::PromotionCategory.where(id: params[:id])
|
24
|
-
|
25
|
-
Spree::PromotionCategory.transaction { @promotion_categories.destroy_all }
|
26
|
-
|
27
|
-
flash[:notice] = t('.success')
|
28
|
-
redirect_back_or_to promotion_categories_path, status: :see_other
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def load_promotion_category
|
34
|
-
@promotion_category = Spree::PromotionCategory.find(params[:id])
|
35
|
-
authorize! action_name, @promotion_category
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module SolidusAdmin
|
4
|
-
class PromotionsController < SolidusAdmin::BaseController
|
5
|
-
include SolidusAdmin::ControllerHelpers::Search
|
6
|
-
|
7
|
-
search_scope(:active, default: true, &:active)
|
8
|
-
search_scope(:draft) { _1.where.not(id: _1.has_actions.select(:id)) }
|
9
|
-
search_scope(:future) { _1.has_actions.where(starts_at: Time.current..) }
|
10
|
-
search_scope(:expired) { _1.has_actions.where(expires_at: ..Time.current) }
|
11
|
-
search_scope(:all)
|
12
|
-
|
13
|
-
def index
|
14
|
-
promotions = apply_search_to(
|
15
|
-
Spree::Promotion.order(id: :desc),
|
16
|
-
param: :q,
|
17
|
-
)
|
18
|
-
|
19
|
-
set_page_and_extract_portion_from(promotions)
|
20
|
-
|
21
|
-
respond_to do |format|
|
22
|
-
format.html { render component('promotions/index').new(page: @page) }
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def destroy
|
27
|
-
@promotions = Spree::Promotion.where(id: params[:id])
|
28
|
-
|
29
|
-
Spree::Promotion.transaction { @promotions.destroy_all }
|
30
|
-
|
31
|
-
flash[:notice] = t('.success')
|
32
|
-
redirect_back_or_to promotions_path, status: :see_other
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def load_promotion
|
38
|
-
@promotion = Spree::Promotion.find_by!(number: params[:id])
|
39
|
-
authorize! action_name, @promotion
|
40
|
-
end
|
41
|
-
|
42
|
-
def promotion_params
|
43
|
-
params.require(:promotion).permit(:user_id, permitted_promotion_attributes)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
File without changes
|