Skip to content

Commit

Permalink
elia/tax-categories/index: [wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Nov 29, 2023
1 parent d91bd64 commit 780093d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Use the translation in the example in your template with `t(".hello")`.
en:
give_feedback: 'Give feedback'
feedback_description: 'We are constantly trying to improve. Please let us know what you think about this admin page.'
feedback_description: 'Please let us know what you think about this admin page.'
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<%= page do %>
<%= page_header do %>
<%= page_header_title title %>
<%= page_header_actions do %>
<%= render component("ui/button").new(
tag: :a,
text: t('.add'),
href: spree.new_admin_tax_category_path,
icon: "add-line",
) %>
<% end %>
<%= render component('taxes').new do |layout| %>
<% layout.with_actions do %>
<%= render component("ui/button").new(
tag: :a,
text: t('.add'),
href: spree.new_admin_tax_category_path,
icon: "add-line",
class: "align-self-end w-full",
) %>
<% end %>

<%= render component('ui/table').new(
Expand Down
28 changes: 28 additions & 0 deletions admin/app/components/solidus_admin/taxes/component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<%= page do %>
<%= page_header do %>
<%= page_header_title safe_join([
tag.div(t(".title")),
tag.div(t(".subtitle"), class: "body-small text-gray-500"),
# tag.div(
# render(component('ui/tab').new(text: Spree::TaxCategory.model_name.human.pluralize, href: solidus_admin.tax_categories_path, current: true)) +
# render(component('ui/tab').new(text: Spree::TaxRate.model_name.human.pluralize, href: spree.admin_tax_rates_path, current: false)),
# class: "flex gap-2 mt-4"
# ),
]) %>
<% end %>

<%= page_header do %>
<% title = capture do %>
<%= render(component('ui/tab').new(text: Spree::TaxCategory.model_name.human.pluralize, href: solidus_admin.tax_categories_path, current: true)) %>
<%= render(component('ui/tab').new(text: Spree::TaxRate.model_name.human.pluralize, href: spree.admin_tax_rates_path, current: false)) %>
<% end %>

<%= page_header_title title %>

<%= page_header_actions do %>
<%= actions %>
<% end %>
<% end %>

<%= content %>
<% end %>
6 changes: 6 additions & 0 deletions admin/app/components/solidus_admin/taxes/component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

class SolidusAdmin::Taxes::Component < SolidusAdmin::BaseComponent
include SolidusAdmin::Layout::PageHelpers
renders_one :actions
end
3 changes: 3 additions & 0 deletions admin/app/components/solidus_admin/taxes/component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
en:
title: "Taxes"
subtitle: "Configure tax rates and tax categories for products and shipping in different markets."

0 comments on commit 780093d

Please sign in to comment.