diff --git a/app/components/modals/cfs-proposal-modal.js b/app/components/modals/cfs-proposal-modal.js deleted file mode 100644 index c187724f835..00000000000 --- a/app/components/modals/cfs-proposal-modal.js +++ /dev/null @@ -1,11 +0,0 @@ -import classic from 'ember-classic-decorator'; -import { action } from '@ember/object'; -import ModalBase from 'open-event-frontend/components/modals/modal-base'; - -@classic -export default class CfsProposalModal extends ModalBase { - @action - toggleView() { - this.set('isOpen', false); - } -} diff --git a/app/components/public/call-for-speakers.js b/app/components/public/call-for-speakers.js index d391abd7c94..fbb80718447 100644 --- a/app/components/public/call-for-speakers.js +++ b/app/components/public/call-for-speakers.js @@ -1,18 +1,35 @@ import classic from 'ember-classic-decorator'; import { action, computed } from '@ember/object'; import Component from '@ember/component'; +import { inject as service } from '@ember/service'; @classic export default class CallForSpeakers extends Component { + @service + router; + @action - openModal() { + addSpeaker() { if (this.session.isAuthenticated) { - this.set('isCfsModalOpen', true); + this.router.transitionTo('public.cfs.new-speaker'); } else { this.set('isLoginModalOpen', true); } } + @action + addSession() { + if (this.data.userSpeaker && this.data.userSpeaker.toArray().length) { + // speaker detail exists + this.router.transitionTo('public.cfs.new-session'); + } 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); diff --git a/app/templates/components/modals/cfs-proposal-modal.hbs b/app/templates/components/modals/cfs-proposal-modal.hbs deleted file mode 100644 index 84d1da40c5e..00000000000 --- a/app/templates/components/modals/cfs-proposal-modal.hbs +++ /dev/null @@ -1,29 +0,0 @@ - -
- {{t 'Submit Proposal'}} -
-
- {{#if this.isNewSession}} -

{{t 'No existing sessions'}}

- {{/if}} -
- {{#if this.isNewSpeaker}} - - {{t 'Add Speaker Details'}} - - {{else}} - {{#each this.data.userSpeaker as |speaker|}} - {{#if speaker.id}} - - - - {{/if}} - {{/each}} - {{/if}} - {{#unless this.isNewSpeaker}} - - - - {{/unless}} -
-
diff --git a/app/templates/components/public/call-for-speakers.hbs b/app/templates/components/public/call-for-speakers.hbs index 7fb971cfa64..896df45e836 100644 --- a/app/templates/components/public/call-for-speakers.hbs +++ b/app/templates/components/public/call-for-speakers.hbs @@ -37,10 +37,25 @@ {{/unless}} {{/unless}} +{{#if this.isNewSession}} +

{{t 'No session have been submitted'}}

+{{/if}} {{#if this.data.speakersCall.isOpen}} - + {{else}} + {{#each this.data.userSpeaker as |speaker|}} + {{#if speaker.id}} + + + + {{/if}} + {{/each}} + {{/if}} + {{/if}} -