Skip to content
12 changes: 12 additions & 0 deletions app/components/public/call-for-speakers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ export default class CallForSpeakers extends Component {
}
}

@action
addSession() {
if (this.data.userSpeaker && this.data.userSpeaker.toArray().length) {
// speaker detail exists
Comment on lines +20 to +23
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal Should I add this.transitionToRoute here for directing towards public.cfs.new-session route?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

} else {
this.notify.error(this.l10n.t('You need to add your speaker details first before submitting a session'),
{
id: 'add_new_session_error'
});
}
}

@computed('data.userSpeaker')
get isNewSpeaker() {
return !(this.data.userSpeaker && this.data.userSpeaker.toArray().length);
Expand Down
21 changes: 18 additions & 3 deletions app/templates/components/public/call-for-speakers.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,25 @@
{{/unless}}
{{/unless}}
<div class="ui hidden divider"></div>
{{#if this.isNewSession}}
<p>{{t 'No session have been submitted'}}</p>
{{/if}}
{{#if this.data.speakersCall.isOpen}}
<button type="submit" class="ui teal submit button" {{action 'openModal'}}>
{{t 'Submit Proposal'}}
{{#if this.isNewSpeaker}}
<LinkTo @route="public.cfs.new-speaker" class="ui teal button">
{{t 'Add Speaker Details'}}
</LinkTo>
{{else}}
{{#each this.data.userSpeaker as |speaker|}}
{{#if speaker.id}}
<LinkTo @route="public.cfs.edit-speaker" @model={{speaker.id}}>
<button class="ui teal {{if this.device.isMobile 'tiny'}} button">{{t 'Edit Speaker Details'}}</button>
</LinkTo>
{{/if}}
{{/each}}
{{/if}}
<button class="ui teal {{if this.device.isMobile 'tiny'}} button" {{action 'addSession'}}>
{{t 'Add New Session'}}
</button>
{{/if}}
<Modals::CfsProposalModal @isOpen={{this.isCfsModalOpen}} @isNewSpeaker={{this.isNewSpeaker}} @isNewSession={{this.isNewSession}} @data={{this.data}} />
<Modals::LoginSignupModal @isOpen={{this.isLoginModalOpen}} />