summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-01-12 14:21:46 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-01-12 14:21:46 +0100
commit2d41f91e2b07d8d6453c95ef01709c860063c6e1 (patch)
treea946279b55568bb36e4673e7688a3399411ffbe4
parent82430fdb89e2f5b589c36d7b0cdb1922ad10e11d (diff)
downloadbackoffice-2d41f91e2b07d8d6453c95ef01709c860063c6e1.tar.gz
backoffice-2d41f91e2b07d8d6453c95ef01709c860063c6e1.tar.bz2
backoffice-2d41f91e2b07d8d6453c95ef01709c860063c6e1.zip
conditional export
-rw-r--r--Makefile.in2
-rw-r--r--js/backoffice.js9
-rw-r--r--js/test/main.js8
-rw-r--r--talerbackoffice/backoffice/templates/backoffice.html2
4 files changed, 13 insertions, 8 deletions
diff --git a/Makefile.in b/Makefile.in
index 56e4e1f..b3c330f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -31,7 +31,7 @@ install-js:
@cp js/*.js talerbackoffice/backoffice/static
.PHONY: install-data
-install-data: $(templates)
+install-data: $(templates) install-js
@$(INSTALL_DATA) -Dt $(prefix)/share/taler/ backoffice.wsgi
# @test -n "$$(ls -A talerbank/app/static/web-common/)" || \
diff --git a/js/backoffice.js b/js/backoffice.js
index fc00f77..400c97e 100644
--- a/js/backoffice.js
+++ b/js/backoffice.js
@@ -136,7 +136,7 @@ function make_marker(wtid){
* 'cb' is a UI transforming function. Typically, it is set to
* 'fill_table()'.
*/
-module.exports.track_transfer = function(exchange, wtid, cb){
+var track_transfer = function(exchange, wtid, cb){
var qs = `/track/transfer?` +
`exchange=${exchange}&` +
`wtid=${wtid}&` +
@@ -161,13 +161,12 @@ module.exports.track_transfer = function(exchange, wtid, cb){
req.send();
}
-
/**
* Call /track/order API offered by the frontend. Once data
* arrives it calls a UI routine which fills the "entries table"
* in the page.
*/
-module.exports.track_order = function(order_id, cb){
+var track_order = function(order_id, cb){
var req = new XMLHttpRequest();
var url = `/track/order?` +
`order_id=${order_id}&` +
@@ -518,3 +517,7 @@ document.onkeydown = function(e) {
close_popup();
}
}
+
+if (module.exports)
+ module.exports.track_transfer = track_transfer;
+ module.exports.track_order = track_order;
diff --git a/js/test/main.js b/js/test/main.js
index cda4c9f..d54f69f 100644
--- a/js/test/main.js
+++ b/js/test/main.js
@@ -66,11 +66,13 @@ ava.test("Tracking a wire transfer", (t) => {
execution_time: "/Date(0)/"};
var cb = sinon.spy();
- t.context.bo.track_transfer("http://exchange.mock/", "mock-wtid", cb);
+ t.context.bo.track_transfer
+ ("http://exchange.mock/", "mock-wtid", cb);
t.context.requests[0].respond(200, "application/json",
JSON.stringify(mock_tracks));
- sinon.assert.calledWith(cb, true, mock_tracks.deposits_sums,
- mock_tracks.execution_time, "mock-wtid");
+ sinon.assert.calledWith
+ (cb, true, mock_tracks.deposits_sums,
+ mock_tracks.execution_time, "mock-wtid");
t.pass();
});
diff --git a/talerbackoffice/backoffice/templates/backoffice.html b/talerbackoffice/backoffice/templates/backoffice.html
index 873c961..6c4a21e 100644
--- a/talerbackoffice/backoffice/templates/backoffice.html
+++ b/talerbackoffice/backoffice/templates/backoffice.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "templates/base.html" %}
{% block main %}
<h1>Backoffice</h1>
<p>This page simulates a backoffice facility. Through it,