added thumbs to @channel page

This commit is contained in:
bill bittner 2017-09-11 09:25:05 -07:00
parent df2ee1b026
commit 8a9b1ea0cf
3 changed files with 4 additions and 2 deletions

View file

@ -266,7 +266,7 @@ db['getAllChannelClaims'] = (channelId) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logger.debug(`finding all claims in channel "${channelId}"`); logger.debug(`finding all claims in channel "${channelId}"`);
db db
.sequelize.query(`SELECT name, claimId, outpoint, height, address, contentType, title, description, license FROM Claim WHERE certificateId = '${channelId}' ORDeR BY height DESC;`, { type: db.sequelize.QueryTypes.SELECT }) .sequelize.query(`SELECT name, claimId, outpoint, height, address, contentType, title, description, license, thumbnail FROM Claim WHERE certificateId = '${channelId}' ORDeR BY height DESC;`, { type: db.sequelize.QueryTypes.SELECT })
.then(result => { .then(result => {
switch (result.length) { switch (result.length) {
case 0: case 0:

View file

@ -132,6 +132,7 @@ module.exports = (app) => {
channelName, channelName,
channelContents, channelContents,
}; };
logger.debug(handlebarsData);
res.status(200).render('channel', handlebarsData); res.status(200).render('channel', handlebarsData);
} }
}) })

View file

@ -4,10 +4,11 @@
<h3>{{this.channelName}}</h3> <h3>{{this.channelName}}</h3>
<p>Below are all the free claims in this channel.</p> <p>Below are all the free claims in this channel.</p>
{{#each channelContents}} {{#each channelContents}}
<script>console.log(this)</script>
<div class="all-claims-item"> <div class="all-claims-item">
<a href="/{{this.channelName}}:{{this.shortChannelId}}/{{this.name}}.{{this.fileExtension}}"> <a href="/{{this.channelName}}:{{this.shortChannelId}}/{{this.name}}.{{this.fileExtension}}">
{{#ifConditional this.contentType '===' 'video/mp4'}} {{#ifConditional this.contentType '===' 'video/mp4'}}
<img class="all-claims-asset" src="/assets/img/content-freedom-large.png"/> <img class="all-claims-asset" src="{{this.thumbnail}}"/>
{{else}} {{else}}
<img class="all-claims-asset" src="/{{this.claimId}}/{{this.name}}.{{this.fileExtension}}" /> <img class="all-claims-asset" src="/{{this.claimId}}/{{this.name}}.{{this.fileExtension}}" />
{{/ifConditional}} {{/ifConditional}}