Skip to content

Commit 160225f

Browse files
author
daretobedifferent18
committed
Enhance download/Link slides button
1 parent 137e339 commit 160225f

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

app/components/public/session-item.hbs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
<h3 class="ui header" id="session-id-{{@session.id}}" style={{css color=(text-color @session.track.color)}}>
66
{{@session.title}}
77
<span style={{css float='right'}}>
8+
{{#if @session.slidesUrl}}
9+
<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}}>
10+
<i class="icon {{if this.slidesUploaded 'download' 'linkify'}}"></i>
11+
{{t (if this.slidesUploaded 'Download Slides' 'Link to Slides')}}
12+
</button>
13+
{{/if}}
814
{{#if @session.microlocation.hasVideoStream}}
915
<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}}>
1016
<i class="icon video"></i>
@@ -61,20 +67,9 @@
6167
{{sanitize @session.shortAbstract}}
6268
</div>
6369
</div>
64-
{{#if (and @expanded (or @session.slidesUrl @session.videoUrl))}}
70+
{{#if (and @expanded @session.videoUrl)}}
6571
<div class="row p-4">
66-
<div class="column" style={{css display='flex' align-items='center' flex-direction='column'}}>
67-
{{#if (or this.pdfLink this.pptLink)}}
68-
<iframe title="session-slides" class="slide-iframe mb-2" width="100%" frameborder="0" src="https://docs.google.com/gview?url={{ @session.slidesUrl }}&embedded=true"></iframe>
69-
{{else if @session.slidesUrl}}
70-
<a class="mb-2" href={{ @session.slidesUrl }} target="_blank" rel="noopener noreferrer">
71-
<button class="ui labeled icon button">
72-
<i class="file powerpoint icon"></i>
73-
{{t 'Slides'}}
74-
</button>
75-
</a>
76-
{{/if}}
77-
72+
<div class="column" style={{css display='flex' align-items='center' flex-direction='column'}}>
7873
{{#if this.youtubeLink}}
7974
<iframe title="youtube-session-video" class="video-iframe" width="100%" src="https://www.youtube.com/embed/{{ this.youtubeLink }}" frameborder="0" allowfullscreen></iframe>
8075
{{else if @session.videoUrl}}

app/components/public/session-item.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ export default class SessionItem extends Component {
2323
return slidesUrl?.indexOf('.pptx') > -1 || slidesUrl?.indexOf('.ppt') > -1;
2424
}
2525

26+
get slidesUploaded() {
27+
const url = this.args.session.slidesUrl;
28+
return url.startsWith('https://open-event-api-dev.herokuapp.com') || url.startsWith('https://api.eventyay.com');
29+
}
30+
2631
@action
2732
hideSpeakerImage() {
2833
this.hideImage = !this.hideImage;
@@ -31,6 +36,11 @@ export default class SessionItem extends Component {
3136
}
3237
}
3338

39+
@action
40+
goToSlides() {
41+
window.open(this.args.session.slidesUrl, '_blank');
42+
}
43+
3444
@action
3545
goToStream() {
3646
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'));

0 commit comments

Comments
 (0)