mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Updating front end order details, invoices and pdfs to display names of line_items as opposed to variants
This commit is contained in:
@@ -10,8 +10,8 @@ $headingFont: 'Oswald'
|
||||
$bodyFont: 'Roboto'
|
||||
|
||||
body
|
||||
@include bodyFont
|
||||
font-weight: 400
|
||||
@include bodyFont
|
||||
font-weight: 400
|
||||
a
|
||||
color: $clr-brick
|
||||
&:hover, &:focus, &:active
|
||||
@@ -52,7 +52,7 @@ small, .small
|
||||
|
||||
.pre-line
|
||||
white-space: pre-line
|
||||
|
||||
|
||||
.light
|
||||
color: #999
|
||||
display: inline
|
||||
@@ -66,13 +66,17 @@ small, .small
|
||||
.brick
|
||||
color: $clr-brick
|
||||
|
||||
.hr-light
|
||||
.hr-light
|
||||
border-color: rgba(#ddd, 0.25)
|
||||
|
||||
h1, h2, h3, h4, h5, h6
|
||||
@include headingFont
|
||||
padding: 0px
|
||||
|
||||
.inline-header
|
||||
display: inline-block
|
||||
margin: 0px
|
||||
|
||||
ul.bullet-list, ul.check-list
|
||||
margin: 0 0 0 1.25em !important
|
||||
li
|
||||
@@ -108,12 +112,12 @@ ul.check-list
|
||||
.footer-pad
|
||||
padding-bottom: 100px
|
||||
|
||||
|
||||
|
||||
// These selectors match the default Foundation selectors
|
||||
// For clean overriden magic
|
||||
table tr th, table tr td
|
||||
color: #333333
|
||||
table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td
|
||||
table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td
|
||||
color: #333333
|
||||
|
||||
span.email
|
||||
|
||||
@@ -66,7 +66,7 @@ table.order-summary
|
||||
padding-right: 5px
|
||||
h4
|
||||
margin-top: 15px
|
||||
tfoot
|
||||
tfoot
|
||||
tr:first-child td
|
||||
border-top: 1px solid black
|
||||
padding-top: 5px
|
||||
@@ -303,3 +303,7 @@ ul
|
||||
width: auto!important
|
||||
img.float-right
|
||||
float: none!important
|
||||
|
||||
.inline-header
|
||||
display: inline-block
|
||||
margin: 0px
|
||||
|
||||
@@ -13,14 +13,7 @@
|
||||
- @order.line_items.each do |item|
|
||||
%tr
|
||||
%td
|
||||
- if item.variant.product.name == item.variant.name_to_display
|
||||
%strong= "#{raw(item.variant.product.name)}"
|
||||
- else
|
||||
%strong
|
||||
%span= "#{raw(item.variant.product.name)}"
|
||||
%span= "- " + "#{raw(item.variant.name_to_display)}"
|
||||
- if item.variant.options_text
|
||||
= "(" + "#{raw(item.variant.options_text)}" + ")"
|
||||
= render 'spree/shared/line_item_name', line_item: item
|
||||
%td{:align => "right"}
|
||||
= item.quantity
|
||||
%td{:align => "right"}
|
||||
|
||||
@@ -11,14 +11,7 @@
|
||||
- @order.line_items.each do |item|
|
||||
%tr
|
||||
%td
|
||||
- if item.variant.product.name == item.variant.name_to_display
|
||||
%strong= "#{raw(item.variant.product.name)}"
|
||||
- else
|
||||
%strong
|
||||
%span= "#{raw(item.variant.product.name)}"
|
||||
%span= "- " + "#{raw(item.variant.name_to_display)}"
|
||||
- if item.variant.options_text
|
||||
= "(" + "#{raw(item.variant.options_text)}" + ")"
|
||||
= render 'spree/shared/line_item_name', line_item: item
|
||||
%br
|
||||
%small
|
||||
%em= raw(item.variant.product.supplier.name)
|
||||
|
||||
@@ -15,15 +15,7 @@
|
||||
- else
|
||||
= link_to image_tag(variant.images.first.attachment.url(:mini)), variant.product
|
||||
|
||||
- if variant.product.name == variant.name_to_display
|
||||
%h5
|
||||
%span= variant.product.name
|
||||
%span.text-small.text-skinny= " (" + variant.options_text + ")" unless variant.options_text.empty?
|
||||
- else
|
||||
%h5
|
||||
%span= variant.product.name
|
||||
%span= "- " + variant.name_to_display
|
||||
%span.text-small.text-skinny= " (" + variant.options_text + ")" unless variant.options_text.empty?
|
||||
= render 'spree/shared/line_item_name', line_item: line_item
|
||||
|
||||
- if @order.insufficient_stock_lines.include? line_item
|
||||
%span.out-of-stock
|
||||
|
||||
6
app/views/spree/shared/_line_item_name.html.haml
Normal file
6
app/views/spree/shared/_line_item_name.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%h5.inline-header
|
||||
= "#{raw(line_item.product.name)}"
|
||||
- unless line_item.product.name.include? line_item.name_to_display
|
||||
%span= "- #{raw(line_item.name_to_display)}"
|
||||
- if line_item.options_text
|
||||
= "(#{raw(line_item.options_text)})"
|
||||
@@ -108,15 +108,7 @@
|
||||
= link_to image_tag(item.variant.images.first.attachment.url(:mini)), item.variant.product
|
||||
|
||||
|
||||
- if item.variant.product.name == item.variant.name_to_display
|
||||
%h5
|
||||
%span= item.variant.product.name
|
||||
%span.text-small.text-skinny= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty?
|
||||
- else
|
||||
%h5
|
||||
%span= item.variant.product.name
|
||||
%span= "- " + item.variant.name_to_display
|
||||
%span.text-small.text-skinny= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty?
|
||||
= render 'spree/shared/line_item_name', line_item: item
|
||||
|
||||
%td.text-right.price{"data-hook" => "order_item_price"}
|
||||
%span= item.single_display_amount_with_adjustments.to_html
|
||||
|
||||
Reference in New Issue
Block a user