mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
94581a87f8
no-issue This adds three initial customisation options for newsletters: 1. Show/Hide site title and logo 2. Set font to serif/sans serif 3. Display a publish with Ghost badge This is the first step in allowing customisation of the look and feel of newsletters. Co-authored-by: Rish <zrishabhgarg@gmail.com> Co-authored-by: Peter Zimon <zimo@ghost.org>
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
import ModalComponent from 'ghost-admin/components/modal-base';
|
|
import {inject as service} from '@ember/service';
|
|
import {task} from 'ember-concurrency';
|
|
|
|
export default ModalComponent.extend({
|
|
settings: service(),
|
|
|
|
showHeader: true,
|
|
showSansSerif: false,
|
|
showBadge: true,
|
|
footerText: '',
|
|
|
|
init() {
|
|
this._super(...arguments);
|
|
},
|
|
|
|
actions: {
|
|
toggleShowHeader(showHeader) {
|
|
this.settings.set('newsletterShowHeader', showHeader);
|
|
},
|
|
|
|
setTypography(typography) {
|
|
if (typography === 'serif') {
|
|
this.settings.set('newsletterBodyFontCategory', 'serif');
|
|
} else {
|
|
this.settings.set('newsletterBodyFontCategory', 'sans_serif');
|
|
}
|
|
},
|
|
|
|
toggleBadge(showBadge) {
|
|
this.settings.set('newsletterShowBadge', showBadge);
|
|
},
|
|
|
|
confirm() {
|
|
return this.saveTask.perform();
|
|
},
|
|
|
|
leaveSettings() {
|
|
this.closeModal();
|
|
}
|
|
},
|
|
|
|
saveTask: task(function* () {
|
|
yield this.settings.save();
|
|
this.closeModal();
|
|
}).drop()
|
|
});
|