2018-01-09 17:52:26 +01:00
|
|
|
import Vue from 'vue';
|
|
|
|
import Router from 'vue-router';
|
2019-01-21 15:08:22 +01:00
|
|
|
import PageNotFound from '@/views/PageNotFound.vue';
|
|
|
|
import Home from '@/views/Home.vue';
|
|
|
|
import Event from '@/views/Event/Event.vue';
|
|
|
|
import EventList from '@/views/Event/EventList.vue';
|
|
|
|
import Location from '@/views/Location.vue';
|
|
|
|
import CreateEvent from '@/views/Event/Create.vue';
|
|
|
|
import CategoryList from '@/views/Category/List.vue';
|
|
|
|
import CreateCategory from '@/views/Category/Create.vue';
|
|
|
|
import Profile from '@/views/Account/Profile.vue';
|
|
|
|
import CreateGroup from '@/views/Group/Create.vue';
|
|
|
|
import Group from '@/views/Group/Group.vue';
|
|
|
|
import GroupList from '@/views/Group/GroupList.vue';
|
|
|
|
import Identities from '@/views/Account/Identities.vue';
|
2019-01-29 11:02:32 +01:00
|
|
|
import userRoutes from './user';
|
2018-01-09 17:52:26 +01:00
|
|
|
|
|
|
|
Vue.use(Router);
|
|
|
|
|
|
|
|
const router = new Router({
|
|
|
|
mode: 'history',
|
|
|
|
base: '/',
|
|
|
|
routes: [
|
2019-01-29 11:02:32 +01:00
|
|
|
...userRoutes,
|
2018-01-09 17:52:26 +01:00
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
name: 'Home',
|
|
|
|
component: Home,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/events/list/:location?',
|
|
|
|
name: 'EventList',
|
|
|
|
component: EventList,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/events/create',
|
|
|
|
name: 'CreateEvent',
|
|
|
|
component: CreateEvent,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2019-01-21 15:08:22 +01:00
|
|
|
path: '/events/:id/edit',
|
2018-01-09 17:52:26 +01:00
|
|
|
name: 'EditEvent',
|
|
|
|
component: CreateEvent,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/location/new',
|
|
|
|
name: 'Location',
|
|
|
|
component: Location,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/category',
|
|
|
|
name: 'CategoryList',
|
|
|
|
component: CategoryList,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/category/create',
|
|
|
|
name: 'CreateCategory',
|
|
|
|
component: CreateCategory,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
2018-07-11 13:46:19 +02:00
|
|
|
{
|
|
|
|
path: '/identities',
|
|
|
|
name: 'Identities',
|
|
|
|
component: Identities,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
2018-01-09 17:52:26 +01:00
|
|
|
{
|
2018-05-19 10:19:21 +02:00
|
|
|
path: '/groups',
|
2018-01-09 17:52:26 +01:00
|
|
|
name: 'GroupList',
|
|
|
|
component: GroupList,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
2019-01-21 15:08:22 +01:00
|
|
|
path: '/groups/create',
|
2018-01-09 17:52:26 +01:00
|
|
|
name: 'CreateGroup',
|
|
|
|
component: CreateGroup,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2018-05-19 10:19:21 +02:00
|
|
|
path: '/~:name',
|
2018-01-09 17:52:26 +01:00
|
|
|
name: 'Group',
|
|
|
|
component: Group,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
2018-05-19 10:19:21 +02:00
|
|
|
{
|
|
|
|
path: '/@:name',
|
2019-01-21 15:08:22 +01:00
|
|
|
name: 'Profile',
|
|
|
|
component: Profile,
|
2018-05-19 10:19:21 +02:00
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
2018-06-06 17:42:53 +02:00
|
|
|
path: '/events/:uuid',
|
2018-05-19 10:19:21 +02:00
|
|
|
name: 'Event',
|
|
|
|
component: Event,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
2018-07-04 14:29:17 +02:00
|
|
|
{
|
|
|
|
path: '*',
|
2018-01-09 17:52:26 +01:00
|
|
|
name: 'PageNotFound',
|
|
|
|
component: PageNotFound,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
|
|
|
|
export default router;
|