2019-05-14 01:15:45 +02:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
|
|
|
|
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
*
|
|
|
|
* @author Julius Härtl <jus@bitgrid.net>
|
|
|
|
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2020-03-20 12:22:07 +01:00
|
|
|
|
2019-05-14 01:15:45 +02:00
|
|
|
import Vue from 'vue'
|
|
|
|
import Router from 'vue-router'
|
2020-03-20 12:22:07 +01:00
|
|
|
import { generateUrl } from '@nextcloud/router'
|
|
|
|
|
|
|
|
import Create from './views/Create'
|
|
|
|
import Results from './views/Results'
|
2020-03-21 19:07:46 +01:00
|
|
|
import Sidebar from './views/Sidebar'
|
2019-05-14 01:15:45 +02:00
|
|
|
|
|
|
|
Vue.use(Router)
|
|
|
|
|
|
|
|
export default new Router({
|
|
|
|
mode: 'history',
|
2020-03-20 12:22:07 +01:00
|
|
|
|
|
|
|
// if index.php is in the url AND we got this far, then it's working:
|
|
|
|
// let's keep using index.php in the url
|
|
|
|
base: generateUrl('/apps/forms', ''),
|
2019-05-14 01:15:45 +02:00
|
|
|
linkActiveClass: 'active',
|
2020-03-20 12:22:07 +01:00
|
|
|
|
2019-05-14 01:15:45 +02:00
|
|
|
routes: [
|
|
|
|
{
|
2020-03-20 12:22:07 +01:00
|
|
|
path: '/',
|
|
|
|
name: 'root',
|
2019-05-14 01:15:45 +02:00
|
|
|
},
|
|
|
|
{
|
2020-03-20 12:22:07 +01:00
|
|
|
path: '/new',
|
2020-03-21 19:07:46 +01:00
|
|
|
components: {
|
|
|
|
default: Create,
|
|
|
|
sidebar: Sidebar,
|
|
|
|
},
|
2020-03-20 12:22:07 +01:00
|
|
|
name: 'create',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/:hash',
|
|
|
|
name: 'fill',
|
2019-05-14 01:15:45 +02:00
|
|
|
props: true,
|
|
|
|
},
|
|
|
|
{
|
2020-03-20 12:22:07 +01:00
|
|
|
path: '/:hash/edit',
|
2020-03-21 19:07:46 +01:00
|
|
|
components: {
|
|
|
|
default: Create,
|
|
|
|
sidebar: Sidebar,
|
|
|
|
},
|
2020-03-20 12:22:07 +01:00
|
|
|
name: 'edit',
|
|
|
|
props: true,
|
2019-05-14 01:15:45 +02:00
|
|
|
},
|
|
|
|
{
|
2020-03-20 12:22:07 +01:00
|
|
|
path: '/:hash/results',
|
|
|
|
component: Results,
|
|
|
|
name: 'results',
|
2019-05-14 01:15:45 +02:00
|
|
|
props: true,
|
|
|
|
},
|
|
|
|
{
|
2020-03-20 12:22:07 +01:00
|
|
|
path: '/:hash/clone',
|
2020-03-21 19:07:46 +01:00
|
|
|
components: {
|
|
|
|
default: Create,
|
|
|
|
sidebar: Sidebar,
|
|
|
|
},
|
2020-03-20 12:22:07 +01:00
|
|
|
name: 'clone',
|
|
|
|
props: true,
|
2020-02-26 13:39:50 +01:00
|
|
|
},
|
|
|
|
],
|
2019-05-14 01:15:45 +02:00
|
|
|
})
|