mirror of
https://gitlab.silvrtree.co.uk/martind2000/project.git
synced 2025-01-11 04:55:09 +00:00
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
import DS from 'ember-data';
|
|
import Ember from 'ember';
|
|
|
|
export default DS.Model.extend({
|
|
page: DS.belongsTo('page'),
|
|
title: DS.attr('string'),
|
|
imageUrl: DS.attr('string'),
|
|
link1Text: DS.attr('string'),
|
|
link1Url: DS.attr('string'),
|
|
link2Text: DS.attr('string'),
|
|
link2Url: DS.attr('string'),
|
|
link3Text: DS.attr('string'),
|
|
link3Url: DS.attr('string'),
|
|
link4Text: DS.attr('string'),
|
|
link4Url: DS.attr('string'),
|
|
visibleLink1: function() {
|
|
return !((Ember.isBlank(this.get('link1Text'))) || (Ember.isBlank(this.get('link1Url'))));
|
|
}.property('link1Url','link1Text'),
|
|
visibleLink2: function() {
|
|
return !((Ember.isBlank(this.get('link2Text'))) && (Ember.isBlank(this.get('link2Url'))));
|
|
}.property('link2Url','link2Text'),
|
|
visibleLink3: function() {
|
|
return !((Ember.isBlank(this.get('link3Text'))) && (Ember.isBlank(this.get('link3Url'))));
|
|
}.property('link3Url','link3Text'),
|
|
visibleLink4: function() {
|
|
return !((Ember.isBlank(this.get('link4Text'))) && (Ember.isBlank(this.get('link4Url'))));
|
|
}.property('link4Url','link4Text'),
|
|
noImage: function() {
|
|
return Ember.isBlank(this.get('imageUrl'));
|
|
}.property('imageUrl')
|
|
});
|