Skip to content

Commit

Permalink
Implement join button from session to room (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcduong authored Jul 23, 2024
1 parent 8594243 commit 2f21515
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion webapp/src/views/schedule/talks/item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
a.download(v-for="{resource, description} of talk.resources", :href="getAbsoluteResourceUrl(resource)", target="_blank")
.mdi(:class="`mdi-${getIconByFileEnding(resource)}`")
.filename {{ description }}
bunt-link-button.btn-create.router-link.stage(v-if="getRoomIdByName(roomName)", :to="{name: 'room', params: {roomId: getRoomIdByName(roomName)}}") Join room
.speakers(v-if="talk.speakers.length > 0")
.header {{ $t('schedule/talks/item:speakers:header', {count: talk.speakers.length})}}
.speakers-list
Expand All @@ -24,7 +25,7 @@
bunt-progress-circular(v-else, size="huge", :page="true")
</template>
<script>
import { mapGetters } from 'vuex'
import { mapGetters, mapState } from 'vuex'
import moment from 'lib/timetravelMoment'
import MarkdownContent from 'components/MarkdownContent'
import { getIconByFileEnding } from 'lib/filetypes'
Expand All @@ -40,6 +41,7 @@ export default {
}
},
computed: {
...mapState(['rooms']),
...mapGetters('schedule', ['pretalxApiBaseUrl', 'sessions']),
datetime () {
return moment(this.talk.slot?.start || this.talk.start).format('L LT') + ' - ' + moment(this.talk.slot?.end || this.talk.end).format('LT')
Expand Down Expand Up @@ -73,6 +75,10 @@ export default {
if (!this.pretalxApiBaseUrl) return resource
const base = (new URL(this.pretalxApiBaseUrl)).origin
return new URL(resource, base)
},
getRoomIdByName(roomName) {
const room = this.rooms.find(r => r.name === roomName);
return room ? room.id : null;
}
}
}
Expand Down Expand Up @@ -121,6 +127,8 @@ export default {
.mdi
font-size: 36px
margin: 0 4px
.btn-create
themed-button-primary()
.speakers
width: 280px
margin: 32px 16px
Expand Down

0 comments on commit 2f21515

Please sign in to comment.