Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
remove debug logging
· a678fb40
Konrad Mohrfeldt
authored
Oct 20, 2019
a678fb40
implement profile page with saved posts
· a19e4a0f
Konrad Mohrfeldt
authored
Oct 20, 2019
a19e4a0f
Hide whitespace changes
Inline
Side-by-side
src/components/generic/PageIndicator.vue
View file @
a19e4a0f
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
return
new
Array
(
this
.
paginator
.
numberOfPages
).
fill
(
0
).
map
((
_
,
index
)
=>
index
+
1
)
return
new
Array
(
this
.
paginator
.
numberOfPages
).
fill
(
0
).
map
((
_
,
index
)
=>
index
+
1
)
},
},
shouldDisplay
()
{
shouldDisplay
()
{
console
.
log
(
this
.
paginator
.
collection
,
this
.
paginator
.
useTouch
,
this
.
paginator
.
behavior
===
'
replace
'
,
this
.
paginator
.
numberOfPages
)
return
this
.
paginator
.
useTouch
&&
this
.
paginator
.
behavior
===
'
replace
'
&&
this
.
paginator
.
numberOfPages
>
1
return
this
.
paginator
.
useTouch
&&
this
.
paginator
.
behavior
===
'
replace
'
&&
this
.
paginator
.
numberOfPages
>
1
}
}
},
},
...
...
src/views/ProfilePage.vue
View file @
a19e4a0f
<
template
>
<
template
>
<app-page
:title=
"$t('profile_page
_
title')"
>
<app-page
:title=
"$t('profile_page
.
title')"
>
<app-container
class=
"my-5"
>
<app-container
class=
"my-5"
>
<app-section>
<app-section>
<app-header
:title=
"$t('profile_page_title')"
/>
<app-header
:title=
"$t('profile_page.title')"
class=
"mb-5"
/>
<app-paginator
:collection=
"dataSources.recordings"
:min-height=
"300"
id=
"saved_recordings"
:page-size=
"savedRecordingSize.count"
:filters=
"savedRecordingFilters"
:empty-message=
"$t('profile_page.no_saved_recordings')"
>
<template
v-slot:header
>
<app-header
:title=
"$t('profile_page.saved_recordings')"
:level=
"2"
class=
"mb-3"
>
<app-paginator-nav/>
</app-header>
</
template
>
<
template
v-slot:default=
"{ items }"
>
<app-auto-grid
:default-size=
"savedRecordingSize.columns"
tag=
"ul"
>
<li
v-for=
"recording in items"
:key=
"recording.id"
>
<RecordingPreview
:recording=
"recording"
/>
</li>
</app-auto-grid>
</
template
>
</app-paginator>
</app-section>
</app-section>
</app-container>
</app-container>
</app-page>
</app-page>
</template>
</template>
<
script
>
<
script
>
export
default
{}
import
RecordingPreview
from
'
../components/model/RecordingPreview
'
import
{
mapState
}
from
'
../store
'
export
default
{
components
:
{
RecordingPreview
},
computed
:
{
...
mapState
({
bookmarks
:
state
=>
state
.
bookmarks
}),
savedRecordingSize
()
{
return
{
xs
:
{
count
:
3
,
columns
:
1
},
md
:
{
count
:
9
,
columns
:
3
}
}[
this
.
$mq
]
||
{
count
:
12
,
columns
:
4
}
},
savedRecordingFilters
()
{
return
{
id
:
this
.
bookmarks
.
recordings
.
length
>
0
?
this
.
bookmarks
.
recordings
.
join
(
'
,
'
)
// this id is never assigned so we can
// use it to empty the result set
:
'
-1
'
}
}
},
inject
:
[
'
dataSources
'
]
}
</
script
>
</
script
>
<i18n
lang=
"yaml"
>
<i18n
lang=
"yaml"
>
en:
en:
profile_page_title: Profile
profile_page.title: Profile
profile_page.saved_recordings: Saved Posts
profile_page.no_saved_recordings: >
You haven’t saved any posts yet. Show some love
and press that little heart button if you like a post! 🥰
de:
de:
profile_page_title: Profil
profile_page.title: Profil
profile_page.saved_recordings: Gespeicherte Beiträge
profile_page.no_saved_recordings: >
Du hast dir bisher keine Beiträge gemerkt. Zeig ein wenig Liebe
und drücke den kleinen Herz-Button, wenn dir ein Beitrag gefällt. 🥰
</i18n>
</i18n>