diff --git a/Gemfile.lock b/Gemfile.lock index ea4e73580f..30f8c6ccae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -835,7 +835,7 @@ GEM websocket-extensions (0.1.5) whenever (1.0.0) chronic (>= 0.6.3) - wicked_pdf (2.6.3) + wicked_pdf (2.8.1) activesupport wkhtmltopdf-binary (0.12.6.7) xml-simple (1.1.8) diff --git a/app/assets/stylesheets/mail.scss b/app/assets/stylesheets/mail.scss new file mode 100644 index 0000000000..e35654c0d2 --- /dev/null +++ b/app/assets/stylesheets/mail.scss @@ -0,0 +1 @@ +@import './mail/all.scss'; diff --git a/app/assets/stylesheets/mail/all.scss b/app/assets/stylesheets/mail/all.scss new file mode 100644 index 0000000000..fa8445d726 --- /dev/null +++ b/app/assets/stylesheets/mail/all.scss @@ -0,0 +1,3 @@ +@import '../../../webpacker/css/admin/globals/palette.scss'; +@import 'email'; +@import 'payments_list'; diff --git a/app/webpacker/css/mail/email.scss b/app/assets/stylesheets/mail/email.scss similarity index 100% rename from app/webpacker/css/mail/email.scss rename to app/assets/stylesheets/mail/email.scss diff --git a/app/webpacker/css/mail/payments_list.scss b/app/assets/stylesheets/mail/payments_list.scss similarity index 100% rename from app/webpacker/css/mail/payments_list.scss rename to app/assets/stylesheets/mail/payments_list.scss diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2f470529b2..f7787e35b9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -61,15 +61,6 @@ module ApplicationHelper classes << shopfront_layout end - def pdf_stylesheet_pack_tag(source) - if running_in_development? - options = { media: "all", host: "#{Webpacker.dev_server.host}:#{Webpacker.dev_server.port}" } - stylesheet_pack_tag(source, **options) - else - wicked_pdf_stylesheet_pack_tag(source) - end - end - def cache_with_locale(key = nil, options = {}, &block) cache(cache_key_with_locale(key, I18n.locale), options) do yield(block) diff --git a/app/views/layouts/mailer.html.haml b/app/views/layouts/mailer.html.haml index 0a70687f14..12c654b3d1 100644 --- a/app/views/layouts/mailer.html.haml +++ b/app/views/layouts/mailer.html.haml @@ -5,7 +5,7 @@ %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ %title = Spree::Config[:site_name] - = stylesheet_pack_tag 'mail' + = stylesheet_link_tag 'mail' %body{:bgcolor => "#FFFFFF" } - unless @hide_ofn_navigation %table.head-wrap{:bgcolor => "#f2f2f2"} diff --git a/app/views/spree/admin/orders/invoice.html.haml b/app/views/spree/admin/orders/invoice.html.haml index d1dbc32264..a72e7c1fff 100644 --- a/app/views/spree/admin/orders/invoice.html.haml +++ b/app/views/spree/admin/orders/invoice.html.haml @@ -1,4 +1,4 @@ -= pdf_stylesheet_pack_tag "mail" += wicked_pdf_stylesheet_link_tag "mail" %table{:width => "100%"} %tbody diff --git a/app/views/spree/admin/orders/invoice2.html.haml b/app/views/spree/admin/orders/invoice2.html.haml index c55a1f6637..935e370d7a 100644 --- a/app/views/spree/admin/orders/invoice2.html.haml +++ b/app/views/spree/admin/orders/invoice2.html.haml @@ -1,4 +1,4 @@ -= pdf_stylesheet_pack_tag "mail" += wicked_pdf_stylesheet_link_tag "mail" %table{:width => "100%"} %tbody diff --git a/app/views/spree/admin/orders/invoice4.html.haml b/app/views/spree/admin/orders/invoice4.html.haml index bf7eee3679..f05a463b88 100644 --- a/app/views/spree/admin/orders/invoice4.html.haml +++ b/app/views/spree/admin/orders/invoice4.html.haml @@ -1,4 +1,4 @@ -= pdf_stylesheet_pack_tag "mail" += wicked_pdf_stylesheet_link_tag "mail" %table{:width => "100%"} %tbody diff --git a/app/webpacker/css/mail/all.scss b/app/webpacker/css/mail/all.scss deleted file mode 100644 index 087d2d1310..0000000000 --- a/app/webpacker/css/mail/all.scss +++ /dev/null @@ -1,3 +0,0 @@ -@import '../admin/globals/palette.scss'; -@import 'email'; -@import 'payments_list'; diff --git a/app/webpacker/packs/mail.scss b/app/webpacker/packs/mail.scss deleted file mode 100644 index d4f981e355..0000000000 --- a/app/webpacker/packs/mail.scss +++ /dev/null @@ -1 +0,0 @@ -@import "../css/mail/all.scss"; diff --git a/config/application.rb b/config/application.rb index 09d8fb5abe..a1bda0a7d5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -216,6 +216,7 @@ module Openfoodnetwork config.assets.precompile += ['web/all.js'] config.assets.precompile += ['darkswarm/all.js'] config.assets.precompile += ['shared/*'] + config.assets.precompile += ['mail.scss'] config.assets.precompile += ['*.jpg', '*.jpeg', '*.png', '*.gif' '*.svg'] # Highlight code that triggered database queries in logs. diff --git a/spec/system/admin/invoice_print_spec.rb b/spec/system/admin/invoice_print_spec.rb index ef1ac6d405..1709f934d0 100644 --- a/spec/system/admin/invoice_print_spec.rb +++ b/spec/system/admin/invoice_print_spec.rb @@ -535,10 +535,10 @@ RSpec.describe ' # header expect(page).to have_content "Item Qty" expect(page).to have_content "Weight / VOL." - expect(page).to have_content "Price Per unit (Excl. tax)" - expect(page).to have_content "Total price (Excl. tax)" + expect(page).to have_content "Price Per unit (Excl." + expect(page).to have_content "Total price (Excl." expect(page).to have_content "Tax rate" - expect(page).to have_content "Total price (Incl. tax)" + expect(page).to have_content "Total price (Incl." # first line item, no tax expect(page).to have_content Spree::Product.first.name.to_s expect(page).to have_content "($12,540.00 / kg)" # unit price @@ -639,10 +639,10 @@ RSpec.describe ' # header expect(page).to have_content "Item Qty" expect(page).to have_content "Weight / VOL." - expect(page).to have_content "Price Per unit (Excl. tax)" - expect(page).to have_content "Total price (Excl. tax)" + expect(page).to have_content "Price Per unit (Excl." + expect(page).to have_content "Total price (Excl." expect(page).to have_content "Tax rate" - expect(page).to have_content "Total price (Incl. tax)" + expect(page).to have_content "Total price (Incl." # first line item, no tax expect(page).to have_content Spree::Product.first.name.to_s expect(page).to have_content "($12,540.00 / kg)" # unit price