From 6e6dcd06131c424c33c777e32f8e5cbbb84fff43 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 26 Aug 2017 14:27:57 +0100 Subject: [PATCH] added created time and block time to transction details page --- src/Template/Main/tx.ctp | 27 +++++++++++++++++++++++++++ webroot/css/main.css | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/src/Template/Main/tx.ctp b/src/Template/Main/tx.ctp index 6277392..e306b45 100644 --- a/src/Template/Main/tx.ctp +++ b/src/Template/Main/tx.ctp @@ -17,6 +17,33 @@

Hash ?>

+
+
+

Time Created

+
Created->format('j M Y H:i:s') . ' UTC '; ?>
+
+ +
+

Block Time

+
TransactionTime == null || strlen(trim($tx->TransactionTime)) == 0) ? 'Not yet confirmed' : + \DateTime::createFromFormat('U', $tx->TransactionTime)->format('j M Y H:i:s') . ' UTC' ?> + + TransactionTime > $tx->Created->getTimestamp()): + $diffSeconds = $tx->TransactionTime - $tx->Created->Timestamp(); + if ($diffSeconds <= 60) { + echo sprintf(' (+%s second%s)', $diffSeconds, $diffSeconds == 1 ? '' : 's'); + } else { + $diffMinutes = ceil($diffSeconds / 60); + echo sprintf(' (+%s minute%s)', $diffMinutes, $diffMinutes == 1 ? '' : 's'); + } + ?> + +
+
+ +
+
+
Amount (LBC)
diff --git a/webroot/css/main.css b/webroot/css/main.css index 79ccec4..c97c83c 100644 --- a/webroot/css/main.css +++ b/webroot/css/main.css @@ -195,6 +195,10 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi .tx-head h3 { font-size: 200%; margin-bottom: 3px } .tx-head h4 { font-size: 125% } +.tx-time { width: 1200px; margin: 0 auto 32px auto; font-weight: 300 } +.tx-time h3 { font-size: 105%; margin: 0; margin-bottom: 4px; font-weight: normal; cursor: help; border-bottom: 1px dotted #999; display: inline-block } +.tx-time .created-time, .tx-time .conf-time { float: left; width: 25% } + .realtime-head { width: 1200px; margin: 0 auto 36px auto; cursor: default } .realtime-head h3 { font-weight: 300; margin: 0; font-size: 200% } .realtime-main { width: 1200px; margin: 0 auto 0 auto }