From 79a746a25427f7384d939b225270461e450f1623 Mon Sep 17 00:00:00 2001 From: Katharina Irrgang Date: Thu, 5 Oct 2017 11:59:14 +0200 Subject: [PATCH] Display private RSS feed url in general settings (#888) refs https://github.com/TryGhost/Ghost/issues/9001 - show private feed url if private blogging is enabled - added a `.avoid-break-out` CSS utility class to prevent layout issues caused by non-breaking text such as long links --- .../admin/app/controllers/settings/general.js | 7 +++++ ghost/admin/app/models/setting.js | 1 + ghost/admin/app/styles/patterns/global.css | 10 +++++++ .../admin/app/templates/settings/general.hbs | 27 +++++++++++++------ 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/ghost/admin/app/controllers/settings/general.js b/ghost/admin/app/controllers/settings/general.js index d820cf9190..8e95baeb89 100644 --- a/ghost/admin/app/controllers/settings/general.js +++ b/ghost/admin/app/controllers/settings/general.js @@ -48,6 +48,13 @@ export default Controller.extend({ } }), + privateRSSUrl: computed('config.blogUrl', 'model.publicHash', function () { + let blogUrl = this.get('config.blogUrl'); + let publicHash = this.get('model.publicHash'); + + return `${blogUrl}/${publicHash}/rss`; + }), + _deleteTheme() { let theme = this.get('store').peekRecord('theme', this.get('themeToDelete').name); diff --git a/ghost/admin/app/models/setting.js b/ghost/admin/app/models/setting.js index 5358880b28..46f77b228e 100644 --- a/ghost/admin/app/models/setting.js +++ b/ghost/admin/app/models/setting.js @@ -22,6 +22,7 @@ export default Model.extend(ValidationEngine, { labs: attr('string'), navigation: attr('navigation-settings'), isPrivate: attr('boolean'), + publicHash: attr('string'), password: attr('string'), slack: attr('slack-settings'), amp: attr('boolean'), diff --git a/ghost/admin/app/styles/patterns/global.css b/ghost/admin/app/styles/patterns/global.css index 8af157b93d..059f8baee8 100644 --- a/ghost/admin/app/styles/patterns/global.css +++ b/ghost/admin/app/styles/patterns/global.css @@ -436,6 +436,16 @@ img { display: flex; } +.avoid-break-out { + overflow-wrap: break-word; + word-wrap: break-word; + + word-break: break-all; + word-break: break-word; + + hyphens: auto; +} + /* Animations /* ---------------------------------------------------------- */ diff --git a/ghost/admin/app/templates/settings/general.hbs b/ghost/admin/app/templates/settings/general.hbs index 2114c9ad10..4e04a884af 100644 --- a/ghost/admin/app/templates/settings/general.hbs +++ b/ghost/admin/app/templates/settings/general.hbs @@ -203,15 +203,26 @@
Make this site private
-
Enable protection with simple shared password, All search engine optimization and social features will be disabled.
- {{#if model.isPrivate}} -
- {{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="password"}} - {{gh-input model.password name="general[password]" type="text" focusOut=(action "validate" "password" target=model) update=(action (mut model.password)) data-test-password-input=true}} - {{gh-error-message errors=model.errors property="password" data-test-password-error=true}} -

Set the password for this site

- {{/gh-form-group}} +
+ Enable protection with simple shared password, All search engine optimization and social features will be disabled. + + {{#if model.isPrivate}} + +

+ A private RSS feed is available at + {{privateRSSUrl}} +
+ {{/if}}
+ + {{#if model.isPrivate}} +
+ {{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="password"}} + {{gh-input model.password name="general[password]" type="text" focusOut=(action "validate" "password" target=model) update=(action (mut model.password)) data-test-password-input=true}} + {{gh-error-message errors=model.errors property="password" data-test-password-error=true}} +

Set the password for this site

+ {{/gh-form-group}} +
{{/if}}