Frontend: Add folders and months to navigation #154

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-05-30 14:56:50 +02:00
parent f713a44668
commit e79abbfee7
3 changed files with 34 additions and 14 deletions

View file

@ -152,7 +152,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile>
<v-list-tile to="/folders">
<v-list-tile-content>
<v-list-tile-title><translate key="Folders">Folders</translate>
<span v-show="config.count.folders > 0"
@ -160,7 +160,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile>
<v-list-tile to="/months">
<v-list-tile-content>
<v-list-tile-title><translate key="Months">Months</translate>
<span v-show="config.count.months > 0"

View file

@ -76,7 +76,7 @@
@contextmenu="onContextMenu($event, index)"
:dark="selection.includes(album.UID)"
:class="selection.includes(album.UID) ? 'elevation-10 ma-0 accent darken-1 white--text' : 'elevation-0 ma-1 accent lighten-3'"
:to="{name: albumRoute(), params: {uid: album.UID, slug: album.Slug}}"
:to="{name: view, params: {uid: album.UID, slug: album.Slug}}"
>
<v-img
:src="album.thumbnailUrl('tile_500')"
@ -156,7 +156,8 @@
export default {
name: 'p-page-albums',
props: {
staticFilter: Object
staticFilter: Object,
view: String,
},
watch: {
'$route'() {
@ -203,13 +204,6 @@
};
},
methods: {
albumRoute() {
if(this.routeName === "moments") {
return "moment";
}
return "album";
},
selectRange(rangeEnd, models) {
if (!models || !models[rangeEnd] || !(models[rangeEnd] instanceof RestModel)) {
console.warn("selectRange() - invalid arguments:", rangeEnd, models);

View file

@ -38,20 +38,20 @@ export default [
path: "/moments",
component: Albums,
meta: {title: "Moments", auth: true},
props: {staticFilter: {type: "moment"}},
props: {view: "moment", staticFilter: {type: "moment"}},
},
{
name: "moment",
path: "/moment/:uid",
component: AlbumPhotos,
meta: {title: "Moment", auth: true},
meta: {title: "Moments", auth: true},
},
{
name: "albums",
path: "/albums",
component: Albums,
meta: {title: "Albums", auth: true},
props: {staticFilter: {type: "album"}},
props: {view: "album", staticFilter: {type: "album"}},
},
{
name: "album",
@ -59,6 +59,32 @@ export default [
component: AlbumPhotos,
meta: {title: "Album", auth: true},
},
{
name: "months",
path: "/months",
component: Albums,
meta: {title: "Months", auth: true},
props: {view: "month", staticFilter: {type: "month"}},
},
{
name: "month",
path: "/month/:uid",
component: AlbumPhotos,
meta: {title: "Months", auth: true},
},
{
name: "folders",
path: "/folders",
component: Albums,
meta: {title: "Folders", auth: true},
props: {view: "folder", staticFilter: {type: "folder"}},
},
{
name: "folder",
path: "/folder/:uid",
component: AlbumPhotos,
meta: {title: "Folders", auth: true},
},
{
name: "favorites",
path: "/favorites",