Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #4993 - brings password protection to the frontend of blogs - modified gh-count-chars to have a max value
- Loading branch information
Showing
21 changed files
with
354 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Ember from 'ember'; | ||
|
||
var SettingsPassProtectController = Ember.Controller.extend({ | ||
|
||
actions: { | ||
save: function () { | ||
var self = this; | ||
|
||
return this.get('model').save().then(function (model) { | ||
self.notifications.closePassive(); | ||
self.notifications.showSuccess('Settings successfully saved.'); | ||
|
||
return model; | ||
}).catch(function (errors) { | ||
self.notifications.closePassive(); | ||
self.notifications.showErrors(errors); | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
export default SettingsPassProtectController; |
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,44 @@ | ||
import AuthenticatedRoute from 'ghost/routes/authenticated'; | ||
import loadingIndicator from 'ghost/mixins/loading-indicator'; | ||
import CurrentUserSettings from 'ghost/mixins/current-user-settings'; | ||
import styleBody from 'ghost/mixins/style-body'; | ||
|
||
var SettingsPassProtectRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, { | ||
classNames: ['settings-view-pass'], | ||
|
||
beforeModel: function () { | ||
var feature = this.controllerFor('feature'), | ||
self = this; | ||
|
||
if (!feature) { | ||
this.generateController('feature'); | ||
feature = this.controllerFor('feature'); | ||
} | ||
|
||
return this.currentUser() | ||
.then(this.transitionAuthor()) | ||
.then(this.transitionEditor()) | ||
.then(function () { | ||
return feature.then(function () { | ||
if (!feature.get('passProtectUI')) { | ||
return self.transitionTo('settings.general'); | ||
} | ||
}); | ||
}); | ||
}, | ||
|
||
model: function () { | ||
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) { | ||
return records.get('firstObject'); | ||
}); | ||
}, | ||
|
||
actions: { | ||
save: function () { | ||
this.get('controller').send('save'); | ||
} | ||
} | ||
|
||
}); | ||
|
||
export default SettingsPassProtectRoute; |
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,35 @@ | ||
<header class="settings-view-header"> | ||
{{#link-to "settings" class="btn btn-default btn-back"}}Back{{/link-to}} | ||
<h2 class="page-title">Password protect your blog</h2> | ||
<section class="page-actions"> | ||
<button type="button" class="btn btn-blue" {{action "save"}}>Save</button> | ||
</section> | ||
</header> | ||
|
||
<section class="content settings-pass"> | ||
<form id="settings-pass" novalidate="novalidate"> | ||
<fieldset> | ||
<div class="form-group"> | ||
<p> | ||
Ghost allows you to set a password for the front-end of your blog. Users that go to your site will be asked to enter a password, and upon correct password entry, they will be able to view your blog. | ||
</p> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="protected-password">Password</label> | ||
{{input id="protected-password" name="passProtect[protectionPassword]" type="text" value=model.password}} | ||
<p>The password visitors will enter to see your blog</p> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="protected-message">Message</label> | ||
{{textarea id="protected-message" name="passProtect[protectionMessage]" value=model.message}} | ||
<p> | ||
A message to display to people who visit your blog | ||
{{gh-count-characters protectionMessage 2000}} | ||
</p> | ||
</div> | ||
|
||
</fieldset> | ||
</form> | ||
</section> |
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,5 @@ | ||
import BaseView from 'ghost/views/settings/content-base'; | ||
|
||
var SettingsGeneralView = BaseView.extend(); | ||
|
||
export default SettingsGeneralView; |
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
Oops, something went wrong.