Skip to content

Commit

Permalink
Merge pull request #5308 from nebulab/waiting-for-dev/admin/products_…
Browse files Browse the repository at this point in the history
…title

[Admin] Move product index title logic to the component class
  • Loading branch information
waiting-for-dev authored Aug 7, 2023
2 parents 3b867d4 + 6618ad7 commit a153e27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="<%= stimulus_id %> px-4">
<header class="py-6 flex items-center">
<h1 class="body-title">
<%= Spree::Product.model_name.human.pluralize %>
<%= title %>
</h1>

<div class="ml-auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def initialize(
@pagination_component = pagination_component
end

def title
Spree::Product.model_name.human.pluralize
end

def prev_page_link
@page.first? ? nil : solidus_admin.url_for(host: request.host, port: request.port, **request.params, page: @page.number - 1)
end
Expand Down

0 comments on commit a153e27

Please sign in to comment.