From 51a293137f97d65ee5a33f1006f45b521d0a553e Mon Sep 17 00:00:00 2001 From: Putnam14 Date: Fri, 26 Jan 2018 23:38:19 -0800 Subject: [PATCH] Ad placement changes, Title to WPM/speed panel --- .gitignore | 3 +++ app.js | 4 ++-- routes/index.js | 8 +------- views/ad.html | 1 + views/books.jade | 30 +++++++++++++----------------- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 4796c66..23b3980 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ config.js views/belowSpeedAd.html views/ad.html +views/ad.html +views/aboveDescAd.html +views/ad.html diff --git a/app.js b/app.js index 3f8072d..7475811 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,6 @@ var express = require('express'); var path = require('path'); -var logger = require('morgan'); +//var logger = require('morgan'); var cookieParser = require('cookie-parser'); var expressSanitizer = require('express-sanitizer'); var bodyParser = require('body-parser'); @@ -14,7 +14,7 @@ app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); //Test -app.use(logger('dev')); +//app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(expressSanitizer()); diff --git a/routes/index.js b/routes/index.js index 6fc9fb0..897e87c 100644 --- a/routes/index.js +++ b/routes/index.js @@ -48,8 +48,6 @@ router.get('/book/isbn-:urlISBN/?', function(req, res, next) { if (results == null || results.Title == null) { res.redirect('/404'); } else { - //res.status(200).send(results); //JSON - //bookSearch.getBookPrice(ISBN, function(price) { var WPM = config.wordsPerMinuteReading; var estMin = (results.Wordcount / WPM); var avgEstHr = Math.floor(estMin / 60); @@ -91,7 +89,6 @@ router.get('/book/isbn-:urlISBN/?', function(req, res, next) { ISBN: results.ISBN, Title: results.Title, Author: results.Author, - //MSRP: results.MSRP, Pages: PagesC, Wordcount: WordcountC, Dot: dot, @@ -106,14 +103,11 @@ router.get('/book/isbn-:urlISBN/?', function(req, res, next) { Sim3Title: results.Sim3Title, Image: results.Image, Description: Description, - //Price: price, FeaturedMonth: config.featuredBook.month, FeaturedTitle: featured.Title, FeaturedImage: featured.Image, FeaturedISBN: featured.ISBN, - FeaturedWordcount: fWordcountC, - adsDiv: config.responsiveAdId, - adsSrc: config.responsiveAdSrc + FeaturedWordcount: fWordcountC //}); }); } diff --git a/views/ad.html b/views/ad.html index 0755ada..898fe86 100644 --- a/views/ad.html +++ b/views/ad.html @@ -1 +1,2 @@ + diff --git a/views/books.jade b/views/books.jade index c0261ba..8ac305a 100644 --- a/views/books.jade +++ b/views/books.jade @@ -4,17 +4,19 @@ block content include search .row .col-sm-10 + div(align="center") + include aboveDescAd.html .col-sm-5 .panel.panel-default .panel-heading a(href="http://www.amazon.com/dp/#{ISBN}?tag=#{ref}", style="color: inherit") - h3.panel-title.text-center #{Title} + p.panel-title.text-center #{Title} .panel-body .row - .col-sm-5.text-center + .col-sm-4.text-center a(href="http://www.amazon.com/dp/#{ISBN}?tag=#{ref}", style="color: inherit") img.img-thumbnail.img-responsive(src="#{Image}", alt="#{Title} by #{Author}") - .col-sm-7 + .col-sm-8 p #{Author} p #{ReleaseDate} p Pages: #{Pages} pages @@ -24,35 +26,29 @@ block content a(href="http://www.amazon.com/dp/#{ISBN}?tag=#{ref}", style="color: inherit") .row.text-center .col-sm-12 - -//p MSRP: #{MSRP} - -//p Current price: #{Price} (Amazon) img.img-responsive.center-block(src="/img/shopnow.png", alt="Shop for #{Title} at Amazon") .col-sm-7 .panel.panel-default + .panel-heading + p.panel-title.text-center How long will it take to read this? .panel-body - p #{avgEstHr} hours and #{avgEstMin} minutes to read #{Title} on average (#{WPM} WPM). + p The average reader will spend #{avgEstHr} hours and #{avgEstMin} minutes reading #{Title} at #{WPM} WPM (words per minute). hr .readtime.hidden#results p This should take you around hours and minutes to read! p Read for minutes each day and finish within a month! hr - p Estimate your speed + p Find out how long it will take you to read by entering your reading speed. .input-group input.form-control#WPM(name="WPM", type="number", min="1", placeholder="Enter WPM") span.input-group-btn button.btn.btn-default#calculate(onclick="calculate();") Estimate! - -//input.form-control#pagesRead(name="pagesRead", type="number", min="0", max="#{Pages}", placeholder="How many pages have you read?") - -//button.btn.btn-default#calculate(style="margin:auto", onclick="calculate();") Estimate! + //-input.form-control#pagesRead(name="pagesRead", type="number", min="0", max="#{Pages}", placeholder="How many pages have you read?") + //-button.btn.btn-default#calculate(style="margin:auto", onclick="calculate();") Estimate! .panel-footer p Find #[a(href="/wpm/", target="_blank") your reading speed by taking one of these tests] or by reading this book's description, below. - div(align="center") - include belowSpeedAd.html - .col-sm-12 - .panel.panel-default - .panel-heading.text-center.small Sponsored Links - .panel-body(align="center") - div(id="#{adsDiv}") - script(async, src="#{adsSrc}") + .col-sm-12(align="center") + include belowSpeedAd.html .col-sm-12 .panel.panel-default .panel-heading.text-center