Add album timeline
parent
8d97dc7914
commit
26d3e7068b
|
@ -9,7 +9,10 @@ return [
|
||||||
],
|
],
|
||||||
['name' => 'page#favorites', 'url' => '/favorites', 'verb' => 'GET'],
|
['name' => 'page#favorites', 'url' => '/favorites', 'verb' => 'GET'],
|
||||||
['name' => 'page#videos', 'url' => '/videos', 'verb' => 'GET'],
|
['name' => 'page#videos', 'url' => '/videos', 'verb' => 'GET'],
|
||||||
['name' => 'page#albums', 'url' => '/albums', 'verb' => 'GET'],
|
['name' => 'page#albums', 'url' => '/albums/{id}', 'verb' => 'GET',
|
||||||
|
'requirements' => [ 'id' => '.*' ],
|
||||||
|
'defaults' => [ 'id' => '' ]
|
||||||
|
],
|
||||||
['name' => 'page#archive', 'url' => '/archive', 'verb' => 'GET'],
|
['name' => 'page#archive', 'url' => '/archive', 'verb' => 'GET'],
|
||||||
['name' => 'page#thisday', 'url' => '/thisday', 'verb' => 'GET'],
|
['name' => 'page#thisday', 'url' => '/thisday', 'verb' => 'GET'],
|
||||||
['name' => 'page#people', 'url' => '/people/{name}', 'verb' => 'GET',
|
['name' => 'page#people', 'url' => '/people/{name}', 'verb' => 'GET',
|
||||||
|
|
|
@ -485,6 +485,11 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
|
||||||
query.set('tag', this.$route.params.name);
|
query.set('tag', this.$route.params.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Albums
|
||||||
|
if (this.$route.name === 'albums' && this.$route.params.id) {
|
||||||
|
query.set('album', this.$route.params.id);
|
||||||
|
}
|
||||||
|
|
||||||
// Create query string and append to URL
|
// Create query string and append to URL
|
||||||
const queryStr = query.toString();
|
const queryStr = query.toString();
|
||||||
if (queryStr) {
|
if (queryStr) {
|
||||||
|
@ -554,7 +559,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
|
||||||
data = await dav.getTagsData();
|
data = await dav.getTagsData();
|
||||||
} else if (this.$route.name === 'people' && !this.$route.params.name) {
|
} else if (this.$route.name === 'people' && !this.$route.params.name) {
|
||||||
data = await dav.getPeopleData();
|
data = await dav.getPeopleData();
|
||||||
} else if (this.$route.name === 'albums') {
|
} else if (this.$route.name === 'albums' && !this.$route.params.id) {
|
||||||
data = await dav.getAlbumsData();
|
data = await dav.getAlbumsData();
|
||||||
} else {
|
} else {
|
||||||
// Try the cache
|
// Try the cache
|
||||||
|
|
|
@ -122,9 +122,14 @@ export default class Tag extends Mixins(GlobalMixin) {
|
||||||
const name = this.data.name || this.data.fileid.toString();
|
const name = this.data.name || this.data.fileid.toString();
|
||||||
const user = this.data.user_id;
|
const user = this.data.user_id;
|
||||||
return { name: 'people', params: { name, user }};
|
return { name: 'people', params: { name, user }};
|
||||||
} else {
|
|
||||||
return { name: 'tags', params: { name: this.data.name }};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isAlbum) {
|
||||||
|
const id = this.data.fileid;
|
||||||
|
return { name: 'albums', params: { id }};
|
||||||
|
}
|
||||||
|
|
||||||
|
return { name: 'tags', params: { name: this.data.name }};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/albums',
|
path: '/albums/:id*',
|
||||||
component: Timeline,
|
component: Timeline,
|
||||||
name: 'albums',
|
name: 'albums',
|
||||||
props: route => ({
|
props: route => ({
|
||||||
|
|
Loading…
Reference in New Issue