mobilizon.chapril.org-mobil.../js/src/router/event.ts

110 lines
3.2 KiB
TypeScript
Raw Normal View History

import { RouteConfig } from "vue-router";
import EventList from "../views/Event/EventList.vue";
import Location from "../views/Location.vue";
2019-02-22 14:55:47 +01:00
const participations = () =>
import(/* webpackChunkName: "participations" */ "@/views/Event/Participants.vue");
const editEvent = () => import(/* webpackChunkName: "edit-event" */ "@/views/Event/Edit.vue");
const event = () => import(/* webpackChunkName: "event" */ "@/views/Event/Event.vue");
const myEvents = () => import(/* webpackChunkName: "my-events" */ "@/views/Event/MyEvents.vue");
const explore = () => import(/* webpackChunkName: "explore" */ "@/views/Event/Explore.vue");
2019-02-22 14:55:47 +01:00
export enum EventRouteName {
EVENT_LIST = "EventList",
CREATE_EVENT = "CreateEvent",
MY_EVENTS = "MyEvents",
EXPLORE = "Explore",
EDIT_EVENT = "EditEvent",
PARTICIPATIONS = "Participations",
EVENT = "Event",
EVENT_PARTICIPATE_WITH_ACCOUNT = "EVENT_PARTICIPATE_WITH_ACCOUNT",
EVENT_PARTICIPATE_WITHOUT_ACCOUNT = "EVENT_PARTICIPATE_WITHOUT_ACCOUNT",
EVENT_PARTICIPATE_LOGGED_OUT = "EVENT_PARTICIPATE_LOGGED_OUT",
EVENT_PARTICIPATE_CONFIRM = "EVENT_PARTICIPATE_CONFIRM",
LOCATION = "Location",
TAG = "Tag",
2019-02-22 14:55:47 +01:00
}
export const eventRoutes: RouteConfig[] = [
2019-02-22 14:55:47 +01:00
{
path: "/events/list/:location?",
2019-02-22 14:55:47 +01:00
name: EventRouteName.EVENT_LIST,
component: EventList,
meta: { requiredAuth: false },
},
{
path: "/events/create",
2019-02-22 14:55:47 +01:00
name: EventRouteName.CREATE_EVENT,
2019-09-02 14:35:50 +02:00
component: editEvent,
2019-02-22 14:55:47 +01:00
meta: { requiredAuth: true },
},
{
path: "/events/explore",
name: EventRouteName.EXPLORE,
component: explore,
meta: { requiredAuth: false },
},
{
path: "/events/me",
name: EventRouteName.MY_EVENTS,
component: myEvents,
meta: { requiredAuth: true },
},
2019-02-22 14:55:47 +01:00
{
path: "/events/edit/:eventId",
2019-02-22 14:55:47 +01:00
name: EventRouteName.EDIT_EVENT,
2019-09-02 14:35:50 +02:00
component: editEvent,
2019-02-22 14:55:47 +01:00
meta: { requiredAuth: true },
props: true,
2019-02-22 14:55:47 +01:00
},
{
path: "/events/:eventId/participations",
name: EventRouteName.PARTICIPATIONS,
component: participations,
meta: { requiredAuth: true },
props: true,
},
2019-02-22 14:55:47 +01:00
{
path: "/location/new",
2019-02-22 14:55:47 +01:00
name: EventRouteName.LOCATION,
component: Location,
meta: { requiredAuth: true },
},
{
path: "/events/:uuid",
2019-02-22 14:55:47 +01:00
name: EventRouteName.EVENT,
component: event,
2019-02-22 14:55:47 +01:00
props: true,
meta: { requiredAuth: false },
},
{
path: "/events/:uuid/participate",
name: EventRouteName.EVENT_PARTICIPATE_LOGGED_OUT,
component: () => import("../components/Participation/UnloggedParticipation.vue"),
props: true,
},
{
path: "/events/:uuid/participate/with-account",
name: EventRouteName.EVENT_PARTICIPATE_WITH_ACCOUNT,
component: () => import("../components/Participation/ParticipationWithAccount.vue"),
props: true,
},
{
path: "/events/:uuid/participate/without-account",
name: EventRouteName.EVENT_PARTICIPATE_WITHOUT_ACCOUNT,
component: () => import("../components/Participation/ParticipationWithoutAccount.vue"),
props: true,
},
{
path: "/participation/email/confirm/:token",
name: EventRouteName.EVENT_PARTICIPATE_CONFIRM,
component: () => import("../components/Participation/ConfirmParticipation.vue"),
props: true,
},
{
path: "/tag/:tag",
name: EventRouteName.TAG,
redirect: "/search/:tag",
},
2019-02-22 14:55:47 +01:00
];