From 0143148f614e1d66db9a6de2b13d4cb6b541d681 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 3 May 2023 04:10:31 -0700 Subject: [PATCH] explore: add new component Signed-off-by: Varun Patil --- appinfo/routes.php | 1 + lib/Controller/PageController.php | 10 ++ src/components/ClusterHList.vue | 88 +++++++++++ src/components/Explore.vue | 145 ++++++++++++++++++ src/components/top-matter/AlbumTopMatter.vue | 2 +- .../top-matter/ClusterTopMatter.vue | 2 +- src/components/top-matter/FaceTopMatter.vue | 2 +- src/router.ts | 10 ++ 8 files changed, 257 insertions(+), 3 deletions(-) create mode 100644 src/components/ClusterHList.vue create mode 100644 src/components/Explore.vue diff --git a/appinfo/routes.php b/appinfo/routes.php index abadaf30..8dcc3538 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -22,6 +22,7 @@ return [ ['name' => 'Page#archive', 'url' => '/archive', 'verb' => 'GET'], ['name' => 'Page#thisday', 'url' => '/thisday', 'verb' => 'GET'], ['name' => 'Page#map', 'url' => '/map', 'verb' => 'GET'], + ['name' => 'Page#explore', 'url' => '/explore', 'verb' => 'GET'], // Routes with params w(['name' => 'Page#folder', 'url' => '/folders/{path}', 'verb' => 'GET'], 'path'), diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 88d31442..8bb66405 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -214,4 +214,14 @@ class PageController extends Controller { return $this->main(); } + + /** + * @NoAdminRequired + * + * @NoCSRFRequired + */ + public function explore() + { + return $this->main(); + } } diff --git a/src/components/ClusterHList.vue b/src/components/ClusterHList.vue new file mode 100644 index 00000000..7c44e323 --- /dev/null +++ b/src/components/ClusterHList.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/components/Explore.vue b/src/components/Explore.vue new file mode 100644 index 00000000..a58f453c --- /dev/null +++ b/src/components/Explore.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/components/top-matter/AlbumTopMatter.vue b/src/components/top-matter/AlbumTopMatter.vue index 66094cf8..2190b841 100644 --- a/src/components/top-matter/AlbumTopMatter.vue +++ b/src/components/top-matter/AlbumTopMatter.vue @@ -177,7 +177,7 @@ export default defineComponent({ }, back() { - this.$router.push({ name: 'albums' }); + this.$router.go(-1); }, async downloadAlbum() { diff --git a/src/components/top-matter/ClusterTopMatter.vue b/src/components/top-matter/ClusterTopMatter.vue index 4e6316b0..b9171d1a 100644 --- a/src/components/top-matter/ClusterTopMatter.vue +++ b/src/components/top-matter/ClusterTopMatter.vue @@ -46,7 +46,7 @@ export default defineComponent({ methods: { back() { - this.$router.push({ name: this.$route.name as string }); + this.$router.go(-1); }, }, }); diff --git a/src/components/top-matter/FaceTopMatter.vue b/src/components/top-matter/FaceTopMatter.vue index 668f8fa9..cab9f315 100644 --- a/src/components/top-matter/FaceTopMatter.vue +++ b/src/components/top-matter/FaceTopMatter.vue @@ -100,7 +100,7 @@ export default defineComponent({ }, back() { - this.$router.push({ name: this.$route.name as string }); + this.$router.go(-1); }, changeShowFaceRect() { diff --git a/src/router.ts b/src/router.ts index 7f5b167b..d75901bd 100644 --- a/src/router.ts +++ b/src/router.ts @@ -3,6 +3,7 @@ import { translate as t } from '@nextcloud/l10n'; import Router from 'vue-router'; import Vue from 'vue'; import Timeline from './components/Timeline.vue'; +import Explore from './components/Explore.vue'; import SplitTimeline from './components/SplitTimeline.vue'; import ClusterView from './components/ClusterView.vue'; @@ -149,5 +150,14 @@ export default new Router({ rootTitle: t('memories', 'Map'), }), }, + + { + path: '/explore', + component: Explore, + name: 'explore', + props: (route) => ({ + rootTitle: t('memories', 'Explore'), + }), + }, ], });