Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Theming updates for password protection
refs #4993, #5073 - Removed nonexistent helpers siteDescription and bodyClass from admin templates - Changed password.hbs to private.hbs to match the route name - added a new input_password helper for rendering the password input with the correct properties - removed the forward input as this can be handled via urls only - moved 'private' to routeKeywords - added 'private' context - minor update to text next to the password in settings
- Loading branch information
Showing
12 changed files
with
97 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// # Input Password Helper | ||
// Usage: `{{input_password}}` | ||
// | ||
// Password input used on private.hbs for password-protected blogs | ||
// | ||
// We use the name meta_title to match the helper for consistency: | ||
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers | ||
|
||
var hbs = require('express-hbs'), | ||
utils = require('./utils'), | ||
input_password; | ||
|
||
input_password = function () { | ||
var output = utils.inputTemplate({ | ||
type: 'password', | ||
name: 'password', | ||
className: 'private-login-password', | ||
extras: 'autofocus="autofocus"' | ||
}); | ||
|
||
return new hbs.handlebars.SafeString(output); | ||
}; | ||
|
||
module.exports = input_password; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*globals describe, before, it*/ | ||
/*jshint expr:true*/ | ||
var should = require('should'), | ||
hbs = require('express-hbs'), | ||
utils = require('./utils'), | ||
|
||
// Stuff we are testing | ||
handlebars = hbs.handlebars, | ||
helpers = require('../../../server/helpers'); | ||
|
||
describe('{{input_password}} helper', function () { | ||
before(function () { | ||
utils.loadHelpers(); | ||
}); | ||
|
||
it('has loaded input_password helper', function () { | ||
should.exist(handlebars.helpers.input_password); | ||
}); | ||
|
||
it('returns the correct input', function () { | ||
var markup = '<input class="private-login-password" type="password" name="password" autofocus="autofocus" />', | ||
rendered = helpers.input_password(); | ||
should.exist(rendered); | ||
|
||
String(rendered).should.equal(markup); | ||
}); | ||
}); |