Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
JuniorJPDJ
funkwhale
Commits
c8467faf
Commit
c8467faf
authored
Oct 03, 2019
by
Rodrigo Leite
Committed by
Eliot Berriot
Oct 03, 2019
Browse files
Resolve "Placeholder on the homepage when there are no playlist"
parent
d833fba7
Changes
3
Hide whitespace changes
Inline
Side-by-side
changes/changelog.d/892.add.placeholder.widget
0 → 100644
View file @
c8467faf
Display placeholder on homepage when there are no playlists (#892)
front/src/components/playlists/PlaceholderWidget.vue
0 → 100644
View file @
c8467faf
<
template
>
<div
class=
"ui placeholder segment"
>
<div
class=
"ui icon header"
>
<i
class=
"pdf file outline icon"
></i>
<translate
translate-context=
"Content/Home/Placeholder"
>
No playlists have been created yet
</translate>
</div>
<button
@
click=
"$store.commit('playlists/chooseTrack', null)"
class=
"ui primary button"
>
<translate
translate-context=
"Content/Home/CreatePlaylist"
>
Create Playlist
</translate>
</button>
</div>
</
template
>
front/src/components/playlists/Widget.vue
View file @
c8467faf
...
...
@@ -9,7 +9,12 @@
<div
v-if=
"isLoading"
class=
"ui inverted active dimmer"
>
<div
class=
"ui loader"
></div>
</div>
<playlist-card
v-for=
"playlist in objects"
:key=
"playlist.id"
:playlist=
"playlist"
></playlist-card>
<template
v-if=
"playlistsExist"
>
<playlist-card
v-for=
"playlist in objects"
:key=
"playlist.id"
:playlist=
"playlist"
></playlist-card>
</
template
>
<
template
v-else
>
<placeholder-widget></placeholder-widget>
</
template
>
</div>
</template>
...
...
@@ -17,6 +22,7 @@
import
_
from
'
@/lodash
'
import
axios
from
'
axios
'
import
PlaylistCard
from
'
@/components/playlists/Card
'
import
PlaceholderWidget
from
'
@/components/playlists/PlaceholderWidget
'
export
default
{
props
:
{
...
...
@@ -24,7 +30,8 @@ export default {
url
:
{
type
:
String
,
required
:
true
}
},
components
:
{
PlaylistCard
PlaylistCard
,
PlaceholderWidget
},
data
()
{
return
{
...
...
@@ -39,6 +46,11 @@ export default {
created
()
{
this
.
fetchData
(
this
.
url
)
},
computed
:
{
playlistsExist
:
function
()
{
return
this
.
objects
.
length
>
0
}
},
methods
:
{
fetchData
(
url
)
{
if
(
!
url
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment