Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4.3] Theme selection for Solidus Admin: Use spree routing proxy #5605

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Theme selection for Solidus Admin: Use spree routing proxy
When using the navigation from a gem that isolates its namespace in
such a way that the default route helper is not spree, this partial
fails to render with an undefined method error.

This can easily be fixed by prefixing the route helper with Solidus' routing proxy.

This is the same problem and solution as #5599, just for the theme
selection partial that is used when using the current admin (rather than
the new one).

(cherry picked from commit f4c96a8)
  • Loading branch information
mamhoff committed Jan 18, 2024
commit 24ee60da80531a7009c60364b194f390e30a1428
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% theme_options_for_select = Spree::Backend::Config.themes.keys.map { |theme| [theme.to_s.humanize, theme] }.sort %>

<li>
<%= form_tag(admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "light-only") do %>
<%= form_tag(spree.admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "light-only") do %>
<%= hidden_field_tag :system_theme, :light %>
<label>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-sun-line"></use></svg>
Expand All @@ -12,7 +12,7 @@
</label>
<% end %>

<%= form_tag(admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "dark-only") do %>
<%= form_tag(spree.admin_set_theme_path(format: :html), method: :put, style: "width: 100%;", class: "dark-only") do %>
<%= hidden_field_tag :system_theme, :dark %>
<label>
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-moon-line"></use></svg>
Expand Down