Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Abenthung
funkwhale
Commits
d85cd512
Commit
d85cd512
authored
4 years ago
by
Ciaran Ainsworth
Browse files
Options
Downloads
Patches
Plain Diff
Make grid work with channel details
parent
1fd24cee
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
front/src/components/audio/ArtistEntries.vue
+136
-78
136 additions, 78 deletions
front/src/components/audio/ArtistEntries.vue
front/src/views/library/DetailTracks.vue
+4
-4
4 additions, 4 deletions
front/src/views/library/DetailTracks.vue
with
140 additions
and
82 deletions
front/src/components/audio/ArtistEntries.vue
+
136
−
78
View file @
d85cd512
<
template
>
<div
class=
"artist-entries ui unstackable grid"
>
<div>
<!-- Show the search bar if search is true -->
<inline-search-bar
v-model=
"query"
v-if=
"search"
@
search=
"additionalTracks = []; fetchData()"
></inline-search-bar>
<div
class=
"ui hidden divider"
></div>
<!-- Show a message if no tracks are available -->
<slot
v-if=
"!isLoading && allTracks.length === 0"
name=
"empty-state"
>
<empty-state
@
refresh=
"fetchData('tracks/')"
:refresh=
"true"
></empty-state>
</slot>
<!-- If tracks are available, build the header -->
<div
v-else
:class=
"['artist-entries', 'ui', 'unstackable', 'grid']"
>
<div
v-if=
"isLoading"
class=
"ui inverted active dimmer"
>
<div
class=
"ui loader"
></div>
</div>
<div
class=
"artist-entries row"
>
<div
class=
"actions
one wide
left floated column"
></div>
<div
v-if=
"showArt"
class=
"image
one wide
left floated column"
></div>
<div
class=
"content ellipsis
two wide
left floated column"
>
<div
class=
"actions left floated column"
></div>
<div
v-if=
"showArt"
class=
"image left floated column"
></div>
<div
class=
"content ellipsis left floated column"
>
<b>
{{
labels
.
title
}}
</b>
</div>
<div
v-if=
"showAlbum"
class=
"content ellipsis
two wide
left floated column"
>
<div
v-if=
"showAlbum"
class=
"content ellipsisleft floated column"
>
<b>
{{
labels
.
album
}}
</b>
</div>
<div
v-if=
"showArtist"
class=
"content ellipsis
two wide
left floated column"
>
<div
v-if=
"showArtist"
class=
"content ellipsis left floated column"
>
<b>
{{
labels
.
artist
}}
</b>
</div>
<div
class=
"meta
one wide
right floated column"
></div>
<div
class=
"meta
one wide
right floated column"
>
<div
class=
"meta right floated column"
></div>
<div
class=
"meta right floated column"
>
<i
class=
"clock icon"
style=
"padding: 0.5rem;"
/>
</div>
<div
class=
"one wide
right floated column"
></div>
<div
v-if=
"displayActions"
class=
"
right floated column"
></div>
</div>
<!-- For each item, build a row -->
<div
:class=
"[
{active: currentTrack
&&
track.id === currentTrack.id}, 'artist-entry row']"
@mouseover="track.hover = true"
@mouseleave="track.hover = false"
@dblclick="doubleClick(track, index)"
@contextmenu.prevent="$refs.playmenu.open()"
v-for="(track, index) in
t
racks" :key="track.id">
v-for="(track, index) in
allT
racks" :key="track.id">
<div
class=
"actions one wide left floated column"
>
<play-indicator
v-if=
"!$store.state.player.isLoadingAudio && currentTrack && isPlaying && track.id === currentTrack.id && !track.hover"
>
...
...
@@ -46,7 +65,7 @@
<button
v-else-if=
"track.hover"
class=
"ui really tiny basic icon button play-button"
@
click.prevent.exact=
"replacePlay(
t
racks, index)"
@
click.prevent.exact=
"replacePlay(
allT
racks, index)"
>
<i
class=
"play icon"
/>
</button>
...
...
@@ -73,8 +92,9 @@
<div
class=
"meta right floated column"
>
<human-duration
v-if=
"track.uploads[0] && track.uploads[0].duration"
:duration=
"track.uploads[0].duration"
></human-duration>
</div>
<div
class=
"right floated column"
>
<play-button
id=
"playmenu"
class=
"play-button basic icon"
:dropdown-only=
"true"
:is-playable=
"track.is_playable"
:dropdown-icon-classes=
"['ellipsis', 'vertical', 'large really discrete']"
:track=
"track"
></play-button>
<div
v-if=
"displayActions"
class=
"right floated column"
>
<play-button
id=
"playmenu"
class=
"play-button basic icon"
:dropdown-only=
"true"
:is-playable=
"track.is_playable_by_actor"
:dropdown-icon-classes=
"['ellipsis', 'vertical', 'large really discrete']"
:track=
"track"
></play-button>
</div>
</div>
</div>
</div>
...
...
@@ -86,6 +106,7 @@ import TrackFavoriteIcon from '@/components/favorites/TrackFavoriteIcon'
import
{
mapActions
,
mapGetters
}
from
"
vuex
"
import
PlayIndicator
from
'
@/components/audio/track/PlayIndicator
'
import
PlayButton
from
'
@/components/audio/PlayButton
'
import
axios
from
'
axios
'
export
default
{
props
:
{
...
...
@@ -94,18 +115,34 @@ export default {
showArtist
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
},
trackOnly
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
},
showPosition
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
},
showArt
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
}
showArt
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
},
search
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
},
filters
:
{
type
:
Object
,
required
:
false
,
default
:
null
},
nextUrl
:
{
type
:
String
,
required
:
false
,
default
:
null
},
displayActions
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
},
},
components
:
{
TrackFavoriteIcon
,
PlayIndicator
,
PlayButton
},
data
()
{
return
{
fetchDataUrl
:
this
.
nextUrl
,
isLoading
:
false
,
additionalTracks
:
[],
query
:
''
,
}
},
computed
:
{
...
mapGetters
({
currentTrack
:
"
queue/currentTrack
"
,
}),
allTracks
()
{
return
(
this
.
tracks
||
[]).
concat
(
this
.
additionalTracks
)
},
isPlaying
()
{
return
this
.
$store
.
state
.
player
.
playing
},
...
...
@@ -116,7 +153,8 @@ export default {
album
:
this
.
$pgettext
(
"
*/*/*/Noun
"
,
"
Album
"
),
artist
:
this
.
$pgettext
(
"
*/*/*/Noun
"
,
"
Artist
"
)
}
}
},
},
methods
:
{
...
mapActions
({
...
...
@@ -141,12 +179,32 @@ export default {
}
else
if
(
this
.
currentTrack
&&
!
this
.
isPlaying
&&
track
.
id
===
this
.
currentTrack
.
id
)
{
this
.
resumePlayback
()
}
else
{
this
.
replacePlay
(
this
.
t
racks
,
index
)
this
.
replacePlay
(
this
.
allT
racks
,
index
)
}
},
fetchData
(
url
)
{
url
=
url
||
'
tracks/
'
let
self
=
this
let
params
=
{
q
:
this
.
query
,
...
this
.
filters
}
self
.
isLoading
=
true
axios
.
get
(
url
,
{
params
}).
then
((
response
)
=>
{
self
.
additionalTracks
=
self
.
additionalTracks
.
concat
(
response
.
data
.
results
)
self
.
fetchDataUrl
=
response
.
data
.
next
self
.
isLoading
=
false
},
(
error
)
=>
{
self
.
isLoading
=
false
})
}
},
created
()
{
this
.
tracks
.
forEach
((
track
)
=>
{
if
(
!
this
.
tracks
)
{
this
.
fetchData
(
'
tracks/
'
)
}
this
.
allTracks
.
forEach
((
track
)
=>
{
this
.
$set
(
track
,
'
hover
'
,
false
)
})
}
...
...
This diff is collapsed.
Click to expand it.
front/src/views/library/DetailTracks.vue
+
4
−
4
View file @
d85cd512
<
template
>
<section>
<
track-table
<
artist-entries
:key=
"object.uploads_count"
:display-actions=
"false"
:search=
"true"
...
...
@@ -11,17 +11,17 @@
<translate
key=
"2"
v-else
translate-context=
"*/*/*"
>
You may need to follow this library to see its content.
</translate>
</p>
</empty-state>
</
track-table
>
</
artist-entries
>
</section>
</
template
>
<
script
>
import
TrackTable
from
'
@/components/audio/
track/Table
'
import
ArtistEntries
from
'
@/components/audio/
ArtistEntries
'
export
default
{
props
:
[
'
object
'
,
'
isOwner
'
],
components
:
{
TrackTable
,
ArtistEntries
,
},
}
</
script
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment