mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
c94b80dd4b
refs https://github.com/TryGhost/Team/issues/1532 - added `showHeaderName` attribute to newsletter model - added attribute toggle to the newsletter design settings form - updated newsletter preview behaviour - if both title and name are on, show name as a subtitle - if title is off but name is on, show name as main title - adjusted higher-level "show header" and "show header title" conditionals to account for the new setting
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import Model, {attr} from '@ember-data/model';
|
|
import ValidationEngine from '../mixins/validation-engine';
|
|
|
|
export default class Newsletter extends Model.extend(ValidationEngine) {
|
|
validationType = 'newsletter';
|
|
|
|
@attr name;
|
|
@attr slug;
|
|
@attr description;
|
|
|
|
@attr senderName;
|
|
@attr senderEmail;
|
|
@attr({defaultValue: 'newsletter'}) senderReplyTo;
|
|
|
|
@attr({defaultValue: 'active'}) status;
|
|
@attr({defaultValue: ''}) recipientFilter;
|
|
@attr({defaultValue: true}) subscribeOnSignup;
|
|
@attr({defaultValue: 'members'}) visibility;
|
|
@attr({defaultValue: 0}) sortOrder;
|
|
|
|
// Design-related properties
|
|
@attr headerImage;
|
|
@attr({defaultValue: true}) showHeaderIcon;
|
|
@attr({defaultValue: true}) showHeaderTitle;
|
|
@attr({defaultValue: true}) showHeaderName;
|
|
@attr({defaultValue: 'sans_serif'}) titleFontCategory;
|
|
@attr({defaultValue: 'center'}) titleAlignment;
|
|
@attr({defaultValue: true}) showFeatureImage;
|
|
@attr({defaultValue: 'sans_serif'}) bodyFontCategory;
|
|
@attr footerContent;
|
|
@attr({defaultValue: true}) showBadge;
|
|
|
|
// HACK - not a real model attribute but a workaround for Ember Data not
|
|
// exposing meta from save responses
|
|
@attr _meta;
|
|
}
|