Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Show order line meta if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Oct 16, 2019
1 parent 3fb7ac0 commit bf2af03
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,43 +411,52 @@
</tr>
</tfoot>
<tbody>
<tr v-for="line in productLines" :key="line.id">
<td>
<template v-if="line.sku">
<a :href="productLink(line.sku)" target="_blank" :title="'View' + line.product">
{{ line.sku }}
</a>
</template>
<template v-else>
-
</template>
</td>
<td>
<template v-if="line.sku">
<a :href="productLink(line.sku)" target="_blank" :title="'View' + line.description">
{{ line.description }}
<template v-for="line in productLines" >
<tr :key="line.id">
<td>
<template v-if="line.sku">
<a :href="productLink(line.sku)" target="_blank" :title="'View' + line.product">
{{ line.sku }}
</a>
</template>
<template v-else>
{{ line.description }}
</template>
</template>
<template v-else>
-
</template>
</td>
<td>
<template v-if="line.sku">
<a :href="productLink(line.sku)" target="_blank" :title="'View' + line.description">
{{ line.description }}
</a>
</template>
<template v-else>
{{ line.description }}
</template>

</td>
<td>{{ line.option ? line.option : '-' }}</td>
<td>{{ line.quantity }}</td>
<td v-html="currencySymbol(line.unit_price)"></td>
<td>
<template v-if="line.discount_total">
<span class="text-danger" v-html="currencySymbol(-line.discount_total)"></span>
</template>
<template v-else>
-
</template>
</td>
<td><span v-if="line.tax_total">VAT @ {{ line.tax_rate }}%</span><span v-else>-</span></td>
<td v-html="currencySymbol(line.tax_total)"></td>
<td v-html="currencySymbol(line.line_total - line.discount_total)"></td>
</tr>
</td>
<td>{{ line.option ? line.option : '-' }}</td>
<td>{{ line.quantity }}</td>
<td v-html="currencySymbol(line.unit_price)"></td>
<td>
<template v-if="line.discount_total">
<span class="text-danger" v-html="currencySymbol(-line.discount_total)"></span>
</template>
<template v-else>
-
</template>
</td>
<td><span v-if="line.tax_total">VAT @ {{ line.tax_rate }}%</span><span v-else>-</span></td>
<td v-html="currencySymbol(line.tax_total)"></td>
<td v-html="currencySymbol(line.line_total - line.discount_total)"></td>
</tr>
<tr :key="`${line.id}_meta`" class="line-meta" v-if="line.meta">
<td colspan="1"></td>
<td colspan="8">
<div class="arrow"></div>
<span v-for="(value, key) in line.meta" :key="key"><strong>{{ key }}:</strong> {{ value }}</span>
</td>
</tr>
</template>
</tbody>
</table>
</div>
Expand Down
44 changes: 43 additions & 1 deletion resources/assets/sass/partials/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,47 @@
padding:20px;
}

&.line-meta {
background-color: #f5f5f5;
font-size: .875em;
padding-left: 25px;
position:relative!important;
span {
margin-left: 10px;
display:inline-block;
}
td {
padding-left: 10px;
}
.arrow {
&:after, &:before {
content: '';
display: block;
position: absolute;
top:0;
left:0;
width: 0;
height: 0;
border-style: solid;
}
&:after {
top: -1px;
left: 5px;
border-color: #fff transparent transparent transparent;
border-width: 6px;
}
&:before {
top: -1px;
left: 4px;
border-color: #ddd transparent transparent transparent;
border-width: 7px;
}
}



}

background-color:#fff;
&.sortable-ghost {
opacity: .25;
Expand Down Expand Up @@ -152,4 +193,5 @@
color:lighten($grey, 25%);
font-size:1em;
}
}
}

0 comments on commit bf2af03

Please sign in to comment.