New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code to use speakers call API to the public event page #588

Merged
merged 1 commit into from Aug 5, 2017
Jump to file or symbol
Failed to load files and symbols.
+30 −24
Diff settings

Always

Just for now

@@ -2,7 +2,11 @@ import attr from 'ember-data/attr';
import ModelBase from 'open-event-frontend/models/base';
import { belongsTo } from 'ember-data/relationships';
import { v4 } from 'ember-uuid';
import Ember from 'ember';
import { computedDateTimeSplit } from 'open-event-frontend/utils/computed-helpers';
import moment from 'moment';
const { computed } = Ember;
export default ModelBase.extend({
announcement : attr('string'),
@@ -16,5 +20,13 @@ export default ModelBase.extend({
startsAtDate : computedDateTimeSplit.bind(this)('startsAt', 'date'),
startsAtTime : computedDateTimeSplit.bind(this)('startsAt', 'time'),
endsAtDate : computedDateTimeSplit.bind(this)('endsAt', 'date'),
endsAtTime : computedDateTimeSplit.bind(this)('endsAt', 'date')
endsAtTime : computedDateTimeSplit.bind(this)('endsAt', 'date'),
isOpen: computed('startsAt', 'endsAt', function() {
return moment().isAfter(this.get('startsAt')) && moment().isBefore(this.get('endsAt'));
}),
isInFuture: computed('startsAt', function() {
return moment(this.get('startsAt')).isAfter();
})
});
View
@@ -8,8 +8,10 @@ export default Route.extend({
},
model() {
const eventDetails = this.modelFor('public');
return RSVP.hash({
event: this.modelFor('public')
event : eventDetails,
speakersCall : eventDetails.get('speakersCall')
});
}
});
@@ -1,32 +1,24 @@
<h1 class="ui header">
{{t 'Call for Speakers'}}
{{#if callForSpeakers.isClosed}}
<a class="ui basic red label">{{t 'Closed'}}</a>
{{#if speakersCall.isOpen}}
<a class="ui basic green label">{{t 'Open'}}</a>
<div class="sub header">
{{t 'Call for Speakers Open until'}} {{moment-format speakersCall.endsAt 'ddd, MMM DD HH:mm A'}}
</div>
{{else}}
<a class="ui basic green label">{{t 'Open'}} </a>
<a class="ui basic red label">{{t 'Closed'}}</a>
<div class="sub header">
{{t 'Call for Speakers Open until'}} Fri, Oct 13 2017 5:00 pm
{{#if speakersCall.isInFuture}}
{{t 'Call for Speakers will open at'}} {{moment-format speakersCall.startsAt 'ddd, MMM DD HH:mm A'}}
{{else}}
{{t 'Call for Speakers closed at'}} {{moment-format speakersCall.endsAt 'ddd, MMM DD HH:mm A'}}
{{/if}}
</div>
{{/if}}
</h1>
<div class="ui divider"></div>
<p>

This comment has been minimized.

@niranjan94

niranjan94 Aug 1, 2017

Member

Announcement should be here. And it will have html content. So use sanitize helper

@niranjan94

niranjan94 Aug 1, 2017

Member

Announcement should be here. And it will have html content. So use sanitize helper

The OpenTechSummit brings together the most exciting ideas and makers of the open-technology community. In 2017 the technology
pioneers in Potsdam will meet again on Ascension Day, the 25th of May, to present, discuss and network their projects and ideas in lectures and workshops.
</p>
<p>
The focal theme this year is Artificial Intelligence and Personal Assistants. What promising open source solutions are there?
For our 2017 event, we are looking for speakers who share our passion for sharing free open source code, free knowledge and community.
It is also about the sustainable implementation of ideas and business concepts in start-ups. And in a tech-kids track, teens learn to build coden and hardware themselves.
</p>
<p>
Participants from all over the world are welcome. The conference languages ​​are English and German.
The first OpenTech Summit took place in Taiwan in 2009. In the last two years, the event conquered Berlin. In 2017 we will be in Potsdam on the site of the independent cultural initiative "Freiland e.V.".
An inspiring place that many interesting initiatives share. Here is the FabLab of the Science Store Potsdam where 3D printing workshops can take place and in a recording studio participants can learn the
creation of radio broadcasts with free software. There are areas for workshop for soldering, programming of games in Coderdojos or the installation of own cloud solutions in companies.
In the business track, startups will show how they are successful with the help of open software.
At the OpenTechSummit we want to open up the location and share open ideas in all directions. We look forward to creative contributions and projects.
</p>
{{sanitize speakersCall.announcement}}
<div class="ui hidden divider"></div>
<button type="submit" class="ui teal submit button">
{{t 'Submit Proposal'}}
</button>
@@ -1 +1 @@
{{public/call-for-speakers}}
{{public/call-for-speakers speakersCall=model.speakersCall}}
ProTip! Use n and p to navigate between commits in a pull request.