mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
incorporate show_customer_names_to_suppliers setting
This commit is contained in:
@@ -159,6 +159,11 @@ module Spree
|
||||
spree_current_user.can_manage_line_items_in_orders_only?
|
||||
end
|
||||
|
||||
def display_value_for_producer(order, value)
|
||||
return value unless distributor_allows_order_editing?(order)
|
||||
|
||||
order.distributor&.show_customer_names_to_suppliers ? value : t("admin.reports.hidden")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
%span.state{ class: order.shipment_state.to_s}
|
||||
= t('js.admin.orders.shipment_states.' + order.shipment_state.to_s)
|
||||
%td
|
||||
%a{ href: "mailto:#{order.email}", target: "_blank" }
|
||||
= order.email
|
||||
- email_value = display_value_for_producer(order, order.email)
|
||||
%a{ href: "mailto:#{email_value}", target: "_blank" }
|
||||
= email_value
|
||||
%td
|
||||
= order&.bill_address&.full_name_for_sorting
|
||||
= display_value_for_producer(order, order.bill_address&.full_name_for_sorting)
|
||||
%td.align-left
|
||||
%span
|
||||
= order.display_total
|
||||
|
||||
Reference in New Issue
Block a user