Skip to content

Commit b821a9c

Browse files
author
Claudio Cicali
committed
Fixes #118
1 parent 2ae0e2c commit b821a9c

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Version 1.6.0, December 28th, 2015
99
- Adds the CONTRIBUTING file
1010
- Adds more tests
1111
- Fixes a TOC bug (@creynold)
12+
- Fixes #118
1213
- Fixes a crash on a certain git configuration
1314

1415
Requires `npm install`

lib/models.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ Page.prototype.fetch = function (extended) {
256256

257257
if (!extended) {
258258
return Promiserr.all([this.fetchContent(),
259-
this.fetchMetadata()]);
259+
this.fetchMetadata(),
260+
this.fetchHashes(1)
261+
]);
260262
}
261263
else {
262264
return Promiserr.all([this.fetchContent(),
@@ -344,7 +346,9 @@ Page.prototype.fetchMetadata = function () {
344346
}.bind(this));
345347
};
346348

347-
Page.prototype.fetchHashes = function () {
349+
Page.prototype.fetchHashes = function (howmany) {
350+
351+
howmany = howmany || 2;
348352

349353
return new Promiserr(function (resolve, reject) {
350354

@@ -353,7 +357,7 @@ Page.prototype.fetchHashes = function () {
353357
return;
354358
}
355359

356-
gitmech.hashes(this.filename, 2, function (err, hashes) {
360+
gitmech.hashes(this.filename, howmany, function (err, hashes) {
357361

358362
this.lastCommand = "hashes";
359363

public/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ hr {
268268
}
269269

270270
.alert {
271-
box-shadow: 0 0 5px silver;
271+
border: 1px solid #E8E2BF;
272272
border-radius: 0;
273273
}
274274

routes/wiki.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function _getWikiPage(req, res) {
8484
if (!page.error) {
8585

8686
res.locals.canEdit = true;
87-
if (page.revision != "HEAD") {
87+
if (page.revision !== "HEAD" && page.revision != page.hashes[0]) {
8888
res.locals.warning = "You're not reading the latest revision of this page, which is " + "<a href='" + page.urlForShow() + "'>here</a>.";
8989
res.locals.canEdit = false;
9090
}

0 commit comments

Comments
 (0)