app/components/solidus_admin/orders/index/component.html.erb in solidus_admin-0.0.2 vs app/components/solidus_admin/orders/index/component.html.erb in solidus_admin-0.1.0
- old
+ new
@@ -1,31 +1,35 @@
-<div class="<%= stimulus_id %> px-4">
- <header class="py-6 flex items-center">
- <h1 class="body-title">
- <%= title %>
- </h1>
-
- <div class="ml-auto flex gap-2 items-center">
- <%= render component("feedback").new %>
+<%= page do %>
+ <%= page_header do %>
+ <%= page_header_title title %>
+ <%= page_header_actions do %>
<%= render component("ui/button").new(
tag: :a,
text: t('.create_order'),
href: spree.new_admin_order_path,
icon: "add-line",
) %>
- </div>
- </header>
+ <% end %>
+ <% end %>
<%= render component('ui/table').new(
- id: 'orders-list',
- model_class: Spree::Order,
- rows: @page.records,
- fade_row_proc: fade_row_proc,
- search_key: SolidusAdmin::Config[:order_search_key],
- search_url: solidus_admin.orders_path,
- batch_actions: batch_actions,
- filters: filters,
- columns: columns,
- prev_page_link: prev_page_link,
- next_page_link: next_page_link,
+ id: stimulus_id,
+ data: {
+ class: Spree::Order,
+ rows: @page.records,
+ fade: row_fade,
+ url: ->(order) { spree.edit_admin_order_path(order) },
+ batch_actions: batch_actions,
+ columns: columns,
+ prev: prev_page_path,
+ next: next_page_path,
+ },
+ search: {
+ name: :q,
+ value: params[:q],
+ searchbar_key: :number_or_shipments_number_or_bill_address_name_or_email_cont,
+ url: solidus_admin.orders_path(scope: params[:scope]),
+ scopes: scopes,
+ filters: filters,
+ },
) %>
-</div>
+<% end %>