2023-06-07 14:35:31 +00:00
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Quotations" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "breadcrumbs" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.QuotesIndexPage*/ -}}
|
Remove almost all data-hx-boost attributes
Since 16e80b5ae, <body> no longer has overflow, thus no scroll. As a
consequence, htmx no longer is able to scroll up <main> when it changes
due to the default, implicit `show:true` applied to the request: is
calls <main>’s scrollIntoView, however there is nothing to scroll to.
I probably could fix it by changing the target of `show`, or even add
a `scroll` directive to all boosted links, but at this point i think it
is better no not boost links at all, as they do what i want—show the new
page from the top—with less markup, plus the browser now show a loading
animation, and it is not that slower, too.
2024-09-07 23:29:30 +00:00
|
|
|
<nav>
|
|
|
|
<p>
|
2023-06-07 14:35:31 +00:00
|
|
|
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
|
|
|
|
<a>{{( pgettext "Quotations" "title" )}}</a>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<form id="batch-form" action="{{ companyURI "/quotes/batch" }}" method="post">
|
|
|
|
{{ csrfToken }}
|
Add option to export the list of quotes, invoices, and expenses to ODS
This was requested by a potential user, as they want to be able to do
whatever they want to do to these lists with a spreadsheet.
In fact, they requested to be able to export to CSV, but, as always,
using CSV is a minefield because of Microsoft: since their Excel product
is fucking unable to write and read CSV from different locales, even if
using the same exact Excel product, i can not also create a CSV file
that is guaranteed to work on all locales. If i used the non-standard
sep=; thing to tell Excel that it is a fucking stupid application, then
proper applications would show that line as a row, which is the correct
albeit undesirable behaviour.
The solution is to use a spreadsheet file format that does not have this
issue. As far as I know, by default Excel is able to read XLSX and ODS
files, but i refuse to use the artificially complex, not the actually
used in Excel, and lobbied standard that Microsoft somehow convinced ISO
to publish, as i am using a different format because of the mess they
made, and i do not want to bend over in front of them, so ODS it is.
ODS is neither an elegant or good format by any means, but at least i
can write them using simple strings, because there is no ODS library
in Debian and i am not going to write yet another DEB package for an
overengineered package to write a simple table—all i want is to say
“here are these n columns, and these m columns; have a good day!”.
Part of #51.
2023-07-18 11:29:36 +00:00
|
|
|
{{ with .Filters }}
|
|
|
|
{{ template "hidden-field" .Customer }}
|
|
|
|
{{ template "hidden-select-field" .QuoteStatus }}
|
|
|
|
{{ template "hidden-field" .FromDate }}
|
|
|
|
{{ template "hidden-field" .ToDate }}
|
|
|
|
{{ template "hidden-field" .QuoteNumber }}
|
|
|
|
{{ template "hidden-field" .Tags }}
|
|
|
|
{{ template "hidden-field" .TagsCondition }}
|
|
|
|
{{ end }}
|
2023-06-07 14:35:31 +00:00
|
|
|
<p>
|
|
|
|
{{ template "filters-toggle" }}
|
|
|
|
<button type="submit"
|
|
|
|
name="action" value="download"
|
|
|
|
>{{( pgettext "Download quotations" "action" )}}</button>
|
Add option to export the list of quotes, invoices, and expenses to ODS
This was requested by a potential user, as they want to be able to do
whatever they want to do to these lists with a spreadsheet.
In fact, they requested to be able to export to CSV, but, as always,
using CSV is a minefield because of Microsoft: since their Excel product
is fucking unable to write and read CSV from different locales, even if
using the same exact Excel product, i can not also create a CSV file
that is guaranteed to work on all locales. If i used the non-standard
sep=; thing to tell Excel that it is a fucking stupid application, then
proper applications would show that line as a row, which is the correct
albeit undesirable behaviour.
The solution is to use a spreadsheet file format that does not have this
issue. As far as I know, by default Excel is able to read XLSX and ODS
files, but i refuse to use the artificially complex, not the actually
used in Excel, and lobbied standard that Microsoft somehow convinced ISO
to publish, as i am using a different format because of the mess they
made, and i do not want to bend over in front of them, so ODS it is.
ODS is neither an elegant or good format by any means, but at least i
can write them using simple strings, because there is no ODS library
in Debian and i am not going to write yet another DEB package for an
overengineered package to write a simple table—all i want is to say
“here are these n columns, and these m columns; have a good day!”.
Part of #51.
2023-07-18 11:29:36 +00:00
|
|
|
<button type="submit"
|
|
|
|
name="action" value="export"
|
|
|
|
>{{( pgettext "Export list" "action" )}}</button>
|
Remove almost all data-hx-boost attributes
Since 16e80b5ae, <body> no longer has overflow, thus no scroll. As a
consequence, htmx no longer is able to scroll up <main> when it changes
due to the default, implicit `show:true` applied to the request: is
calls <main>’s scrollIntoView, however there is nothing to scroll to.
I probably could fix it by changing the target of `show`, or even add
a `scroll` directive to all boosted links, but at this point i think it
is better no not boost links at all, as they do what i want—show the new
page from the top—with less markup, plus the browser now show a loading
animation, and it is not that slower, too.
2024-09-07 23:29:30 +00:00
|
|
|
<a class="primary button"
|
2023-06-07 14:35:31 +00:00
|
|
|
href="{{ companyURI "/quotes/new" }}">{{( pgettext "New quotation" "action" )}}</a>
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
</nav>
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.QuotesIndexPage*/ -}}
|
|
|
|
<form class="filters" method="GET" action="{{ companyURI "/quotes"}}"
|
|
|
|
data-hx-target="main" data-hx-boost="true" data-hx-trigger="change,search,submit"
|
|
|
|
aria-labelledby="filters-toggle"
|
|
|
|
>
|
2023-07-16 18:56:11 +00:00
|
|
|
<fieldset>
|
|
|
|
{{ with .Filters }}
|
|
|
|
{{ template "select-field" .Customer }}
|
|
|
|
{{ template "select-field" .QuoteStatus }}
|
|
|
|
{{ template "input-field" .FromDate }}
|
|
|
|
{{ template "input-field" .ToDate }}
|
|
|
|
{{ template "input-field" .QuoteNumber }}
|
|
|
|
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
|
|
|
|
{{ template "toggle-field" .TagsCondition }}
|
|
|
|
{{ end }}
|
|
|
|
</fieldset>
|
2023-06-07 14:35:31 +00:00
|
|
|
<noscript>
|
|
|
|
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
|
|
|
|
</noscript>
|
2023-07-16 18:56:11 +00:00
|
|
|
{{ if .Filters.HasValue }}
|
|
|
|
<a href="{{ companyURI "/quotes" }}" class="button">{{( pgettext "Reset" "action" )}}</a>
|
|
|
|
{{ end }}
|
2023-06-07 14:35:31 +00:00
|
|
|
</form>
|
|
|
|
<table id="quote-list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{{( pgettext "All" "quote" )}}</th>
|
|
|
|
<th>{{( pgettext "Date" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Quotation Num." "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Customer" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Status" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Tags" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Amount" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Download" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Actions" "title" )}}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ with .Quotes }}
|
|
|
|
{{- range $quote := . }}
|
|
|
|
<tr>
|
|
|
|
{{ $title := .Number | printf (pgettext "Select quotation %v" "action") }}
|
|
|
|
<td><input type="checkbox" form="batch-form"
|
|
|
|
name="quote" value="{{ .Slug }}"
|
|
|
|
aria-label="{{ $title }}"
|
|
|
|
title="{{ $title }}"/></td>
|
|
|
|
<td>{{ .Date|formatDate }}</td>
|
Remove almost all data-hx-boost attributes
Since 16e80b5ae, <body> no longer has overflow, thus no scroll. As a
consequence, htmx no longer is able to scroll up <main> when it changes
due to the default, implicit `show:true` applied to the request: is
calls <main>’s scrollIntoView, however there is nothing to scroll to.
I probably could fix it by changing the target of `show`, or even add
a `scroll` directive to all boosted links, but at this point i think it
is better no not boost links at all, as they do what i want—show the new
page from the top—with less markup, plus the browser now show a loading
animation, and it is not that slower, too.
2024-09-07 23:29:30 +00:00
|
|
|
<td><a href="{{ companyURI "/quotes/"}}{{ .Slug }}">{{ .Number }}</a></td>
|
2023-06-07 14:35:31 +00:00
|
|
|
<td>{{ .CustomerName }}</td>
|
|
|
|
<td>
|
|
|
|
<details class="quote-status menu">
|
|
|
|
<summary class="quote-status-{{ .Status }}">{{ .StatusLabel }}</summary>
|
|
|
|
<form action="{{companyURI "/quotes/"}}{{ .Slug }}" method="POST" data-hx-boost="true">
|
|
|
|
{{ csrfToken }}
|
|
|
|
{{ putMethod }}
|
|
|
|
<input type="hidden" name="quick" value="status">
|
|
|
|
<ul role="menu">
|
|
|
|
{{- range $status, $name := $.QuoteStatuses }}
|
|
|
|
{{- if ne $status $quote.Status }}
|
|
|
|
<li role="presentation">
|
|
|
|
<button role="menuitem" type="submit"
|
|
|
|
name="quote_status" value="{{ $status }}"
|
|
|
|
class="quote-status-{{ $status }}"
|
|
|
|
>{{ $name }}</button>
|
|
|
|
</li>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
</ul>
|
|
|
|
</form>
|
|
|
|
</details>
|
|
|
|
</td>
|
|
|
|
<td data-hx-get="{{companyURI "/quotes/"}}{{ .Slug }}/tags/edit"
|
|
|
|
data-hx-target="this"
|
|
|
|
data-hx-swap="outerHTML"
|
|
|
|
>
|
|
|
|
{{- range $index, $tag := .Tags }}
|
|
|
|
{{- if gt $index 0 }}, {{ end -}}
|
|
|
|
{{ . }}
|
|
|
|
{{- end }}
|
|
|
|
</td>
|
|
|
|
<td class="numeric">{{ .Total|formatPrice }}</td>
|
|
|
|
<td class="quote-download"><a href="{{ companyURI "/quotes/"}}{{ .Slug }}.pdf"
|
2023-06-20 09:33:28 +00:00
|
|
|
download="{{ .Number}}.pdf"
|
|
|
|
title="{{( pgettext "Download quotation" "action" )}}"
|
|
|
|
aria-label="{{( pgettext "Download quotation" "action" )}}"><i
|
2023-06-07 14:35:31 +00:00
|
|
|
class="ri-download-line"></i></a></td>
|
|
|
|
<td class="actions">
|
|
|
|
<details class="menu">
|
2023-07-06 09:49:36 +00:00
|
|
|
{{- $label := .Number | printf (gettext "Actions for quote %s") -}}
|
|
|
|
<summary aria-label="{{ $label }}"><i class="ri-more-line"></i></summary>
|
2023-06-07 14:35:31 +00:00
|
|
|
<ul role="menu" class="action-menu">
|
|
|
|
<li role="presentation">
|
Remove almost all data-hx-boost attributes
Since 16e80b5ae, <body> no longer has overflow, thus no scroll. As a
consequence, htmx no longer is able to scroll up <main> when it changes
due to the default, implicit `show:true` applied to the request: is
calls <main>’s scrollIntoView, however there is nothing to scroll to.
I probably could fix it by changing the target of `show`, or even add
a `scroll` directive to all boosted links, but at this point i think it
is better no not boost links at all, as they do what i want—show the new
page from the top—with less markup, plus the browser now show a loading
animation, and it is not that slower, too.
2024-09-07 23:29:30 +00:00
|
|
|
<a role="menuitem" href="{{ companyURI "/quotes"}}/{{ .Slug }}/edit">
|
2023-06-07 14:35:31 +00:00
|
|
|
<i class="ri-edit-line"></i>
|
|
|
|
{{( pgettext "Edit" "action" )}}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li role="presentation">
|
Remove almost all data-hx-boost attributes
Since 16e80b5ae, <body> no longer has overflow, thus no scroll. As a
consequence, htmx no longer is able to scroll up <main> when it changes
due to the default, implicit `show:true` applied to the request: is
calls <main>’s scrollIntoView, however there is nothing to scroll to.
I probably could fix it by changing the target of `show`, or even add
a `scroll` directive to all boosted links, but at this point i think it
is better no not boost links at all, as they do what i want—show the new
page from the top—with less markup, plus the browser now show a loading
animation, and it is not that slower, too.
2024-09-07 23:29:30 +00:00
|
|
|
<a role="menuitem" href="{{ companyURI "/quotes/new"}}?duplicate={{ .Slug }}">
|
2023-06-07 14:35:31 +00:00
|
|
|
<i class="ri-file-copy-line"></i>
|
|
|
|
{{( pgettext "Duplicate" "action" )}}
|
|
|
|
</a>
|
|
|
|
</li>
|
2023-06-10 18:46:03 +00:00
|
|
|
<li role="presentation">
|
Remove almost all data-hx-boost attributes
Since 16e80b5ae, <body> no longer has overflow, thus no scroll. As a
consequence, htmx no longer is able to scroll up <main> when it changes
due to the default, implicit `show:true` applied to the request: is
calls <main>’s scrollIntoView, however there is nothing to scroll to.
I probably could fix it by changing the target of `show`, or even add
a `scroll` directive to all boosted links, but at this point i think it
is better no not boost links at all, as they do what i want—show the new
page from the top—with less markup, plus the browser now show a loading
animation, and it is not that slower, too.
2024-09-07 23:29:30 +00:00
|
|
|
<a role="menuitem" href="{{ companyURI "/invoices/new"}}?quote={{ .Slug }}">
|
2023-06-10 18:46:03 +00:00
|
|
|
<i class="ri-bill-line"></i>
|
|
|
|
{{( pgettext "Create invoice" "action" )}}
|
|
|
|
</a>
|
|
|
|
</li>
|
2023-06-07 14:35:31 +00:00
|
|
|
</ul>
|
|
|
|
</details>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
{{ else }}
|
|
|
|
<tr>
|
|
|
|
<td colspan="9">{{( gettext "No quotations added yet." )}}</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
2023-06-20 09:33:28 +00:00
|
|
|
{{ if .Quotes }}
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<th scope="row" colspan="6">{{( gettext "Total" )}}</th>
|
|
|
|
<td class="numeric">{{ .TotalAmount|formatPrice }}</td>
|
|
|
|
<td colspan="2"></td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
{{ end }}
|
2023-06-07 14:35:31 +00:00
|
|
|
</table>
|
|
|
|
{{- end }}
|