From 331b0c9764ff1867285833157ace0f40a34b3a79 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Fri, 27 Oct 2017 09:59:31 -0700 Subject: [PATCH] updated logo --- controllers/statsController.js | 73 ------------------- public/assets/css/general.css | 3 +- routes/api-routes.js | 1 - routes/page-routes.js | 19 +---- views/channel.handlebars | 5 +- views/layouts/main.handlebars | 2 + views/layouts/show.handlebars | 2 + views/partials/navBar.handlebars | 12 +-- .../partials/publishForm-Thumbnail.handlebars | 2 +- views/partials/releaseBanner.handlebars | 2 +- 10 files changed, 17 insertions(+), 104 deletions(-) diff --git a/controllers/statsController.js b/controllers/statsController.js index 8ece2323..b728ede6 100644 --- a/controllers/statsController.js +++ b/controllers/statsController.js @@ -69,79 +69,6 @@ module.exports = { } }); }, - getStatsSummary (startDate) { - logger.debug('retrieving request records'); - return new Promise((resolve, reject) => { - // get the raw Requests data - db.Request - .findAll({ - where: { - createdAt: { - gt: startDate, - }, - }, - }) - .then(data => { - let resultHashTable = {}; - let totalServe = 0; - let totalPublish = 0; - let totalShow = 0; - let totalCount = 0; - let totalSuccess = 0; - let totalFailure = 0; - let percentSuccess; - // summarise the data - for (let i = 0; i < data.length; i++) { - let key = data[i].action + data[i].url; - totalCount += 1; - switch (data[i].action) { - case 'SERVE': - totalServe += 1; - break; - case 'PUBLISH': - totalPublish += 1; - break; - case 'SHOW': - totalShow += 1; - break; - default: break; - } - if (resultHashTable[key]) { - resultHashTable[key]['count'] += 1; - if (data[i].result === 'success') { - resultHashTable[key]['success'] += 1; - totalSuccess += 1; - } else { - resultHashTable[key]['failure'] += 1; - totalFailure += 1; - } - } else { - resultHashTable[key] = { - action : data[i].action, - url : data[i].url, - count : 1, - success: 0, - failure: 0, - }; - if (data[i].result === 'success') { - resultHashTable[key]['success'] += 1; - totalSuccess += 1; - } else { - resultHashTable[key]['failure'] += 1; - totalFailure += 1; - } - } - } - percentSuccess = Math.round(totalSuccess / totalCount * 100); - // return results - resolve({ records: resultHashTable, totals: { totalServe, totalPublish, totalShow, totalCount, totalSuccess, totalFailure }, percentSuccess }); - }) - .catch(error => { - logger.error('sequelize error >>', error); - reject(error); - }); - }); - }, getTrendingClaims (startDate) { logger.debug('retrieving trending requests'); return new Promise((resolve, reject) => { diff --git a/public/assets/css/general.css b/public/assets/css/general.css index bcbdc752..3deed8d8 100644 --- a/public/assets/css/general.css +++ b/public/assets/css/general.css @@ -77,7 +77,7 @@ h2 { } .h2--secondary { - color: #9b9b9b; + color: lightgrey; } .h2--top { @@ -304,7 +304,6 @@ align-content-left { /* ERROR MESSAGES */ .info-message { - font-weight: bold; font-size: medium; margin: 0px; padding: 0.3em; diff --git a/routes/api-routes.js b/routes/api-routes.js index 3d1f5c1b..0e51c70c 100644 --- a/routes/api-routes.js +++ b/routes/api-routes.js @@ -130,7 +130,6 @@ module.exports = (app) => { return publish(publishParams, fileName, fileType); }) .then(result => { - // postToStats('publish', originalUrl, ip, null, null, 'success'); res.status(200).json({ success: true, message: { diff --git a/routes/page-routes.js b/routes/page-routes.js index 9f64941e..a752c709 100644 --- a/routes/page-routes.js +++ b/routes/page-routes.js @@ -1,5 +1,5 @@ const errorHandlers = require('../helpers/errorHandlers.js'); -const { postToStats, getStatsSummary, getTrendingClaims, getRecentClaims } = require('../controllers/statsController.js'); +const { getTrendingClaims, getRecentClaims } = require('../controllers/statsController.js'); module.exports = (app) => { // route to log out @@ -52,23 +52,6 @@ module.exports = (app) => { errorHandlers.handleRequestError(null, null, null, error, res); }); }); - // route to show statistics for spee.ch - app.get('/stats', ({ ip, originalUrl, user }, res) => { - // get and render the content - const startDate = new Date(); - startDate.setDate(startDate.getDate() - 1); - getStatsSummary(startDate) - .then(result => { - postToStats('show', originalUrl, ip, null, null, 'success'); - res.status(200).render('statistics', { - user, - result, - }); - }) - .catch(error => { - errorHandlers.handleRequestError(null, null, null, error, res); - }); - }); // route to send embedable video player (for twitter) app.get('/embed/:claimId/:name', ({ params }, res) => { const claimId = params.claimId; diff --git a/views/channel.handlebars b/views/channel.handlebars index 9ae50276..0f81e08f 100644 --- a/views/channel.handlebars +++ b/views/channel.handlebars @@ -1,6 +1,6 @@
-

{{this.channelName}}:{{this.longChannelId}}

+

Below are the contents for {{this.channelName}}:{{this.longChannelId}}

{{#each this.claims}} {{> gridItem}} @@ -13,7 +13,7 @@ {{#if this.previousPage}} Previous {{else}} - Previous + Previous {{/if}} | {{#if this.nextPage}} @@ -43,4 +43,5 @@ }); }); + \ No newline at end of file diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index 9837366c..e4a7efc5 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -16,6 +16,8 @@ + + {{ googleAnalytics }} diff --git a/views/layouts/show.handlebars b/views/layouts/show.handlebars index b752f40d..694a4eb8 100644 --- a/views/layouts/show.handlebars +++ b/views/layouts/show.handlebars @@ -13,6 +13,8 @@ {{{addTwitterCard fileInfo.fileType openGraphInfo.source openGraphInfo.embedUrl openGraphInfo.directFileUrl}}} {{{addOpenGraph fileInfo.title fileInfo.fileType openGraphInfo.showUrl openGraphInfo.source fileInfo.description fileInfo.thumbnail}}} {{/unless}} + + {{ googleAnalytics }} diff --git a/views/partials/navBar.handlebars b/views/partials/navBar.handlebars index 4535c01b..cb403b2c 100644 --- a/views/partials/navBar.handlebars +++ b/views/partials/navBar.handlebars @@ -7,13 +7,13 @@ - Spee<h + Spee<h - - - - - + + + + + diff --git a/views/partials/publishForm-Thumbnail.handlebars b/views/partials/publishForm-Thumbnail.handlebars index 449c3016..3d582159 100644 --- a/views/partials/publishForm-Thumbnail.handlebars +++ b/views/partials/publishForm-Thumbnail.handlebars @@ -1,4 +1,4 @@ -