[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: Monospaci
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: Monospacing amount and date fonts, get rid of 'coin' column when showing /track/order results, enlarging the popup showing track results. |
Date: |
Sun, 05 Mar 2017 01:04:49 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant-frontends.
The following commit(s) were added to refs/heads/master by this push:
new ffd529c Monospacing amount and date fonts, get rid of 'coin' column
when showing /track/order results, enlarging the popup showing track results.
ffd529c is described below
commit ffd529c334ad3574eecc9f51cb7173fe6b2eb21d
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Mar 4 16:11:27 2017 +0100
Monospacing amount and date fonts, get rid of 'coin'
column when showing /track/order results, enlarging the
popup showing track results.
---
talerfrontends/blog/static/backoffice.css | 8 ++++-
talerfrontends/blog/static/backoffice.js | 46 +++++++++++++++++----------
talerfrontends/blog/templates/backoffice.html | 5 ++-
3 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/talerfrontends/blog/static/backoffice.css
b/talerfrontends/blog/static/backoffice.css
index 50139da..67167b8 100644
--- a/talerfrontends/blog/static/backoffice.css
+++ b/talerfrontends/blog/static/backoffice.css
@@ -38,6 +38,7 @@
top: 20%;
transform: translate(-50%, -50%);
display: inline-block;
+ width: 45%;
}
.popup h2 {
@@ -62,6 +63,11 @@
max-height: 30%;
overflow: auto;
display: inline-block;
+ width: 100%;
+}
+
+.track-content table {
+ width: 100%;
}
th {
@@ -92,7 +98,7 @@ th {
100% { transform: rotate(360deg); }
}
-.order-id {
+.order-id, .wtid, .amount, .date {
font-family: monospace;
font-size: 200%;
}
diff --git a/talerfrontends/blog/static/backoffice.js
b/talerfrontends/blog/static/backoffice.js
index c93fbb3..00ed53d 100644
--- a/talerfrontends/blog/static/backoffice.js
+++ b/talerfrontends/blog/static/backoffice.js
@@ -37,6 +37,19 @@ function amount_to_string(amount){
return `${number.toFixed(2)} ${amount.currency}`;
}
+function amount_sum(a1, a2){
+ if(a1.currency != a2.currency)
+ throw "Currency mismatch, terminating.";
+ var ret = {currency: a2.currency,
+ value: 0,
+ fraction: 0};
+ ret.value = a1.value + a2.value;
+ var fraction = a1.fraction + a2.fraction;
+ ret.value += Math.floor(fraction / FRACTION);
+ ret.fraction = fraction % FRACTION;
+ return ret;
+}
+
function parse_date(date){
var split = date.match(/Date\((.*)\)/);
@@ -108,24 +121,23 @@ function track_order(order_id, instance){
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null).snapshotItem(0);
+ var row = document.createElement("tr");
+ var subject = JSON.stringify({wtid: entry.wtid,
+ exchange_url: entry.exchange});
+ console.log("Subject", subject);
+ var amount = entry.coins[0].amount_with_fee;
+
+ for(var j=1; j<entry.coins.length - 1; j++)
+ amount = amount_sum(amount, entry.coins[j].amount_with_fee);
+ row.innerHTML = `<td class="wtid">
+ <a onclick='track_transfer("${entry.exchange}",
"${entry.wtid}")'
+ href="#${i}">${subject.substring(0, 20)}...</a>
+ </td>
+ <td class="amount">${amount_to_string(amount)}</td>
+ <td
class="date">${parse_date(entry.execution_time)}</td>`;
+
+ table.appendChild(row);
toggle_visible(overlay);
- for(var j=0; j<entry.coins.length; j++){
- var coin = entry.coins[j];
- var row = document.createElement("tr");
- var subject = JSON.stringify({wtid: entry.wtid,
- exchange_url: entry.exchange});
- console.log("Subject", subject);
- row.innerHTML = `<td>
- <a href="#"
- onclick='track_transfer("${entry.exchange}",
"${entry.wtid}")'>
- ${subject.substring(0, 20)}...
- </a>
- </td>
- <td>${amount_to_string(coin.amount_with_fee)}</td>
- <td>${coin.coin_pub.substring(0, 8)}...</td>
- <td>${parse_date(entry.execution_time)}</td>`;
- table.appendChild(row);
- }
}
}
if (202 == req.status){
diff --git a/talerfrontends/blog/templates/backoffice.html
b/talerfrontends/blog/templates/backoffice.html
index 13674c9..271db50 100644
--- a/talerfrontends/blog/templates/backoffice.html
+++ b/talerfrontends/blog/templates/backoffice.html
@@ -24,9 +24,8 @@
<tbody>
<tr>
<th>WTID</th>
- <th>Amount</th>
- <th>Coin</th>
- <th>Date</th>
+ <th class="amount">Amount</th>
+ <th class="date">Date</th>
</tr>
</tbody>
</table>
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant-frontends] branch master updated: Monospacing amount and date fonts, get rid of 'coin' column when showing /track/order results, enlarging the popup showing track results.,
gnunet <=