From a72d3a08a6830f92d23a7618233c85ecee659957 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 25 Oct 2017 17:07:59 -0700 Subject: [PATCH] added channel info to show page --- controllers/serveController.js | 1 + models/index.js | 2 +- views/partials/assetInfo.handlebars | 62 ++++++++++++++++++----------- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/controllers/serveController.js b/controllers/serveController.js index e5bbcd9f..16d5ac67 100644 --- a/controllers/serveController.js +++ b/controllers/serveController.js @@ -226,6 +226,7 @@ module.exports = { fileInfo['title'] = resolveResult.title; fileInfo['description'] = resolveResult.description; if (resolveResult.certificateId) { fileInfo['certificateId'] = resolveResult.certificateId }; + if (resolveResult.channelName) { fileInfo['channelName'] = resolveResult.channelName }; showFile(fileInfo, res); return fileInfo; }) diff --git a/models/index.js b/models/index.js index 79cf7e3b..6fccf574 100644 --- a/models/index.js +++ b/models/index.js @@ -235,7 +235,7 @@ db['getAllFreeClaims'] = (name) => { db['resolveClaim'] = (name, claimId) => { return new Promise((resolve, reject) => { db - .sequelize.query(`SELECT name, claimId, outpoint, height, address, title, description, thumbnail, certificateId FROM Claim WHERE name = '${name}' AND claimId = '${claimId}'`, { type: db.sequelize.QueryTypes.SELECT }) + .sequelize.query(`SELECT name, claimId, outpoint, height, address, title, description, thumbnail, certificateId, channelName FROM Claim WHERE name = '${name}' AND claimId = '${claimId}'`, { type: db.sequelize.QueryTypes.SELECT }) .then(result => { switch (result.length) { case 0: diff --git a/views/partials/assetInfo.handlebars b/views/partials/assetInfo.handlebars index 35611db6..e9c5431c 100644 --- a/views/partials/assetInfo.handlebars +++ b/views/partials/assetInfo.handlebars @@ -1,12 +1,28 @@ +{{#if fileInfo.channelName}} +
+
+ Channel: +
+
+{{/if}} + {{#if fileInfo.description}} -

{{fileInfo.description}}

+
+
+ Description: +
+ {{fileInfo.description}} +
+
{{/if}}