Skip to content

Commit

Permalink
Merge pull request #11803 from rioug/11801-remove-raw-from-email-temp…
Browse files Browse the repository at this point in the history
…late

Remove raw from various template
  • Loading branch information
drummer83 authored Dec 22, 2023
2 parents ffbdb17 + 502df3d commit 5f7760c
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion app/helpers/spree/admin/navigation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def button_link_to(text, url, html_options = {})
if html_options[:icon]
html_options[:class] += " #{html_options[:icon]}"
end
link_to(text_for_button_link(text, html_options), url, html_options)
link_to(text, url, html_options)
end
end

Expand Down
45 changes: 23 additions & 22 deletions app/views/producer_mailer/order_cycle_report.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
- @grouped_line_items.each_pair do |product_and_full_name, line_items|
%tr
%td
#{line_items.first.variant.sku}
= line_items.first.variant.sku
- if @distributors_pickup_times.many?
%td
#{raw(line_items.first.product.supplier.name)}
= line_items.first.product.supplier.name
%td
#{raw(product_and_full_name)}
= product_and_full_name
%td.text-right
#{line_items.sum(&:quantity)}
= line_items.sum(&:quantity)
%td.text-right
#{line_items.first.single_money}
= line_items.first.single_money
%td.text-right
#{Spree::Money.new(line_items.sum(&:total), currency: line_items.first.currency) }
= Spree::Money.new(line_items.sum(&:total), currency: line_items.first.currency)
%td.tax.text-right
#{Spree::Money.new(line_items.sum(&:included_tax), currency: line_items.first.currency) }
= Spree::Money.new(line_items.sum(&:included_tax), currency: line_items.first.currency)
%tr.total-row
%td
- if @distributors_pickup_times.many?
Expand All @@ -59,9 +59,9 @@
%td
%td
%td.text-right
#{@total}
= @total
%td.text-right
#{@tax_total}
= @tax_total
- if @customer_line_items
%p
= t :producer_mail_order_customer_text
Expand All @@ -85,33 +85,34 @@
- @customer_line_items.each do |line_item|
%tr
%td
#{line_item[:sku]}
= line_item[:sku]
- if @distributors_pickup_times.many?
%td
#{raw(line_item[:supplier_name])}
= line_item[:supplier_name]
%td
#{raw(line_item[:product_and_full_name])}
= line_item[:product_and_full_name]
%td.text-right
#{line_item[:quantity]}
= line_item[:quantity]
%td
#{raw(line_item[:first_name])}
= line_item[:first_name]
%td
#{raw(line_item[:last_name])}
= line_item[:last_name]
%p
= t :producer_mail_text_after
%p
#{t(:producer_mail_signoff)},
= t(:producer_mail_signoff)
,
%em
%p
#{@coordinator.name}
= @coordinator.name
%p
%br
#{@coordinator.address.address1}
= @coordinator.address.address1
%br
#{@coordinator.address.city}
= @coordinator.address.city
%br
#{@coordinator.address.zipcode}
= @coordinator.address.zipcode
%p
#{@coordinator.phone}
= @coordinator.phone
%p
#{@coordinator.contact.email}
= @coordinator.contact.email
2 changes: 1 addition & 1 deletion app/views/shared/_page_alert.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- if ContentConfig.home_page_alert_html.present?
.alert-cta
%h6= raw ContentConfig.home_page_alert_html
%h6= sanitize(ContentConfig.home_page_alert_html, scrubber: TrixScrubber.new)

- else
= render "shared/register_call"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%h5.inline-header
= "#{raw(line_item.variant.product.name)}"
= line_item.variant.product.name
- unless line_item.variant.product.name.include? line_item.name_to_display
%span= "- #{raw(line_item.name_to_display)}"
%span= "- #{line_item.name_to_display}"
- if line_item.unit_price_price_and_unit
= raw("(#{line_item.unit_price_price_and_unit})")
= raw("(#{line_item.unit_price_price_and_unit})")
4 changes: 2 additions & 2 deletions app/views/spree/admin/orders/_invoice_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
= render 'spree/shared/line_item_name', line_item: item
%br
%small
%em= raw(item.variant.product.supplier.name)
%em= item.variant.product.supplier.name
%td{:align => "right"}
= item.quantity
%td{:align => "right"}
Expand All @@ -28,7 +28,7 @@
- taxable = adjustment.adjustable_type == "Spree::Shipment" ? adjustment.adjustable : adjustment
%tr
%td
%strong= "#{raw(adjustment.label)}"
%strong= adjustment.label
%td{:align => "right"}
1
%td{:align => "right"}
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/admin/orders/_invoice_table2.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
= render 'spree/shared/line_item_name', line_item: item
%br
%small
%em= raw(item.variant.product.supplier.name)
%em= item.variant.product.supplier.name
%td{:align => "right"}
= item.quantity
%td{:align => "right"}
Expand All @@ -33,7 +33,7 @@
- checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
%tr
%td
%strong= "#{raw(adjustment.label)}"
%strong= adjustment.label
%td{:align => "right"}
%td{:align => "right"}
%td{:align => "right"}
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/admin/orders/_invoice_table4.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
= render 'spree/admin/orders/_invoice/line_item_name', line_item: item
%br
%small
%em= raw(item.variant.product.supplier.name)
%em= item.variant.product.supplier.name
%td{:align => "right"}
= item.quantity
%td{:align => "right"}
Expand Down Expand Up @@ -51,7 +51,7 @@
- @order.checkout_adjustments(exclude: [:line_item, :shipment]).reverse_each do |adjustment|
%tr
%td
%strong= "#{raw(adjustment.label)}"
%strong= adjustment.label
%td{:align => "right"}
%td{:align => "right"}
%td{:align => "right"}
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/order_mailer/_order_summary.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
= render 'spree/shared/line_item_name', line_item: item
%br
%small
%em= raw(item.variant.product.supplier.name)
%em= item.variant.product.supplier.name
%td
- if item.variant.sku.blank?
\-
Expand All @@ -43,7 +43,7 @@
- checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
%tr
%td{align: "right", colspan: "3"}
= "#{raw(adjustment.label)}:"
= "#{adjustment.label}:"
%td{align: "right"}
= adjustment.display_amount
%tr
Expand Down
6 changes: 3 additions & 3 deletions app/views/spree/shared/_line_item_name.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%h5.inline-header
= "#{raw(line_item.product.name)}"
= "#{line_item.product.name}"
- unless line_item.product.name.include? line_item.name_to_display
%span= "- #{raw(line_item.name_to_display)}"
%span= "- #{line_item.name_to_display}"
- if line_item.options_text
= "(#{raw(line_item.options_text)})"
= "(#{line_item.options_text})"

0 comments on commit 5f7760c

Please sign in to comment.