Bug 30708: Rebase - Adjust breadcrumbs
[koha.git] / koha-tmpl / intranet-tmpl / prog / js / vue / routes / preservation.js
1 import { markRaw } from "vue";
2
3 import Home from "../components/Preservation/Home.vue";
4 import TrainsList from "../components/Preservation/TrainsList.vue";
5 import TrainsShow from "../components/Preservation/TrainsShow.vue";
6 import TrainsFormAdd from "../components/Preservation/TrainsFormAdd.vue";
7 import TrainsFormAddItem from "../components/Preservation/TrainsFormAddItem.vue";
8 import TrainsFormAddItems from "../components/Preservation/TrainsFormAddItems.vue";
9 import WaitingList from "../components/Preservation/WaitingList.vue";
10 import Settings from "../components/Preservation/Settings.vue";
11 import SettingsProcessingsShow from "../components/Preservation/SettingsProcessingsShow.vue";
12 import SettingsProcessingsFormAdd from "../components/Preservation/SettingsProcessingsFormAdd.vue";
13
14 import { $__ } from "../i18n";
15
16 export const routes = [
17     {
18         path: "/cgi-bin/koha/mainpage.pl",
19         is_base: true,
20         beforeEnter(to, from, next) {
21             window.location.href = "/cgi-bin/koha/mainpage.pl";
22         },
23     },
24     {
25         path: "/cgi-bin/koha/preservation/home.pl",
26         is_default: true,
27         is_base: true,
28         title: $__("Preservation"),
29         children: [
30             {
31                 path: "",
32                 name: "Home",
33                 component: markRaw(Home),
34                 title: $__("Home"),
35                 icon: "fa fa-home",
36             },
37             {
38                 path: "/cgi-bin/koha/preservation/trains",
39                 title: $__("Trains"),
40                 icon: "fa fa-train",
41                 is_end_node: true,
42                 children: [
43                     {
44                         path: "",
45                         name: "TrainsList",
46                         component: markRaw(TrainsList),
47                     },
48                     {
49                         path: ":train_id",
50                         title: $__("Show train"),
51                         is_end_node: true,
52                         children: [
53                             {
54                                 path: "",
55                                 name: "TrainsShow",
56                                 component: markRaw(TrainsShow),
57                             },
58                             {
59                                 path: "items",
60                                 is_empty: true,
61                                 children: [
62                                     {
63                                         path: "add",
64                                         name: "TrainsFormAddItem",
65                                         component: markRaw(TrainsFormAddItem),
66                                         title: $__("Add item to train"),
67                                     },
68                                     {
69                                         path: "add/:item_ids",
70                                         name: "TrainsFormAddItems",
71                                         component: markRaw(TrainsFormAddItems),
72                                         title: $__("Add items to train"),
73                                     },
74                                     {
75                                         path: "edit/:train_item_id",
76                                         name: "TrainsFormEditItem",
77                                         component: markRaw(TrainsFormAddItem),
78                                         title: $__("Edit item in train"),
79                                     },
80                                 ],
81                             },
82                         ],
83                     },
84                     {
85                         path: "add",
86                         name: "TrainsFormAdd",
87                         component: markRaw(TrainsFormAdd),
88                         title: $__("Add train"),
89                     },
90                     {
91                         path: "edit/:train_id",
92                         name: "TrainsFormEdit",
93                         component: markRaw(TrainsFormAdd),
94                         title: $__("Edit train"),
95                     },
96                 ],
97             },
98             {
99                 path: "/cgi-bin/koha/preservation/waiting-list",
100                 title: $__("Waiting List"),
101                 icon: "fa fa-recycle",
102                 is_end_node: true,
103                 children: [
104                     {
105                         path: "",
106                         name: "WaitingList",
107                         component: markRaw(WaitingList),
108                     },
109                 ],
110             },
111             {
112                 path: "/cgi-bin/koha/preservation/settings",
113                 title: $__("Settings"),
114                 icon: "fa fa-cog",
115                 is_end_node: true,
116                 children: [
117                     {
118                         path: "",
119                         name: "Settings",
120                         component: markRaw(Settings),
121                     },
122                     {
123                         path: "processings",
124                         children: [
125                             {
126                                 path: ":processing_id",
127                                 name: "SettingsProcessingsShow",
128                                 component: markRaw(SettingsProcessingsShow),
129                                 title: $__("Show processing"),
130                             },
131                             {
132                                 path: "add",
133                                 name: "SettingsProcessingsFormAdd",
134                                 component: markRaw(SettingsProcessingsFormAdd),
135                                 title: $__("Add processing"),
136                             },
137                             {
138                                 path: "edit/:processing_id",
139                                 name: "SettingsProcessingsFormEdit",
140                                 component: markRaw(SettingsProcessingsFormAdd),
141                                 title: $__("Edit processing"),
142                             },
143                         ],
144                     },
145                 ],
146             },
147         ],
148     },
149 ];