Skip to content

fix: Link sessions in speaker list to sessions page #4853

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

Merged
merged 5 commits into from
Sep 2, 2020
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
7 changes: 6 additions & 1 deletion app/controllers/public/session/view.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { action, computed } from '@ember/object';

export default class extends Controller {

@computed('authManager.currentUser.email', 'authManager.currentUser.isAdmin', 'model.speakers')
get showEditSection() {
return this.authManager.currentUser.isAdmin || this.model.speakers.map(speaker => speaker.email).includes(this.authManager.currentUser.email);
}

@action
openProposalWithdrawModal() {
this.set('isProposalWithdrawModalOpen', true);
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/public/speaker-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</strong>
</p>
{{/if}}
<a href="{{href-to 'public.sessions' (query-params session_id=session.id)}}">
<a href="{{href-to 'public.session.view' session.id}}">
<div class="ui fluid rounded-default p-4" style={{css color=(text-color session.track.color) background-color=session.track.color}}>
<div style={{css opacity=0.9}}>
{{#if (and session.startsAt session.endsAt)}}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/public/session/view.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="ui container">
<div class="ui row">
{{#if (not this.model.isLocked)}}
{{#if (and (not this.model.isLocked) this.showEditSection)}}
<LinkTo
@route="public.cfs.edit-session"
@models={{array this.model.event.id this.model.id}}>
Expand All @@ -24,7 +24,7 @@
</LinkTo>
{{/if}}
{{/each}}
{{#if (not-eq this.model.status 'withdrawn')}}
{{#if (and (not-eq this.model.status 'withdrawn') this.showEditSection)}}
<button class="ui red button {{if this.device.isMobile 'fluid' 'right floated'}}"
{{action 'openProposalWithdrawModal'}}>{{t 'Withdraw Proposal'}}</button>
{{#if this.device.isMobile}}
Expand Down