Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
David Marzal
funkwhale
Commits
bed66db5
Verified
Commit
bed66db5
authored
7 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Factorization of track table row component
parent
0dfb594b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
front/src/components/audio/track/Row.vue
+68
-0
68 additions, 0 deletions
front/src/components/audio/track/Row.vue
front/src/components/audio/track/Table.vue
+7
-32
7 additions, 32 deletions
front/src/components/audio/track/Table.vue
with
75 additions
and
32 deletions
front/src/components/audio/track/Row.vue
0 → 100644
+
68
−
0
View file @
bed66db5
<
template
>
<tr>
<td>
<play-button
class=
"basic icon"
:discrete=
"true"
:track=
"track"
></play-button>
</td>
<td>
<img
class=
"ui mini image"
v-if=
"track.album.cover"
v-lazy=
"backend.absoluteUrl(track.album.cover)"
>
<img
class=
"ui mini image"
v-else
src=
"../../..//assets/audio/default-cover.png"
>
</td>
<td
colspan=
"6"
>
<router-link
class=
"track"
:to=
"
{name: 'library.tracks.detail', params: {id: track.id }}">
<template
v-if=
"displayPosition && track.position"
>
{{
track
.
position
}}
.
</
template
>
{{ track.title }}
</router-link>
</td>
<td
colspan=
"6"
>
<router-link
class=
"artist discrete link"
:to=
"{name: 'library.artists.detail', params: {id: track.artist.id }}"
>
{{ track.artist.name }}
</router-link>
</td>
<td
colspan=
"6"
>
<router-link
class=
"album discrete link"
:to=
"{name: 'library.albums.detail', params: {id: track.album.id }}"
>
{{ track.album.title }}
</router-link>
</td>
<td>
<track-favorite-icon
class=
"favorite-icon"
:track=
"track"
></track-favorite-icon>
<track-playlist-icon
v-if=
"$store.state.auth.authenticated"
:track=
"track"
></track-playlist-icon>
</td>
</tr>
</template>
<
script
>
import
backend
from
'
@/audio/backend
'
import
TrackFavoriteIcon
from
'
@/components/favorites/TrackFavoriteIcon
'
import
TrackPlaylistIcon
from
'
@/components/playlists/TrackPlaylistIcon
'
import
PlayButton
from
'
@/components/audio/PlayButton
'
export
default
{
props
:
{
track
:
{
type
:
Object
,
required
:
true
},
displayPosition
:
{
type
:
Boolean
,
default
:
false
}
},
components
:
{
TrackFavoriteIcon
,
TrackPlaylistIcon
,
PlayButton
},
data
()
{
return
{
backend
:
backend
}
}
}
</
script
>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<
style
scoped
>
tr
:not
(
:hover
)
.favorite-icon
:not
(
.favorited
)
{
display
:
none
;
}
</
style
>
This diff is collapsed.
Click to expand it.
front/src/components/audio/track/Table.vue
+
7
−
32
View file @
bed66db5
...
...
@@ -11,34 +11,11 @@
</tr>
</thead>
<tbody>
<tr
v-for=
"track in tracks"
>
<td>
<play-button
class=
"basic icon"
:discrete=
"true"
:track=
"track"
></play-button>
</td>
<td>
<img
class=
"ui mini image"
v-if=
"track.album.cover"
v-lazy=
"backend.absoluteUrl(track.album.cover)"
>
<img
class=
"ui mini image"
v-else
src=
"../../..//assets/audio/default-cover.png"
>
</td>
<td
colspan=
"6"
>
<router-link
class=
"track"
:to=
"
{name: 'library.tracks.detail', params: {id: track.id }}">
<template
v-if=
"displayPosition && track.position"
>
{{
track
.
position
}}
.
</
template
>
{{ track.title }}
</router-link>
</td>
<td
colspan=
"6"
>
<router-link
class=
"artist discrete link"
:to=
"{name: 'library.artists.detail', params: {id: track.artist.id }}"
>
{{ track.artist.name }}
</router-link>
</td>
<td
colspan=
"6"
>
<router-link
class=
"album discrete link"
:to=
"{name: 'library.albums.detail', params: {id: track.album.id }}"
>
{{ track.album.title }}
</router-link>
</td>
<td><track-favorite-icon
class=
"favorite-icon"
:track=
"track"
></track-favorite-icon></td>
</tr>
<track-row
:display-position=
"displayPosition"
:track=
"track"
:key=
"index + '-' + track.id"
v-for=
"(track, index) in tracks"
></track-row>
</tbody>
<tfoot
class=
"full-width"
>
<tr>
...
...
@@ -83,9 +60,8 @@ curl -G -o "{{ track.files[0].filename }}" <template v-if="$store.state.auth.aut
<
script
>
import
backend
from
'
@/audio/backend
'
import
TrackFavoriteIcon
from
'
@/components/favorites/TrackFavoriteIcon
'
import
PlayButton
from
'
@/components/audio/PlayButton
'
import
TrackRow
from
'
@/components/audio/track/Row
'
import
Modal
from
'
@/components/semantic/Modal
'
export
default
{
...
...
@@ -95,8 +71,7 @@ export default {
},
components
:
{
Modal
,
TrackFavoriteIcon
,
PlayButton
TrackRow
},
data
()
{
return
{
...
...
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