Commit da6a02ed authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Add gadget for show download Link on Invoice List

parent f8109ef7
......@@ -36,6 +36,19 @@
title: "Status Date",
type: "DateTimeField"
};
}
if (1 || (result.data.rows[i].hasOwnProperty("id"))) {
value = result.data.rows[i].id;
result.data.rows[i].value.download = {
css_class: "",
description: "Download Invoice",
hidden: 0,
"default": {jio_key: value},
key: "download",
url: "gadget_slapos_invoice_printout.html",
title: "Download",
type: "GadgetField"
};
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
......@@ -73,7 +86,7 @@
['title', 'Title'],
['start_date', 'Date'],
['total_price', 'Price'],
['translated_simulation_state_title', 'State'],
['translated_simulation_state_title', 'Payment'],
['download', 'Download']
];
return form_list.render({
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.62908.46353.64494</string> </value>
<value> <string>964.59121.50434.9079</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1514389653.92</float>
<float>1516299992.78</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_slapos_invoice_printout.js"></script>
<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>
</html>
\ No newline at end of file
/*globals console, window, rJS, RSVP, loopEventListener, i18n, $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareMethod("render", function (options) {
var gadget = this;
return gadget.getElement()
.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;
return element;
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -128,5 +128,7 @@ web_page_module/rjs_tv4_min_js
web_page_module/rjs_vkbeautify_js
web_page_module/rjs_gadget_erp5_page_slap_upgrade_decision_view_js
web_page_module/rjs_gadget_erp5_page_slap_regularisation_request_view_js
web_page_module/rjs_gadget_slapos_invoice_printout_js
web_page_module/rjs_gadget_slapos_invoice_printout_html
web_site_module/hostingjs
web_site_module/hostingjs/**
\ No newline at end of file
......@@ -116,6 +116,8 @@ web_page_module/rjs_gadget_slapos_installation_status_html
web_page_module/rjs_gadget_slapos_installation_status_js
web_page_module/rjs_gadget_slapos_instance_status_html
web_page_module/rjs_gadget_slapos_instance_status_js
web_page_module/rjs_gadget_slapos_invoice_printout_html
web_page_module/rjs_gadget_slapos_invoice_printout_js
web_page_module/rjs_gadget_slapos_network_status_html
web_page_module/rjs_gadget_slapos_network_status_js
web_page_module/rjs_gadget_slapos_panel_html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment