From 1e8fe7cc925ef514b763991251b1f01c645288d5 Mon Sep 17 00:00:00 2001 From: aravindkk Date: Mon, 26 Jan 2015 01:05:34 +0530 Subject: [PATCH 1/4] Readability of Email address on home page --- views/home.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/home.jade b/views/home.jade index 6f44a32..b2f0e8e 100644 --- a/views/home.jade +++ b/views/home.jade @@ -9,7 +9,7 @@ block content h1 ECMAScript Discussion Archives .row .col-md-8.col-md-offset-2 - p This site aims to provide an easily browsable, nicely formatted archive of all the email correspondence on the es-discuss@mozilla.org mailing list. + p This site aims to provide an easily browsable, nicely formatted archive of all the email correspondence on the #[span(style="white-space:nowrap;") es-discuss@mozilla.org] mailing list. .row .col-md-4.col-md-offset-2 a(href='/1').btn.btn-lg.btn-primary.btn-block From 70beebf4e997b71856d435a8b81120e3ab6eeea9 Mon Sep 17 00:00:00 2001 From: aravindkk Date: Mon, 26 Jan 2015 03:39:26 +0530 Subject: [PATCH 2/4] Fixed route for topics button. --- server.js | 3 ++- views/about.jade | 2 +- views/home.jade | 2 +- views/layout.jade | 2 +- views/listing.jade | 6 +++--- views/notes-listing.jade | 2 +- views/notes.jade | 2 +- views/topic.jade | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/server.js b/server.js index 3d8b0e3..6cda79b 100644 --- a/server.js +++ b/server.js @@ -62,7 +62,8 @@ app.get('/about', function (req, res, next) { }).done(null, next); }) -app.get('/:page', function (req, res, next) { +app.get('/topics/:page?', function (req, res, next) { + req.params.page = req.params.page || 1; if (!/^\d+$/.test(req.params.page)) return next(); var page = req.params.page - 1; diff --git a/views/about.jade b/views/about.jade index 8308a9f..6d87829 100644 --- a/views/about.jade +++ b/views/about.jade @@ -5,7 +5,7 @@ block title block navsections li - a(href='/1') Topics + a(href='/topics') Topics li a(href='/notes') Notes li.active diff --git a/views/home.jade b/views/home.jade index b2f0e8e..5dfd1ed 100644 --- a/views/home.jade +++ b/views/home.jade @@ -12,7 +12,7 @@ block content p This site aims to provide an easily browsable, nicely formatted archive of all the email correspondence on the #[span(style="white-space:nowrap;") es-discuss@mozilla.org] mailing list. .row .col-md-4.col-md-offset-2 - a(href='/1').btn.btn-lg.btn-primary.btn-block + a(href='/topics').btn.btn-lg.btn-primary.btn-block i.icon-list |   View Topics .col-md-4 diff --git a/views/layout.jade b/views/layout.jade index d26d4f8..d163f73 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -25,7 +25,7 @@ html ul.nav.navbar-nav block navsections li - a(href='/1') Topics + a(href='/topics') Topics li a(href='/notes') Notes li diff --git a/views/listing.jade b/views/listing.jade index 48a1529..d4c1eba 100644 --- a/views/listing.jade +++ b/views/listing.jade @@ -5,7 +5,7 @@ block title block navsections li.active - a(href='/1') Topics + a(href='/topics') Topics li a(href='/notes') Notes li @@ -22,7 +22,7 @@ mixin pagination(id) a(disabled) « Newer else li - a(href='/' + (id - 1), rel='previous') « Newer + a(href='/topics/' + (id - 1), rel='previous') « Newer li a(href=path) Page #{id} if last @@ -30,7 +30,7 @@ mixin pagination(id) a(disabled) Older » else li - a(href='/' + (id + 1), rel='next') Older » + a(href='/topics/' + (id + 1), rel='next') Older » block navigation .pull-right.hidden-xs diff --git a/views/notes-listing.jade b/views/notes-listing.jade index 5c7951b..aa6fe87 100644 --- a/views/notes-listing.jade +++ b/views/notes-listing.jade @@ -5,7 +5,7 @@ block title block navsections li - a(href='/1') Topics + a(href='/topics') Topics li.active a(href='/notes') Notes li diff --git a/views/notes.jade b/views/notes.jade index 7268f85..2a716f6 100644 --- a/views/notes.jade +++ b/views/notes.jade @@ -5,7 +5,7 @@ block title block navsections li - a(href='/1') Topics + a(href='/topics') Topics li.active a(href='/notes') Notes li diff --git a/views/topic.jade b/views/topic.jade index 5e0228a..e0a37e3 100644 --- a/views/topic.jade +++ b/views/topic.jade @@ -8,7 +8,7 @@ block scripts block navsections li.active - a(href='/1') Topics + a(href='/topics') Topics li a(href='/notes') Notes li From a70d9a8b8978a5c159708b22e564566881d28f8a Mon Sep 17 00:00:00 2001 From: aravindkk Date: Mon, 26 Jan 2015 03:48:23 +0530 Subject: [PATCH 3/4] Changed test file to test new route. --- test/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/index.js b/test/index.js index 903c5d2..842c5f2 100644 --- a/test/index.js +++ b/test/index.js @@ -33,23 +33,23 @@ function path(path, statusCode, fn) { }); } path('/', 200); -path('/1', 200, function (response) { +path('/topics', 200, function (response) { it('has a link to the next page', function () { return response .then(function (res) { - assert(/href="\/2"/.test(res.body)); + assert(/href="topics\/2"/.test(res.body)); }); }); it('has no link to the previous page', function () { return response .then(function (res) { - assert(!/href="\/0"/.test(res.body)); + assert(!/href="topics\/0"/.test(res.body)); }); }); }); -path('/100', 200); -path('/10000', 404); +path('/topics/100', 200); +path('/topics/10000', 404); path('/topic/coordinationwasesmodules', 200); path('/topic/creating-your-own-errors', 200); From 72042eb110cc54cec652dbad61a5221cc4e3ce60 Mon Sep 17 00:00:00 2001 From: aravindkk Date: Mon, 26 Jan 2015 03:57:58 +0530 Subject: [PATCH 4/4] Changed test file to test new route. --- test/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/index.js b/test/index.js index 842c5f2..78ed820 100644 --- a/test/index.js +++ b/test/index.js @@ -37,13 +37,13 @@ path('/topics', 200, function (response) { it('has a link to the next page', function () { return response .then(function (res) { - assert(/href="topics\/2"/.test(res.body)); + assert(/href="\/topics\/2"/.test(res.body)); }); }); it('has no link to the previous page', function () { return response .then(function (res) { - assert(!/href="topics\/0"/.test(res.body)); + assert(!/href="\/topics\/0"/.test(res.body)); }); }); });