mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 22:38:26 +02:00
Frontend for custom radios
This commit is contained in:
parent
e7f0c1b88b
commit
07bff17e51
9 changed files with 577 additions and 11 deletions
|
@ -1,13 +1,19 @@
|
|||
<template>
|
||||
<div class="ui card">
|
||||
<div class="content">
|
||||
<div class="header">Radio : {{ radio.name }}</div>
|
||||
<div class="header">{{ radio.name }}</div>
|
||||
<div class="description">
|
||||
{{ radio.description }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="extra content">
|
||||
<radio-button class="right floated button" :type="type"></radio-button>
|
||||
<router-link
|
||||
class="ui basic yellow button"
|
||||
v-if="$store.state.auth.authenticated && type === 'custom' && customRadio.user === $store.state.auth.profile.id"
|
||||
:to="{name: 'library.radios.edit', params: {id: customRadioId }}">
|
||||
Edit...
|
||||
</router-link>
|
||||
<radio-button class="right floated button" :type="type" :custom-radio-id="customRadioId"></radio-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -17,14 +23,24 @@ import RadioButton from './Button'
|
|||
|
||||
export default {
|
||||
props: {
|
||||
type: {type: String, required: true}
|
||||
type: {type: String, required: true},
|
||||
customRadio: {required: false}
|
||||
},
|
||||
components: {
|
||||
RadioButton
|
||||
},
|
||||
computed: {
|
||||
radio () {
|
||||
if (this.customRadio) {
|
||||
return this.customRadio
|
||||
}
|
||||
return this.$store.getters['radios/types'][this.type]
|
||||
},
|
||||
customRadioId: function () {
|
||||
if (this.customRadio) {
|
||||
return this.customRadio.id
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue