Modal episode (to be split)
All checks were successful
repod / xml (push) Successful in 37s
repod / php (push) Successful in 1m10s
repod / nodejs (push) Successful in 2m2s

This commit is contained in:
Michel Roux 2023-12-24 16:34:27 +01:00
parent 50abff2f9d
commit d43ec9dd75

View File

@ -9,7 +9,8 @@
:details="moment(episode.episodePubDate.date).fromNow()" :details="moment(episode.episodePubDate.date).fromNow()"
:force-display-actions="true" :force-display-actions="true"
:name="episode.episodeName" :name="episode.episodeName"
:title="episode.episodeDescription"> :title="episode.episodeDescription"
@click="modalEpisode = episode">
<template #icon> <template #icon>
<NcAvatar :display-name="episode.episodeName" <NcAvatar :display-name="episode.episodeName"
:is-no-user="true" :is-no-user="true"
@ -34,13 +35,41 @@
</template> </template>
</NcListItem> </NcListItem>
</AdaptativeList> </AdaptativeList>
<NcModal v-if="modalEpisode"
size="small"
@close="modalEpisode = null">
<div class="modal-content">
<NcAvatar :display-name="modalEpisode.episodeName"
:is-no-user="true"
size="256"
:url="modalEpisode.episodeImage" />
<h2>{{ modalEpisode.episodeName }}</h2>
{{ modalEpisode.episodeDescription }}
<div class="modal-buttons">
<NcButton v-if="modalEpisode.episodeLink" :href="modalEpisode.episodeLink" target="_blank">
<template #icon>
<OpenInNew :size="20" />
</template>
{{ modalEpisode.podcastName }}
</NcButton>
<NcButton v-if="modalEpisode.episodeUrl" :href="modalEpisode.episodeUrl" target="_blank">
<template #icon>
<Download :size="20" />
</template>
{{ t('Download') }}
</NcButton>
</div>
</div>
</NcModal>
</div> </div>
</template> </template>
<script> <script>
import { NcActionButton, NcAvatar, NcListItem } from '@nextcloud/vue' import { NcActionButton, NcAvatar, NcButton, NcListItem, NcModal } from '@nextcloud/vue'
import AdaptativeList from '../Atoms/AdaptativeList.vue' import AdaptativeList from '../Atoms/AdaptativeList.vue'
import Download from 'vue-material-design-icons/Download.vue'
import Loading from '../Atoms/Loading.vue' import Loading from '../Atoms/Loading.vue'
import OpenInNew from 'vue-material-design-icons/OpenInNew.vue'
import PlayButton from 'vue-material-design-icons/Play.vue' import PlayButton from 'vue-material-design-icons/Play.vue'
import StopButton from 'vue-material-design-icons/Stop.vue' import StopButton from 'vue-material-design-icons/Stop.vue'
import axios from '@nextcloud/axios' import axios from '@nextcloud/axios'
@ -53,10 +82,14 @@ export default {
name: 'Episodes', name: 'Episodes',
components: { components: {
AdaptativeList, AdaptativeList,
Download,
Loading, Loading,
NcActionButton, NcActionButton,
NcAvatar, NcAvatar,
NcButton,
NcListItem, NcListItem,
NcModal,
OpenInNew,
PlayButton, PlayButton,
StopButton, StopButton,
}, },
@ -64,6 +97,7 @@ export default {
return { return {
episodes: [], episodes: [],
loading: true, loading: true,
modalEpisode: null,
} }
}, },
computed: { computed: {
@ -103,4 +137,17 @@ export default {
.ended { .ended {
opacity: .5; opacity: .5;
} }
.modal-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem;
margin: 2rem;
}
.modal-buttons {
display: flex;
gap: 1rem;
}
</style> </style>