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:
Pau Perez
2017-09-06 18:30:17 +02:00
committed by Maikel Linke
parent 949faa7fde
commit f50e745826
2 changed files with 14 additions and 0 deletions

View 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') %>');

View File

@@ -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: