Make product description use the whole width in invoices and quotes
Using only the first column from the description means that most of the time it is too narrow to be read comfortably. This commit swaps the product name, usually shorter, and the description, that now spans all columns. Part of #106.
This commit is contained in:
parent
12b3b4ad12
commit
d4dc8e00e5
|
@ -97,9 +97,11 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.invoice tbody td:first-child {
|
.invoice tbody .description td:first-child {
|
||||||
max-width: 15em;
|
padding: 0 1rem;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
text-align: justify;
|
||||||
|
hyphens: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.invoice .legal {
|
.invoice .legal {
|
||||||
|
|
|
@ -78,17 +78,11 @@
|
||||||
{{ $lastIndex := len .Products | sub 1 }}
|
{{ $lastIndex := len .Products | sub 1 }}
|
||||||
{{ range $index, $product := .Products -}}
|
{{ range $index, $product := .Products -}}
|
||||||
<tbody>
|
<tbody>
|
||||||
{{- if .Description }}
|
<tr {{ if .Description -}}
|
||||||
<tr class="name">
|
class="name"
|
||||||
<td colspan="{{ $columns }}">{{ .Name }}</td>
|
|
||||||
</tr>
|
|
||||||
{{ end -}}
|
|
||||||
<tr>
|
|
||||||
{{- if .Description }}
|
|
||||||
<td>{{ .Description }}</td>
|
|
||||||
{{- else }}
|
|
||||||
<td>{{ .Name }}</td>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
>
|
||||||
|
<td>{{ .Name }}</td>
|
||||||
<td class="numeric">{{ .Price | formatPrice }}</td>
|
<td class="numeric">{{ .Price | formatPrice }}</td>
|
||||||
{{ if $.HasDiscounts -}}
|
{{ if $.HasDiscounts -}}
|
||||||
<td class="numeric">{{ $product.Discount | formatPercent }}</td>
|
<td class="numeric">{{ $product.Discount | formatPercent }}</td>
|
||||||
|
@ -100,6 +94,11 @@
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
<td class="numeric">{{ .Total | formatPrice }}</td>
|
<td class="numeric">{{ .Total | formatPrice }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{- if .Description }}
|
||||||
|
<tr class="description">
|
||||||
|
<td colspan="{{ $columns }}">{{ .Description }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end -}}
|
||||||
{{ if (eq $index $lastIndex) }}
|
{{ if (eq $index $lastIndex) }}
|
||||||
<tr class="tfoot separator">
|
<tr class="tfoot separator">
|
||||||
<th scope="row" colspan="{{ $columns | sub 1 }}">{{( pgettext "Tax Base" "title" )}}</th>
|
<th scope="row" colspan="{{ $columns | sub 1 }}">{{( pgettext "Tax Base" "title" )}}</th>
|
||||||
|
|
|
@ -82,17 +82,11 @@
|
||||||
{{ $lastIndex := len .Products | sub 1 }}
|
{{ $lastIndex := len .Products | sub 1 }}
|
||||||
{{ range $index, $product := .Products -}}
|
{{ range $index, $product := .Products -}}
|
||||||
<tbody>
|
<tbody>
|
||||||
{{- if .Description }}
|
<tr {{ if .Description -}}
|
||||||
<tr class="name">
|
class="name"
|
||||||
<td colspan="{{ $columns }}">{{ .Name }}</td>
|
|
||||||
</tr>
|
|
||||||
{{ end -}}
|
|
||||||
<tr>
|
|
||||||
{{- if .Description }}
|
|
||||||
<td>{{ .Description }}</td>
|
|
||||||
{{- else }}
|
|
||||||
<td>{{ .Name }}</td>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
>
|
||||||
|
<td>{{ .Name }}</td>
|
||||||
<td class="numeric">{{ .Price | formatPrice }}</td>
|
<td class="numeric">{{ .Price | formatPrice }}</td>
|
||||||
{{ if $.HasDiscounts -}}
|
{{ if $.HasDiscounts -}}
|
||||||
<td class="numeric">{{ $product.Discount | formatPercent }}</td>
|
<td class="numeric">{{ $product.Discount | formatPercent }}</td>
|
||||||
|
@ -104,6 +98,11 @@
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
<td class="numeric">{{ .Total | formatPrice }}</td>
|
<td class="numeric">{{ .Total | formatPrice }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{- if .Description }}
|
||||||
|
<tr class="description">
|
||||||
|
<td colspan="{{ $columns }}">{{ .Description }}</td>
|
||||||
|
</tr>
|
||||||
|
{{- end }}
|
||||||
{{ if (eq $index $lastIndex) }}
|
{{ if (eq $index $lastIndex) }}
|
||||||
<tr class="tfoot separator">
|
<tr class="tfoot separator">
|
||||||
<th scope="row" colspan="{{ $columns | sub 1 }}">{{( pgettext "Tax Base" "title" )}}</th>
|
<th scope="row" colspan="{{ $columns | sub 1 }}">{{( pgettext "Tax Base" "title" )}}</th>
|
||||||
|
|
Loading…
Reference in New Issue