diff --git a/backend/app/assets/javascripts/spree/backend/handlebars_extensions.coffee b/backend/app/assets/javascripts/spree/backend/handlebars_extensions.coffee deleted file mode 100644 index abb4f1a0648..00000000000 --- a/backend/app/assets/javascripts/spree/backend/handlebars_extensions.coffee +++ /dev/null @@ -1,11 +0,0 @@ -#= require handlebars -#= require spree/backend/translation - -Handlebars.registerHelper "t", (key, options) -> - Spree.t(key, options.hash) - -Handlebars.registerHelper "human_attribute_name", (model, attr) -> - Spree.human_attribute_name(model, attr) - -Handlebars.registerHelper "admin_url", -> - Spree.pathFor("admin") diff --git a/backend/app/assets/javascripts/spree/backend/handlebars_extensions.js b/backend/app/assets/javascripts/spree/backend/handlebars_extensions.js new file mode 100644 index 00000000000..dcd11a6c8e9 --- /dev/null +++ b/backend/app/assets/javascripts/spree/backend/handlebars_extensions.js @@ -0,0 +1,18 @@ +//= require handlebars +//= require spree/backend/translation + +Handlebars.registerHelper("t", function(key, options) { + return Spree.t(key, options.hash); +}); + +Handlebars.registerHelper("human_attribute_name", function(model, attr) { + return Spree.human_attribute_name(model, attr); +}); + +Handlebars.registerHelper("admin_url", function() { + return Spree.pathFor("admin") +}); + +Handlebars.registerHelper("concat", function() { + return Array.prototype.slice.call(arguments, 0, -1).join(''); +}); diff --git a/backend/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee b/backend/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee index 5500a22de12..74fb31a830f 100644 --- a/backend/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee +++ b/backend/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee @@ -84,7 +84,7 @@ class VariantForm variantId: transferItem.variant.id variantDisplayAttributes: formatVariantDisplayAttributes(transferItem.variant) variantOptions: formatVariantOptionValues(transferItem.variant) - variantImageURL: transferItem.variant.images[0]?.small_url + variantImage: transferItem.variant.images[0] if isReceiving templateAttributes["receivedQuantity"] = transferItem.received_quantity diff --git a/backend/app/assets/javascripts/spree/backend/templates/_image.hbs b/backend/app/assets/javascripts/spree/backend/templates/_image.hbs new file mode 100644 index 00000000000..f6fb264d69a --- /dev/null +++ b/backend/app/assets/javascripts/spree/backend/templates/_image.hbs @@ -0,0 +1,5 @@ +{{#if image }} + +{{ else }} + +{{/if}} diff --git a/backend/app/assets/javascripts/spree/backend/templates/index.js b/backend/app/assets/javascripts/spree/backend/templates/index.js index 52227647742..908ce31db3e 100644 --- a/backend/app/assets/javascripts/spree/backend/templates/index.js +++ b/backend/app/assets/javascripts/spree/backend/templates/index.js @@ -1,3 +1,4 @@ +//= require spree/backend/templates/_image //= require spree/backend/templates/orders/customer_details/autocomplete //= require spree/backend/templates/orders/details_adjustment_row //= require spree/backend/templates/orders/line_item diff --git a/backend/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs b/backend/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs index b437abc124b..24a570bbb99 100644 --- a/backend/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +++ b/backend/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs @@ -4,11 +4,7 @@ {{else}}