Skip to content
Snippets Groups Projects
Commit e9eefc93 authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

use show selector component in show manager to fix #28

parent a290e85d
No related branches found
No related tags found
No related merge requests found
<template>
<b-container>
<!--
The show picker including the modal to add new shows should also be
refactored into an own component, so we can reuse it in the file and
emission managers
-->
<addShowModal ref="addShowModal" />
<b-row>
<b-col>
<h3>Sendungen verwalten</h3>
</b-col>
<b-col align="right">
<b-button
v-if="$parent.user.steeringUser.is_superuser"
v-b-popover.hover.top="'Add a new show'"
variant="info"
@click="$refs.addShowModal.openModal()"
>
+
</b-button>
&nbsp;
<b-dropdown
id="ddshows"
text="Sendereihe auswählen"
variant="outline-info"
>
<b-dropdown-item
v-for="(show, index) in shows"
:key="show.id"
@click="switchShow(index)"
>
{{ show.name }}
</b-dropdown-item>
</b-dropdown>
</b-col>
</b-row>
<show-selector
ref="showSelector"
title="Radio shows"
:callback="showHasSwitched"
/>
<hr>
<!-- The jumbotron is used to display the name and description of the
......@@ -79,20 +48,20 @@ import showMetaSimpleTypes from './shows/MetaSimpleTypes.vue'
import showMetaArrays from './shows/MetaArrays.vue'
import showMetaOwners from './shows/MetaOwners.vue'
import showMetaImages from './shows/MetaImages.vue'
import modalAddShow from './shows/AddShowModal.vue'
import showSelector from './ShowSelector.vue'
import { mapGetters } from 'vuex'
export default {
// all modals to edit a show and its timeslots/notes, are importet as separate
// components, to make it a tiny lickle bit less messy here
components: {
'addShowModal': modalAddShow,
'show-jumbotron': showJumbotron,
'show-timeslots': showTimeslots,
'show-metaArrays': showMetaArrays,
'show-metaSimpleTypes': showMetaSimpleTypes,
'show-metaOwners': showMetaOwners,
'show-metaImages': showMetaImages,
'show-selector': showSelector,
},
data () {
......@@ -124,6 +93,7 @@ export default {
this.$store.dispatch('shows/fetchShows', {
callback: () => {
this.$store.dispatch('playlists/fetch', {slug: this.selectedShow.slug})
this.$refs.showSelector.updateInputSelector()
}
})
this.$store.dispatch('shows/fetchMetaArray', {property: 'types', onlyActive: true})
......@@ -137,8 +107,7 @@ export default {
},
methods: {
switchShow: function (index) {
this.$store.commit('shows/switchShow', index)
showHasSwitched () {
this.$refs.timeslotsComponent.showHasSwitched()
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment