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

load names of rtrcategories and types id

parent e7ffcd0b
No related branches found
No related tags found
No related merge requests found
...@@ -106,19 +106,25 @@ ...@@ -106,19 +106,25 @@
<b-col lg="6"> <b-col lg="6">
<p> <p>
<b>Show type: <img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="notYetImplemented" /> :</b>
<!-- TODO: discuss: should this be visible to show owners or only to administrators? --> <!-- TODO: discuss: should this be visible to show owners or only to administrators? -->
<!-- TODO: fetch name for type_id from steering api --> <span v-if="loaded.type">
<b>Type:</b> {{ shows[currentShow].type_id }} <span v-if="current.type.length === 0"><small><i>(none set)</i></small></span>
<img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="notYetImplemented" /> <span v-else>{{ current.type[0].type }}</span>
</span>
<span v-else><img src="../assets/radio.gif" height="24px" alt="loading data" /></span>
</p> </p>
</b-col> </b-col>
<b-col lg="6"> <b-col lg="6">
<p> <p>
<b>Funding category (eg. for RTR) <img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="notYetImplemented" /> :</b>
<!-- TODO: discuss: should this be visible to show owners or only to administrators? --> <!-- TODO: discuss: should this be visible to show owners or only to administrators? -->
<!-- TODO: fetch name for rtrcategory_id from steering api --> <span v-if="loaded.rtrcategory">
<b>RTR-Category:</b> {{ shows[currentShow].rtrcategory_id }} <span v-if="current.rtrcategory.length === 0"><small><i>(none set)</i></small></span>
<img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="notYetImplemented" /> <span v-else>{{ current.rtrcategory[0].rtrcategory }}</span>
</span>
<span v-else><img src="../assets/radio.gif" height="24px" alt="loading data" /></span>
</p> </p>
</b-col> </b-col>
...@@ -144,9 +150,9 @@ ...@@ -144,9 +150,9 @@
<b-col lg="6"> <b-col lg="6">
<p> <p>
<b>Fallback Pool:</b> <b>Fallback List/Pool:</b>
<span v-if="shows[currentShow].fallback_pool === ''"><small><i>(none set)</i></small></span> <span v-if="shows[currentShow].fallback_id === ''"><small><i>(none set)</i></small></span>
<span v-else>{{ shows[currentShow].fallback_pool }}</span> <span v-else>ID: {{ shows[currentShow].fallback_id }}</span>
<img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="notYetImplemented" /> <img src="../assets/16x16/emblem-system.png" alt="edit" v-on:click="notYetImplemented" />
</p> </p>
</b-col> </b-col>
...@@ -276,7 +282,8 @@ export default { ...@@ -276,7 +282,8 @@ export default {
languages: false, languages: false,
topics: false, topics: false,
musicfocus: false, musicfocus: false,
rtrcategory: false rtrcategory: false,
type: false
}, },
current: { current: {
categories: [], categories: [],
...@@ -284,7 +291,8 @@ export default { ...@@ -284,7 +291,8 @@ export default {
languages: [], languages: [],
topics: [], topics: [],
musicfocus: [], musicfocus: [],
rtrcategory: [] rtrcategory: [],
type: []
} }
} }
}, },
...@@ -324,6 +332,7 @@ export default { ...@@ -324,6 +332,7 @@ export default {
this.getTopics() this.getTopics()
this.getMusicfocus() this.getMusicfocus()
this.getRTRCategory() this.getRTRCategory()
this.getType()
// now fetch the single timeslots for a given show from PV backend // now fetch the single timeslots for a given show from PV backend
axios.get(process.env.API_STEERING_SHOWS + this.currentShowID + '/timeslots/').then(response => { axios.get(process.env.API_STEERING_SHOWS + this.currentShowID + '/timeslots/').then(response => {
this.timeslots = response.data this.timeslots = response.data
...@@ -467,20 +476,35 @@ export default { ...@@ -467,20 +476,35 @@ export default {
getRTRCategory: function () { getRTRCategory: function () {
this.current.rtrcategory = [] this.current.rtrcategory = []
var loadingError = false var loadingError = false
if (this.shows[this.currentShow].rtrcategory.length === 0) { if (typeof this.shows[this.currentShow].rtrcategory !== 'number') {
this.loaded.rtrcategory = true this.loaded.rtrcategory = true
} else { } else {
for (var i in this.shows[this.currentShow].rtrcategory) { axios.get(process.env.API_STEERING + 'rtrcategories/' + this.shows[this.currentShow].rtrcategory).then(response => {
axios.get(process.env.API_STEERING + 'rtrcategories/' + this.shows[this.currentShow].rtrcategory[i]).then(response => { this.current.rtrcategory.push(response.data)
console.log(response.data) }).catch(error => {
this.current.rtrcategory.push(response.data) loadingError = true
}).catch(error => { alert('There was an error fetching RTR category from the server: ' + error)
loadingError = true })
alert('There was an error fetching RTR category from the server: ' + error) }
}) if (!loadingError) this.loaded.rtrcategory = true
} },
getType: function () {
this.current.type = []
var loadingError = false
console.log(this.shows[this.currentShow])
console.log(typeof this.shows[this.currentShow].type)
if (typeof this.shows[this.currentShow].type !== 'number') {
this.loaded.type = true
} else {
axios.get(process.env.API_STEERING + 'types/' + this.shows[this.currentShow].type).then(response => {
console.log(response.data)
this.current.type.push(response.data)
}).catch(error => {
loadingError = true
alert('There was an error fetching show type from the server: ' + error)
})
} }
if (!loadingError) this.loaded.categories = true if (!loadingError) this.loaded.type = true
}, },
notYetImplemented: function () { notYetImplemented: function () {
alert('By the mighty witchcraftry of the mother of time!\n\nThis feature is not implemented yet.') alert('By the mighty witchcraftry of the mother of time!\n\nThis feature is not implemented yet.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment