Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-11-20 23:03:53 +0300
committerRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-11-20 23:03:53 +0300
commitbd8e4a5ce59ca26ff6041d72e9f9275537cef967 (patch)
tree7c69103c228de50bd7b10f6396b4eda3f9a7ea78 /src/router.js
parent442f43d7e0f46950c196ff697b712c0ffb5ed406 (diff)
Move router to appropriate place
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'src/router.js')
-rw-r--r--src/router.js58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/router.js b/src/router.js
new file mode 100644
index 00000000..9468e2d6
--- /dev/null
+++ b/src/router.js
@@ -0,0 +1,58 @@
+/**
+ * Nextcloud - Tasks
+ *
+ * @author Raimund Schlüßler
+ * @copyright 2018 Raimund Schlüßler <raimund.schluessler@mailbox.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+
+import Collections from './components/TheCollections/Collections'
+import Calendar from './components/TheCollections/Calendar'
+import TheDetails from './components/TheDetails'
+
+const routes = [
+ // using
+ // { path: '/collections/all', component: CollectionGeneral, alias: '/' },
+ // instead of
+ { path: '/', redirect: '/collections/all' },
+ // would also be an option, but it currently does not work
+ // reliably with router-link due to
+ // https://github.com/vuejs/vue-router/issues/419
+ { name: 'collections', path: '/collections/:collectionId', component: Collections, props: true },
+ {
+ name: 'collectionsTask',
+ path: '/collections/:collectionId/tasks/:taskId',
+ components: { default: Collections, details: TheDetails },
+ props: { default: true }
+ },
+ {
+ name: 'collectionsParamTask',
+ path: '/collections/:collectionId/:collectionParam/tasks/:taskId',
+ components: { default: Collections, details: TheDetails },
+ props: { default: true }
+ },
+ { name: 'calendars', path: '/calendars/:calendarId', component: Calendar, props: true },
+ { name: 'calendarsTask', path: '/calendars/:calendarId/tasks/:taskId', components: { default: Calendar, details: TheDetails }, props: { default: true } }
+]
+
+Vue.use(VueRouter)
+
+export default new VueRouter({
+ routes // short for `routes: routes`
+})