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
Environments
Terraform modules
Monitor
Incidents
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
Baptiste Benti
funkwhale
Commits
4bda1cd8
Commit
4bda1cd8
authored
4 years ago
by
Ciaran Ainsworth
Browse files
Options
Downloads
Patches
Plain Diff
Initial idea for sliders
parent
56b1358f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
front/src/components/Home.vue
+3
-0
3 additions, 0 deletions
front/src/components/Home.vue
front/src/components/audio/album/Slider.vue
+84
-0
84 additions, 0 deletions
front/src/components/audio/album/Slider.vue
front/src/components/library/Home.vue
+5
-9
5 additions, 9 deletions
front/src/components/library/Home.vue
with
92 additions
and
9 deletions
front/src/components/Home.vue
+
3
−
0
View file @
4bda1cd8
...
@@ -178,6 +178,7 @@
...
@@ -178,6 +178,7 @@
<translate
translate-context=
"*/*/*"
>
New channels
</translate>
<translate
translate-context=
"*/*/*"
>
New channels
</translate>
</h3>
</h3>
<channels-widget
:show-modification-date=
"true"
:limit=
"10"
:filters=
"{ordering: '-creation_date', external: 'false'}"
></channels-widget>
<channels-widget
:show-modification-date=
"true"
:limit=
"10"
:filters=
"{ordering: '-creation_date', external: 'false'}"
></channels-widget>
<album-slider
:filters=
"{playable: true, ordering: '-creation_date'}"
:limit=
"10"
></album-slider>
</section>
</section>
</main>
</main>
...
@@ -189,6 +190,7 @@ import _ from '@/lodash'
...
@@ -189,6 +190,7 @@ import _ from '@/lodash'
import
{
mapState
}
from
'
vuex
'
import
{
mapState
}
from
'
vuex
'
import
showdown
from
'
showdown
'
import
showdown
from
'
showdown
'
import
AlbumWidget
from
"
@/components/audio/album/Widget
"
import
AlbumWidget
from
"
@/components/audio/album/Widget
"
import
AlbumSlider
from
"
@/components/audio/album/Slider
"
import
ChannelsWidget
from
"
@/components/audio/ChannelsWidget
"
import
ChannelsWidget
from
"
@/components/audio/ChannelsWidget
"
import
LoginForm
from
"
@/components/auth/LoginForm
"
import
LoginForm
from
"
@/components/auth/LoginForm
"
import
SignupForm
from
"
@/components/auth/SignupForm
"
import
SignupForm
from
"
@/components/auth/SignupForm
"
...
@@ -200,6 +202,7 @@ export default {
...
@@ -200,6 +202,7 @@ export default {
ChannelsWidget
,
ChannelsWidget
,
LoginForm
,
LoginForm
,
SignupForm
,
SignupForm
,
AlbumSlider
,
},
},
data
()
{
data
()
{
return
{
return
{
...
...
This diff is collapsed.
Click to expand it.
front/src/components/audio/album/Slider.vue
0 → 100644
+
84
−
0
View file @
4bda1cd8
<
template
>
<div
class=
"wrapper"
>
<div
class=
"ui two column grid"
>
<div
class=
"column"
>
<h3
v-if=
"!!this.$slots.title"
class=
"ui header"
>
<slot
name=
"title"
></slot>
</h3>
<slot></slot>
</div>
<div
class=
"column"
>
<button
:class=
"['right', 'floated', 'circular', 'icon', 'ui',
{'disabled': !nextPage}, 'button',]" @click.prevent="fetchData(nextPage)">
<i
class=
"right arrow icon"
></i>
</button>
<button
:class=
"['right', 'floated', 'circular', 'icon', 'ui',
{'disabled': !previousPage}, 'button',]" @click.prevent="fetchData(previousPage)">
<i
class=
"left arrow icon"
></i>
</button>
</div>
</div>
<div
class=
"ui hidden divider"
></div>
<div
class=
"ui app-cards cards"
>
<div
v-if=
"isLoading"
class=
"ui inverted active dimmer"
>
<div
class=
"ui loader"
></div>
</div>
<album-card
v-for=
"album in albums"
:album=
"album"
:key=
"album.id"
/>
</div>
<template
v-if=
"!isLoading && albums.length === 0"
>
<empty-state
@
refresh=
"fetchData('albums/')"
:refresh=
"true"
></empty-state>
</
template
>
</div>
</template>
<
script
>
import
axios
from
'
axios
'
import
AlbumCard
from
'
@/components/audio/album/Card
'
import
$
from
'
jquery
'
export
default
{
components
:
{
AlbumCard
,
},
props
:
{
limit
:
{
type
:
Number
,
default
:
4
},
filters
:
{
type
:
Object
,
required
:
true
},
},
data
()
{
return
{
albums
:
[],
count
:
0
,
isLoading
:
false
,
errors
:
null
,
previousPage
:
null
,
nextPage
:
null
,
}
},
created
()
{
this
.
fetchData
()
},
methods
:
{
fetchData
(
url
)
{
url
=
url
||
'
albums/
'
this
.
isLoading
=
true
let
self
=
this
let
params
=
{
q
:
this
.
query
,
...
this
.
filters
}
params
.
page_size
=
this
.
limit
params
.
offset
=
this
.
offset
axios
.
get
(
url
,
{
params
:
params
}).
then
((
response
)
=>
{
self
.
previousPage
=
response
.
data
.
previous
self
.
nextPage
=
response
.
data
.
next
self
.
isLoading
=
false
self
.
albums
=
[...
response
.
data
.
results
]
self
.
count
=
response
.
data
.
count
},
error
=>
{
self
.
isLoading
=
false
self
.
errors
=
error
.
backendErrors
})
},
},
mounted
()
{
$
(
'
.component-album-card
'
)
.
transition
(
'
scale
'
)
}
}
</
script
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
front/src/components/library/Home.vue
+
5
−
9
View file @
4bda1cd8
...
@@ -19,21 +19,15 @@
...
@@ -19,21 +19,15 @@
</div>
</div>
</div>
</div>
<div
class=
"ui section hidden divider"
></div>
<div
class=
"ui section hidden divider"
></div>
<div
class=
"ui stackable one column grid"
>
<album-slider
:filters=
"{scope: scope, playable: true, ordering: '-creation_date'}"
>
<div
class=
"column"
>
<
template
slot=
"title"
><translate
translate-context=
"Content/Home/Title"
>
Recently added
</translate></
template
>
<album-widget
:filters=
"{scope: scope, playable: true, ordering: '-creation_date'}"
>
</album-slider>
<
template
slot=
"title"
><translate
translate-context=
"Content/Home/Title"
>
Recently added
</translate></
template
>
</album-widget>
</div>
</div>
<
template
v-if=
"scope === 'all'"
>
<
template
v-if=
"scope === 'all'"
>
<h3
class=
"ui header"
>
<h3
class=
"ui header"
>
<translate
translate-context=
"*/*/*"
>
New channels
</translate>
<translate
translate-context=
"*/*/*"
>
New channels
</translate>
</h3>
</h3>
<channels-widget
:show-modification-date=
"true"
:limit=
"12"
:filters=
"
{ordering: '-creation_date', external: 'false'}">
</channels-widget>
<channels-widget
:show-modification-date=
"true"
:limit=
"12"
:filters=
"
{ordering: '-creation_date', external: 'false'}">
</channels-widget>
</
template
>
</
template
>
</section>
</section>
</main>
</main>
</template>
</template>
...
@@ -46,6 +40,7 @@ import ChannelsWidget from "@/components/audio/ChannelsWidget"
...
@@ -46,6 +40,7 @@ import ChannelsWidget from "@/components/audio/ChannelsWidget"
import
ArtistCard
from
"
@/components/audio/artist/Card
"
import
ArtistCard
from
"
@/components/audio/artist/Card
"
import
TrackWidget
from
"
@/components/audio/track/Widget
"
import
TrackWidget
from
"
@/components/audio/track/Widget
"
import
AlbumWidget
from
"
@/components/audio/album/Widget
"
import
AlbumWidget
from
"
@/components/audio/album/Widget
"
import
AlbumSlider
from
"
@/components/audio/album/Slider
"
import
PlaylistWidget
from
"
@/components/playlists/Widget
"
import
PlaylistWidget
from
"
@/components/playlists/Widget
"
const
ARTISTS_URL
=
"
artists/
"
const
ARTISTS_URL
=
"
artists/
"
...
@@ -62,6 +57,7 @@ export default {
...
@@ -62,6 +57,7 @@ export default {
AlbumWidget
,
AlbumWidget
,
PlaylistWidget
,
PlaylistWidget
,
ChannelsWidget
,
ChannelsWidget
,
AlbumSlider
,
},
},
data
()
{
data
()
{
return
{
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