Skip to content

Commit

Permalink
Fixes #118
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio Cicali committed Dec 28, 2015
1 parent 2ae0e2c commit b821a9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Version 1.6.0, December 28th, 2015
- Adds the CONTRIBUTING file
- Adds more tests
- Fixes a TOC bug (@creynold)
- Fixes #118
- Fixes a crash on a certain git configuration

Requires `npm install`
Expand Down
10 changes: 7 additions & 3 deletions lib/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ Page.prototype.fetch = function (extended) {

if (!extended) {
return Promiserr.all([this.fetchContent(),
this.fetchMetadata()]);
this.fetchMetadata(),
this.fetchHashes(1)
]);
}
else {
return Promiserr.all([this.fetchContent(),
Expand Down Expand Up @@ -344,7 +346,9 @@ Page.prototype.fetchMetadata = function () {
}.bind(this));
};

Page.prototype.fetchHashes = function () {
Page.prototype.fetchHashes = function (howmany) {

howmany = howmany || 2;

return new Promiserr(function (resolve, reject) {

Expand All @@ -353,7 +357,7 @@ Page.prototype.fetchHashes = function () {
return;
}

gitmech.hashes(this.filename, 2, function (err, hashes) {
gitmech.hashes(this.filename, howmany, function (err, hashes) {

this.lastCommand = "hashes";

Expand Down
2 changes: 1 addition & 1 deletion public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ hr {
}

.alert {
box-shadow: 0 0 5px silver;
border: 1px solid #E8E2BF;
border-radius: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion routes/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function _getWikiPage(req, res) {
if (!page.error) {

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

0 comments on commit b821a9c

Please sign in to comment.