mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
Change title when navigating to new product page
We navigate to it by replacing the content of the page through an ajax call, so we also need change the section title with JS.
This commit is contained in:
12
app/views/spree/admin/products/new.js.erb
Normal file
12
app/views/spree/admin/products/new.js.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%# This chunk is just a copy of Spree's core/app/views/spree/admin/products/new.js.erb %>
|
||||
$("#new_product").html('<%= escape_javascript(render :template => "spree/admin/products/new", :formats => [:html], :handlers => [:erb]) %>');
|
||||
handle_date_picker_fields();
|
||||
<% unless Rails.env.test? %>
|
||||
$('.select2').select2();
|
||||
<% end %>
|
||||
$("#table-filter").hide();
|
||||
$("#admin_new_product").parent().hide();
|
||||
|
||||
<%# We need to replace the page's title as well. We're navigating to a new page
|
||||
although through ajax %>
|
||||
$('#content-header .page-title').html('<%= t('.title') %>');
|
||||
@@ -2056,6 +2056,8 @@ Please follow the instructions there to make your enterprise visible on the Open
|
||||
other: "You have %{count} active order cycles."
|
||||
manage_order_cycles: "MANAGE ORDER CYCLES"
|
||||
products:
|
||||
new:
|
||||
title: 'New Product'
|
||||
unit_name_placeholder: 'eg. bunches'
|
||||
bulk_edit:
|
||||
header:
|
||||
|
||||
Reference in New Issue
Block a user