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 Register from '@/views/Account/Register.vue';
|
|
|
|
import Login from '@/views/User/Login.vue';
|
|
|
|
import Validate from '@/views/User/Validate.vue';
|
|
|
|
import ResendConfirmation from '@/views/User/ResendConfirmation.vue';
|
|
|
|
import SendPasswordReset from '@/views/User/SendPasswordReset.vue';
|
|
|
|
import PasswordReset from '@/views/User/PasswordReset.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';
|
2018-01-09 17:52:26 +01:00
|
|
|
|
|
|
|
Vue.use(Router);
|
|
|
|
|
|
|
|
const router = new Router({
|
|
|
|
mode: 'history',
|
|
|
|
base: '/',
|
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
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 },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/register',
|
|
|
|
name: 'Register',
|
|
|
|
component: Register,
|
2018-07-04 14:29:17 +02:00
|
|
|
props: true,
|
2018-01-09 17:52:26 +01:00
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
2018-07-04 14:29:17 +02:00
|
|
|
{
|
|
|
|
path: '/resend-instructions',
|
|
|
|
name: 'ResendConfirmation',
|
|
|
|
component: ResendConfirmation,
|
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/password-reset/send',
|
|
|
|
name: 'SendPasswordReset',
|
|
|
|
component: SendPasswordReset,
|
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/password-reset/:token',
|
|
|
|
name: 'PasswordReset',
|
|
|
|
component: PasswordReset,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
props: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/validate/:token',
|
|
|
|
name: 'Validate',
|
|
|
|
component: Validate,
|
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
2018-01-09 17:52:26 +01:00
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
name: 'Login',
|
|
|
|
component: Login,
|
2018-07-04 14:29:17 +02:00
|
|
|
props: true,
|
2018-01-09 17:52:26 +01:00
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
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;
|