From cf0da6327f61604da98cd80f659bce25d7e9affe Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 20 Sep 2023 23:51:57 +0200 Subject: [PATCH] Places: Improve routing when browsing pictures in a cluster #1187 Signed-off-by: Michael Mayer --- frontend/src/app/routes.js | 17 +++++++++++++---- frontend/src/component/photo/toolbar.vue | 11 ++++++----- frontend/src/page/album/photos.vue | 2 +- frontend/src/page/places.vue | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/routes.js b/frontend/src/app/routes.js index 04e15d7fa..5b2d56f7f 100644 --- a/frontend/src/app/routes.js +++ b/frontend/src/app/routes.js @@ -263,16 +263,25 @@ export default [ meta: { title: $gettext("Places"), auth: true }, }, { - name: "places_scope", - path: "/places/:s", + name: "places_view", + path: "/places/view/:s", component: Places, meta: { title: $gettext("Places"), auth: true }, }, { - name: "places_location", - path: "/location", + name: "places_browse", + path: "/places/browse", component: Photos, meta: { title: $gettext("Places"), auth: true }, + beforeEnter: (to, from, next) => { + if (session.loginRequired()) { + next({ name: "login" }); + } else if (config.deny("photos", "search")) { + next({ name: "albums" }); + } else { + next(); + } + }, }, { name: "states", diff --git a/frontend/src/component/photo/toolbar.vue b/frontend/src/component/photo/toolbar.vue index cc28f0c45..93fc99c4f 100644 --- a/frontend/src/component/photo/toolbar.vue +++ b/frontend/src/component/photo/toolbar.vue @@ -56,7 +56,7 @@