From 92f5d7a1bc36f778026e10f4f70e680999489289 Mon Sep 17 00:00:00 2001 From: xcps Date: Sun, 4 Feb 2018 22:47:36 +0500 Subject: [PATCH] Display block time on transaction page --- .gitignore | 3 ++- public/stylesheets/style.css | 4 ++++ routes/transaction.js | 3 ++- views/transaction.jade | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index acdd36f..bfb6c24 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules package-lock.json -config/config.json \ No newline at end of file +config/config.json +todo diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 0616f25..53678e2 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -8,6 +8,10 @@ body { margin: 0 auto 1em; } +table td { + padding-right: 1em; +} + a { color: #a7393d; } diff --git a/routes/transaction.js b/routes/transaction.js index 203c129..9b02549 100644 --- a/routes/transaction.js +++ b/routes/transaction.js @@ -11,7 +11,7 @@ router.get('/:txid', async function(req, res, next) { txid, }, include: [{ - attributes: ['hash'], + attributes: ['hash', 'time'], model: models.Block, },{ model: models.Vout, @@ -36,6 +36,7 @@ router.get('/:txid', async function(req, res, next) { }); }); }); + transaction.blockTime = transaction.Block.time.toUTCString(); res.render('transaction', { transaction, vouts, diff --git a/views/transaction.jade b/views/transaction.jade index 063c5a5..ea56feb 100644 --- a/views/transaction.jade +++ b/views/transaction.jade @@ -11,6 +11,9 @@ block content td Block td a(href='/block/#{transaction.Block.hash}/') #{transaction.Block.hash} + tr + td Block time + td #{transaction.blockTime} h3 In if transaction.txtx.length