This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs TryGhost/Ghost#7769 - Removes Google AMP option from general settings and adds it to apps instead.
- Loading branch information
1 parent
ce2301e
commit 66d882b
Showing
11 changed files
with
137 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Controller from 'ember-controller'; | ||
import injectService from 'ember-service/inject'; | ||
|
||
export default Controller.extend({ | ||
notifications: injectService(), | ||
|
||
// will be set by route | ||
settings: null, | ||
|
||
isSaving: false, | ||
|
||
actions: { | ||
update(value) { | ||
this.set('model', value); | ||
}, | ||
|
||
save() { | ||
let amp = this.get('model'); | ||
let settings = this.get('settings'); | ||
|
||
if (this.get('isSaving')) { | ||
return; | ||
} | ||
|
||
settings.set('amp', amp); | ||
|
||
this.set('isSaving', true); | ||
|
||
return settings.save().catch((err) => { | ||
this.get('notifications').showAPIError(err); | ||
throw err; | ||
}).finally(() => { | ||
this.set('isSaving', false); | ||
}); | ||
} | ||
} | ||
}); |
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,19 @@ | ||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; | ||
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings'; | ||
import styleBody from 'ghost-admin/mixins/style-body'; | ||
|
||
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { | ||
titleToken: 'Settings - Apps - AMP', | ||
|
||
classNames: ['settings-view-apps-amp'], | ||
|
||
model() { | ||
return this.modelFor('settings.apps').get('amp'); | ||
}, | ||
|
||
setupController(controller) { | ||
this._super(...arguments); | ||
|
||
controller.set('settings', this.modelFor('settings.apps')); | ||
} | ||
}); |
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="view-header"> | ||
{{#gh-view-title openMobileMenu="openMobileMenu"}}<span style="padding-left:1px">{{#link-to "settings.apps.index"}}Apps{{/link-to}} <i class="icon-arrow-right" style="display:inline"></i> AMP</span>{{/gh-view-title}} | ||
<section class="view-actions"> | ||
{{#gh-spin-button id="saveSlackIntegration" class="btn btn-green" action=(action "save") submitting=isSaving}} | ||
Save | ||
{{/gh-spin-button}} | ||
</section> | ||
</header> | ||
<section class="view-container"> | ||
<section class="view-content"> | ||
<section class="app-grid"> | ||
<div class="app-cell"> | ||
<img class="app-icon" src="{{gh-path 'admin' '/img/slackicon.png'}}" /> | ||
</div> | ||
<div class="app-cell"> | ||
<h3>AMP</h3> | ||
<p>Accelerated Mobile Pages</p> | ||
</div> | ||
</section> | ||
<section class="app-subtitle"> | ||
<p>Enable <a href="https://ampproject.org">Google Accelerated Mobile Pages</a> for your site?</p> | ||
</section> | ||
<form class="app-config-form" id="amp-settings" novalidate="novalidate"> | ||
<div class="form-group for-checkbox"> | ||
<label for="amp">AMP support for your publications</label> | ||
<label class="checkbox" for="amp"> | ||
{{one-way-checkbox model id="amp" name="amp" type="checkbox" update=(action "update")}} | ||
<span class="input-toggle-component"></span> | ||
<p>Enable AMP support</p> | ||
</label> | ||
</div> | ||
</form> | ||
|
||
</section> | ||
</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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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