diff --git a/app/components/event-card.js b/app/components/event-card.js index 65e67f3a178..6e50d514859 100644 --- a/app/components/event-card.js +++ b/app/components/event-card.js @@ -8,7 +8,7 @@ export default Component.extend({ classNames: ['column'], tags: computed('event.type', 'event.topic', 'event.subTopic', function() { - const tagsOriginal = this.get('event').getProperties('type', 'topic', 'subTopic'); + const tagsOriginal = this.getProperties('event.topic.name', 'event.type.name', 'event.subTopic.name'); let tags = []; forOwn(tagsOriginal, value => { if (value && value.trim() !== '') { diff --git a/app/controllers/index.js b/app/controllers/index.js index f376d4b2f1e..7a535fd2fe5 100644 --- a/app/controllers/index.js +++ b/app/controllers/index.js @@ -1,20 +1,20 @@ import Ember from 'ember'; -import moment from 'moment'; const { Controller, computed } = Ember; export default Controller.extend({ callForSpeakersEvents: computed('model.[]', function() { - return this.get('model').filter(event => { - const callForPapers = event.get('callForPapers'); - if (callForPapers === null || !callForPapers.get('startDate') || !callForPapers.get('timezone') || !callForPapers.get('endDate')) { - return false; - } - const startDateTime = moment.tz(callForPapers.get('startDate'), callForPapers.get('timezone')); - const endDateTime = moment.tz(callForPapers.get('endDate'), callForPapers.get('timezone')); - return moment().isBetween(startDateTime, endDateTime); - }); + // return this.get('model').filter(event => { + // const callForPapers = event.get('speakersCall'); + // // console.log(callForPapers); + // if (!callForPapers|| !callForPapers.get('startDate') || !callForPapers.get('timezone') || !callForPapers.get('endDate')) { + // return false; + // } + // const startDateTime = moment.tz(callForPapers.get('startDate'), callForPapers.get('timezone')); + // const endDateTime = moment.tz(callForPapers.get('endDate'), callForPapers.get('timezone')); + // return moment().isBetween(startDateTime, endDateTime); + // }); }), actions: { diff --git a/app/models/discount-code.js b/app/models/discount-code.js index 57d71d5b93a..a855d4da3c4 100644 --- a/app/models/discount-code.js +++ b/app/models/discount-code.js @@ -24,7 +24,11 @@ export default Model.extend({ createdAt : attr('date'), tickets : hasMany('ticket'), - event : belongsTo('event'), // The event that this discount code belongs to [Form (2)] - events : hasMany('event') // The events that this discount code has been applied to [Form (1)] + event : belongsTo('event', { + inverse: 'discountCodes' + }), // The event that this discount code belongs to [Form (2)] + events: hasMany('event', { + inverse: 'discountCode' + }) // The events that this discount code has been applied to [Form (1)] }); diff --git a/app/routes/index.js b/app/routes/index.js index c60ce1bad91..7710ed32dc0 100644 --- a/app/routes/index.js +++ b/app/routes/index.js @@ -5,6 +5,20 @@ const { Route } = Ember; export default Route.extend({ model() { - return this.store.query('event', { end_time_gt: moment.utc().format('YYYY-MM-DDTHH:mm:ss'), state: 'Published' }); + return this.store.query('event', { + include : 'event_topic,event_sub_topic,event_type', + filter : [ + { + name : 'starts_at', + op : 'ge', + val : moment().toISOString() + }, + { + name : 'state', + op : 'eq', + val : 'Published' + } + ] + }); } }); diff --git a/app/serializers/event-topic.js b/app/serializers/event-topic.js index 03b95ce332a..b0b348a3321 100644 --- a/app/serializers/event-topic.js +++ b/app/serializers/event-topic.js @@ -2,6 +2,6 @@ import ApplicationSerializer from 'open-event-frontend/serializers/application'; export default ApplicationSerializer.extend({ attrs: { - subTopics: 'eventSubTopics' + subTopics: 'event-sub-topics' } }); diff --git a/app/serializers/event.js b/app/serializers/event.js index 05f26e25a80..c0062c09bc8 100644 --- a/app/serializers/event.js +++ b/app/serializers/event.js @@ -1,12 +1,11 @@ import ApplicationSerializer from 'open-event-frontend/serializers/application'; export default ApplicationSerializer.extend({ - primaryKey : 'identifier', - attrs : { - type : 'eventType', - topic : 'eventTopic', - subTopic : 'eventSubTopic', - copyright : 'eventCopyright', - externalEventUrl : 'eventUrl' + attrs: { + type : 'event-type', + topic : 'event-topic', + subTopic : 'event-sub-topic', + copyright : 'event-copyright', + externalEventUrl : 'event-url' } }); diff --git a/app/templates/components/event-card.hbs b/app/templates/components/event-card.hbs index a278a36bfb6..c4d8ae4bd2d 100644 --- a/app/templates/components/event-card.hbs +++ b/app/templates/components/event-card.hbs @@ -3,7 +3,7 @@ {{#unless device.isMobile}}
- {{widgets/safe-image src=(if event.large event.large event.placeholderUrl)}} + {{widgets/safe-image src=(if event.originalImageUrl event.originalImageUrl event.originalImageUrl)}}
{{/unless}} @@ -11,7 +11,7 @@
{{#unless isWide}} - {{widgets/safe-image src=(if event.large event.large event.placeholderUrl)}} + {{widgets/safe-image src=(if event.originalImageUrl event.originalImageUrl event.originalImageUr)}} {{/unless}} @@ -20,7 +20,7 @@ {{/smart-overflow}}
- {{moment-format event.startTime 'ddd, MMM DD HH:mm A'}} + {{moment-format event.startsAt 'ddd, MMM DD HH:mm A'}}
{{#smart-overflow class='description'}}