Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed route to "/topics", made the E-mail address readable across devices #87

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 5 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion views/about.jade
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ block title

block navsections
li
a(href='/1') Topics
a(href='/topics') Topics
li
a(href='/notes') Notes
li.active
4 changes: 2 additions & 2 deletions views/home.jade
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ 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
a(href='/topics').btn.btn-lg.btn-primary.btn-block
i.icon-list
|   View Topics
.col-md-4
2 changes: 1 addition & 1 deletion views/layout.jade
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions views/listing.jade
Original file line number Diff line number Diff line change
@@ -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,15 +22,15 @@ 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
li.disabled
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
2 changes: 1 addition & 1 deletion views/notes-listing.jade
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ block title

block navsections
li
a(href='/1') Topics
a(href='/topics') Topics
li.active
a(href='/notes') Notes
li
2 changes: 1 addition & 1 deletion views/notes.jade
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ block title

block navsections
li
a(href='/1') Topics
a(href='/topics') Topics
li.active
a(href='/notes') Notes
li
2 changes: 1 addition & 1 deletion views/topic.jade
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ block scripts

block navsections
li.active
a(href='/1') Topics
a(href='/topics') Topics
li
a(href='/notes') Notes
li