From 10eb82c7c00a0a1a75528644fbfbe108a769207f Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Fri, 11 Nov 2022 22:57:19 +0530 Subject: serving created invoices as both HTML and JSON --- web/templates/invoice.html | 15 --------------- web/templates/partials/item_list.html | 4 ++-- web/templates/views/invoice.html | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 web/templates/invoice.html create mode 100644 web/templates/views/invoice.html (limited to 'web') diff --git a/web/templates/invoice.html b/web/templates/invoice.html deleted file mode 100644 index 77825fe..0000000 --- a/web/templates/invoice.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - OpenBills Testing - - - - - - - {{ template "partials/item_list.html" .}} - - diff --git a/web/templates/partials/item_list.html b/web/templates/partials/item_list.html index f12a34a..6fdd1f9 100644 --- a/web/templates/partials/item_list.html +++ b/web/templates/partials/item_list.html @@ -1,6 +1,6 @@ -{{ define "partials/item_list.html.tmpl" }} +{{ define "partials/item_list.html" }}
- {{ range .Items }} + {{ range . }} {{ template "partials/item.html" .}} {{ end }}
diff --git a/web/templates/views/invoice.html b/web/templates/views/invoice.html new file mode 100644 index 0000000..c8a3c70 --- /dev/null +++ b/web/templates/views/invoice.html @@ -0,0 +1,15 @@ + + + + + + OpenBills Testing + + + + + + + {{ template "partials/item_list.html" .Invoice.Items }} + + -- cgit v1.2.3