added channel info to show page

This commit is contained in:
bill bittner 2017-10-25 17:07:59 -07:00
parent bfe894e2a4
commit a72d3a08a6
3 changed files with 41 additions and 24 deletions

View file

@ -226,6 +226,7 @@ module.exports = {
fileInfo['title'] = resolveResult.title; fileInfo['title'] = resolveResult.title;
fileInfo['description'] = resolveResult.description; fileInfo['description'] = resolveResult.description;
if (resolveResult.certificateId) { fileInfo['certificateId'] = resolveResult.certificateId }; if (resolveResult.certificateId) { fileInfo['certificateId'] = resolveResult.certificateId };
if (resolveResult.channelName) { fileInfo['channelName'] = resolveResult.channelName };
showFile(fileInfo, res); showFile(fileInfo, res);
return fileInfo; return fileInfo;
}) })

View file

@ -235,7 +235,7 @@ db['getAllFreeClaims'] = (name) => {
db['resolveClaim'] = (name, claimId) => { db['resolveClaim'] = (name, claimId) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
db 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 => { .then(result => {
switch (result.length) { switch (result.length) {
case 0: case 0:

View file

@ -1,12 +1,28 @@
{{#if fileInfo.channelName}}
<div class="row row--padded row--wide row--no-top">
<div class="column column--2 column--med-10">
<span class="text">Channel:</span>
</div><div class="column column--8 column--med-10">
<span class="text"><a href="/{{fileInfo.channelName}}:{{fileInfo.certificateId}}">{{fileInfo.channelName}}</a></span>
</div>
</div>
{{/if}}
{{#if fileInfo.description}} {{#if fileInfo.description}}
<p>{{fileInfo.description}}</p> <div class="row row--padded row--wide row--no-top">
<div class="column column--2 column--med-10">
<span class="text">Description:</span>
</div><div class="column column--8 column--med-10">
<span class="text">{{fileInfo.description}}</span>
</div>
</div>
{{/if}} {{/if}}
<div class="row row--wide"> <div class="row row--wide">
<div id="show-short-link"> <div id="show-short-link">
<div class="column column--2 column--sml-10"> <div class="column column--2 column--med-10">
<a class="link--primary" href="/{{fileInfo.shortId}}/{{fileInfo.name}}.{{fileInfo.fileExt}}"><span class="label">Link:</span></a> <a class="link--primary" href="/{{fileInfo.shortId}}/{{fileInfo.name}}.{{fileInfo.fileExt}}"><span class="text">Link:</span></a>
</div><div class="column column--8 column--sml-10"> </div><div class="column column--8 column--med-10">
<div class="row row--short row--wide"> <div class="row row--short row--wide">
<div class="column column--7"> <div class="column column--7">
<div class="input-error" id="input-error-copy-short-link" hidden="true"></div> <div class="input-error" id="input-error-copy-short-link" hidden="true"></div>
@ -18,9 +34,9 @@
</div> </div>
</div> </div>
<div id="show-embed-code"> <div id="show-embed-code">
<div class="column column--2 column--sml-10"> <div class="column column--2 column--med-10">
<span class="label">Embed:</span> <span class="text">Embed:</span>
</div><div class="column column--8 column--sml-10"> </div><div class="column column--8 column--med-10">
<div class="row row--short row--wide"> <div class="row row--short row--wide">
<div class="column column--7"> <div class="column column--7">
<div class="input-error" id="input-error-copy-embed-text" hidden="true"></div> <div class="input-error" id="input-error-copy-embed-text" hidden="true"></div>
@ -39,9 +55,9 @@
<div id="show-share-buttons"> <div id="show-share-buttons">
<div class="row row--padded row--wide"> <div class="row row--padded row--wide">
<div class="column column--2 column--sml-10"> <div class="column column--2 column--med-10">
<span class="label">Share:</span> <span class="text">Share:</span>
</div><div class="column column--7 column--sml-10"> </div><div class="column column--7 column--med-10">
<div class="row row--short row--wide flex-container flex-container--row flex-container--wrap"> <div class="row row--short row--wide flex-container flex-container--row flex-container--wrap">
<a class="link--primary" target="_blank" href="https://twitter.com/intent/tweet?text=https://spee.ch/{{fileInfo.shortId}}/{{fileInfo.name}}">twitter</a> <a class="link--primary" target="_blank" href="https://twitter.com/intent/tweet?text=https://spee.ch/{{fileInfo.shortId}}/{{fileInfo.name}}">twitter</a>
<a class="link--primary" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://spee.ch/{{fileInfo.shortId}}/{{fileInfo.name}}">facebook</a> <a class="link--primary" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://spee.ch/{{fileInfo.shortId}}/{{fileInfo.name}}">facebook</a>
@ -53,35 +69,35 @@
</div> </div>
<div class="row row--wide"> <div class="row row--wide">
<a class="label link--primary" id="show-details-toggle" href="#" onclick="toggleSection(event)" data-open="false" data-openlabel="[less]" data-closedlabel="[more]" data-slaveelementid="show-details">[more]</a> <a class="text link--primary" id="show-details-toggle" href="#" onclick="toggleSection(event)" data-open="false" data-openlabel="[less]" data-closedlabel="[more]" data-slaveelementid="show-details">[more]</a>
</div> </div>
<div id="show-details" class="row row--padded row--wide" hidden="true"> <div id="show-details" class="row row--padded row--wide" hidden="true">
<div id="show-claim-name"> <div id="show-claim-name">
<div class="column column--2 column--sml-10"> <div class="column column--2 column--med-10">
<span class="label">Name:</span> <span class="text">Name:</span>
</div><div class="column column--8 column--sml-10"> </div><div class="column column--8 column--med-10">
{{fileInfo.name}} {{fileInfo.name}}
</div> </div>
</div> </div>
<div id="show-claim-id"> <div id="show-claim-id">
<div class="column column--2 column--sml-10"> <div class="column column--2 column--med-10">
<span class="label">Claim Id:</span> <span class="text">Claim Id:</span>
</div><div class="column column--8 column--sml-10"> </div><div class="column column--8 column--med-10">
{{fileInfo.claimId}} {{fileInfo.claimId}}
</div> </div>
</div> </div>
<div id="show-claim-id"> <div id="show-claim-id">
<div class="column column--2 column--sml-10"> <div class="column column--2 column--med-10">
<span class="label">File Name:</span> <span class="text">File Name:</span>
</div><div class="column column--8 column--sml-10"> </div><div class="column column--8 column--med-10">
{{fileInfo.fileName}} {{fileInfo.fileName}}
</div> </div>
</div> </div>
<div id="show-claim-id"> <div id="show-claim-id">
<div class="column column--2 column--sml-10"> <div class="column column--2 column--med-10">
<span class="label">File Type:</span> <span class="text">File Type:</span>
</div><div class="column column--8 column--sml-10"> </div><div class="column column--8 column--med-10">
{{#if fileInfo.fileType}} {{#if fileInfo.fileType}}
{{fileInfo.fileType}} {{fileInfo.fileType}}
{{else}} {{else}}