diff --git a/front/src/components/audio/EmbedWizard.vue b/front/src/components/audio/EmbedWizard.vue new file mode 100644 index 000000000..7a50ffa54 --- /dev/null +++ b/front/src/components/audio/EmbedWizard.vue @@ -0,0 +1,80 @@ + + + + + + + Widget width + Leave empty for a responsive widget + + + + + + Widget height + + + + + + Copy + Embed code + Copy/paste this code in your website HTML + + + + + + + + Preview + + + + + + + + + diff --git a/front/src/components/federation/LibraryWidget.vue b/front/src/components/federation/LibraryWidget.vue index ff73bb7a8..abe993e46 100644 --- a/front/src/components/federation/LibraryWidget.vue +++ b/front/src/components/federation/LibraryWidget.vue @@ -62,6 +62,7 @@ export default { self.nextPage = response.data.next self.isLoading = false self.libraries = response.data.results + self.$emit('loaded', self.libraries) }, error => { self.isLoading = false self.errors = error.backendErrors diff --git a/front/src/components/library/Album.vue b/front/src/components/library/Album.vue index 9a4adfafc..6a3cfaa8e 100644 --- a/front/src/components/library/Album.vue +++ b/front/src/components/library/Album.vue @@ -37,6 +37,30 @@ View on MusicBrainz + + + + Embed + + + + Embed this album on your website + + + + + + + + + + Cancel + + + + @@ -64,7 +88,7 @@ User libraries - + This album is present in the following libraries: @@ -79,6 +103,8 @@ import backend from "@/audio/backend" import PlayButton from "@/components/audio/PlayButton" import TrackTable from "@/components/audio/track/Table" import LibraryWidget from "@/components/federation/LibraryWidget" +import EmbedWizard from "@/components/audio/EmbedWizard" +import Modal from '@/components/semantic/Modal' const FETCH_URL = "albums/" @@ -98,13 +124,17 @@ export default { components: { PlayButton, TrackTable, - LibraryWidget + LibraryWidget, + EmbedWizard, + Modal }, data() { return { isLoading: true, album: null, - discs: [] + discs: [], + libraries: [], + showEmbedModal: false } }, created() { @@ -129,6 +159,11 @@ export default { title: this.$gettext("Album") } }, + publicLibraries () { + return this.libraries.filter(l => { + return l.privacy_level === 'everyone' + }) + }, wikipediaUrl() { return ( "https://en.wikipedia.org/w/index.php?search=" + diff --git a/front/src/components/library/Track.vue b/front/src/components/library/Track.vue index 4aeecdf39..d4127de1d 100644 --- a/front/src/components/library/Track.vue +++ b/front/src/components/library/Track.vue @@ -55,6 +55,30 @@ Download + + + + Embed + + + + Embed this track on your website + + + + + + + + + + Cancel + + + + @@ -144,7 +168,7 @@ User libraries - + This track is present in the following libraries: @@ -162,6 +186,7 @@ import TrackFavoriteIcon from "@/components/favorites/TrackFavoriteIcon" import TrackPlaylistIcon from "@/components/playlists/TrackPlaylistIcon" import LibraryWidget from "@/components/federation/LibraryWidget" import Modal from '@/components/semantic/Modal' +import EmbedWizard from "@/components/audio/EmbedWizard" const FETCH_URL = "tracks/" @@ -172,7 +197,8 @@ export default { TrackPlaylistIcon, TrackFavoriteIcon, LibraryWidget, - Modal + Modal, + EmbedWizard }, data() { return { @@ -181,7 +207,9 @@ export default { isLoadingLyrics: true, track: null, lyrics: null, - licenseData: null + licenseData: null, + libraries: [], + showEmbedModal: false } }, created() { @@ -224,6 +252,11 @@ export default { } }, computed: { + publicLibraries () { + return this.libraries.filter(l => { + return l.privacy_level === 'everyone' + }) + }, labels() { return { title: this.$gettext("Track")
Leave empty for a responsive widget
Copy/paste this code in your website HTML