Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/components/public/session-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<h3 class="ui header" id="session-id-{{@session.id}}" style={{css color=(text-color @session.track.color)}}>
{{@session.title}}
<span style={{css float='right'}}>
{{#if @session.slidesUrl}}
<button class="ui basic {{text-color @session.track.color 'basic' 'inverted'}} button" style={{css color=(text-color @session.track.color 'grey' 'lightgrey')}} {{action this.goToSlides}}>
<i class="icon {{if this.slidesUploaded 'download' 'linkify'}}"></i>
{{if this.slidesUploaded (t 'Download Slides') (t 'Link to Slides')}}
</button>
{{/if}}
{{#if @session.microlocation.hasVideoStream}}
<button class="ui basic {{text-color @session.track.color 'basic' 'inverted'}} button" style={{css color=(text-color @session.track.color 'grey' 'lightgrey')}} {{action this.goToStream}}>
<i class="icon video"></i>
Expand All @@ -27,7 +33,7 @@
<div class="left floated twelve wide column">
{{#if @session.startsAt}}
<div class=""><i class="icon map marker alternate"></i>{{@session.microlocation.name}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt tz=@timezone}} - {{general-date @session.endsAt tz=@timezone}}</div>
<div class="small text"><i class="wait icon"></i>{{general-date @session.startsAt 'D MMM, YYYY h:mm A (z)' tz=@timezone}}</div>
{{/if}}
</div>
{{else}}
Expand All @@ -40,7 +46,7 @@
</div>
<div class="left floated nine wide column">
{{#each @session.speakers as |speaker|}}
{{speaker.name}} ({{speaker.position}}, {{speaker.organisation}})
{{speaker.name}} {{#if speaker.positionOrganisation}}({{speaker.positionOrganisation}}){{/if}}
<br>
{{/each}}
</div>
Expand Down Expand Up @@ -119,6 +125,8 @@
<br>
{{speaker.name}}
<br>
{{speaker.positionOrganisation}}
<br>
{{#if speaker.shortBiography}}
{{sanitize speaker.shortBiography}}
{{else if speaker.longBiography}}
Expand Down
14 changes: 13 additions & 1 deletion app/components/public/session-item.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { action } from '@ember/object';
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
import { extractYoutubeUrl } from 'open-event-frontend/utils/url';

export default class SessionItem extends Component {
@service router;

hideImage = false;
@tracked
hideImage = this.args.expanded;

get youtubeLink() {
return extractYoutubeUrl(this.args.session.videoUrl);
Expand All @@ -21,6 +23,11 @@ export default class SessionItem extends Component {
return slidesUrl?.indexOf('.pptx') > -1 || slidesUrl?.indexOf('.ppt') > -1;
}

get slidesUploaded() {
const url = this.args.session.slidesUrl;
return url.startsWith('https://open-event-api-dev.herokuapp.com') || url.startsWith('https://api.eventyay.com');
}

@action
hideSpeakerImage() {
this.hideImage = !this.hideImage;
Expand All @@ -29,6 +36,11 @@ export default class SessionItem extends Component {
}
}

@action
goToSlides() {
window.open(this.args.session.slidesUrl, '_blank');
}

@action
goToStream() {
const url = this.router.urlFor('public.stream.view', this.args.event?.identifier ?? this.args.session.get('event.identifier'), this.args.session.get('microlocation.videoStream.slugName'), this.args.session.get('microlocation.videoStream.id'));
Expand Down
5 changes: 5 additions & 0 deletions app/models/speaker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import attr from 'ember-data/attr';
import ModelBase from 'open-event-frontend/models/base';
import { belongsTo, hasMany } from 'ember-data/relationships';
import { computed } from '@ember/object';

export default class Speaker extends ModelBase.extend({

Expand Down Expand Up @@ -43,6 +44,10 @@ export default class Speaker extends ModelBase.extend({
event : belongsTo('event'),
sessions : hasMany('session'),

positionOrganisation: computed('position', 'organization', function() {
return [this.position, this.organisation].filter(Boolean).join(', ');
}),

ready() {
if (!this.complexFieldValues) {
this.complexFieldValues = {};
Expand Down