Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
41612f99
Commit
41612f99
authored
Jan 22, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Use handlebars template to render invoices.
parent
da6a02ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
10 deletions
+26
-10
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_html.html
..._page_module/rjs_gadget_slapos_invoice_printout_html.html
+8
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_html.xml
...b_page_module/rjs_gadget_slapos_invoice_printout_html.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_js.js
.../web_page_module/rjs_gadget_slapos_invoice_printout_js.js
+14
-6
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_js.xml
...web_page_module/rjs_gadget_slapos_invoice_printout_js.xml
+2
-2
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_html.html
View file @
41612f99
...
...
@@ -8,8 +8,16 @@
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"handlebars.js"
></script>
<script
src=
"gadget_slapos_invoice_printout.js"
></script>
<script
id=
"download-link-template"
type=
"text/x-handlebars-template"
>
<
ul
class
=
"
grid-items
"
>
<
li
><
a
class
=
"
ui-btn ui-first-child ui-btn-icon-center
"
data
-
i18n
=
"
Download Invoice
"
target
=
_blank
href
=
{{
invoice_url
}}
>
<
img
src
=
'
pdf_icon.png
'
><
/img></
a
><
/li
>
<
/ul
>
</script>
</head>
<body>
<button
data-i18n=
"loading"
type=
"submit"
class=
"responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled"
style=
"border:none;"
>
loading
</button>
</body>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_html.xml
View file @
41612f99
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.
59109.57245.24132
</string>
</value>
<value>
<string>
964.
60140.15778.40123
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1516
299235.36
</float>
<float>
1516
361248.37
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_js.js
View file @
41612f99
/*globals console, window, rJS, RSVP, loopEventListener, i18n, $*/
/*globals console, window, rJS, RSVP, loopEventListener, i18n,
Handlebars
$*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
)
{
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
);
var
gadget_klass
=
rJS
(
window
),
download_invoice_source
=
gadget_klass
.
__template_element
.
getElementById
(
"
download-link-template
"
)
.
innerHTML
,
download_invoice_template
=
Handlebars
.
compile
(
download_invoice_source
);
gadget_klass
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
...
...
@@ -19,10 +23,14 @@
.
push
(
function
(
element
)
{
return
gadget
.
getSetting
(
"
hateoas_url
"
)
.
push
(
function
(
hateoas_url
)
{
var
link
=
"
<a href=
"
+
hateoas_url
+
"
/
"
+
options
.
value
.
jio_key
+
"
/SaleInvoiceTransaction_viewSlapOSPrintout> <img src='pdf_icon.png'></img> </a>
"
;
element
.
innerHTML
=
link
;
var
link
=
hateoas_url
+
"
/
"
+
options
.
value
.
jio_key
+
"
/SaleInvoiceTransaction_viewSlapOSPrintout
"
;
element
.
innerHTML
=
download_invoice_template
({
invoice_url
:
link
});
return
element
;
});
});
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
Handlebars
));
\ No newline at end of file
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_invoice_printout_js.xml
View file @
41612f99
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.
59129.49175.45653
</string>
</value>
<value>
<string>
964.
60112.26500.11690
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15163
00442.85
</float>
<float>
15163
60952.96
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment