Lines 1-3
Link Here
|
|
|
1 |
import { markRaw } from "vue"; |
2 |
|
1 |
import Home from "../components/Preservation/Home.vue"; |
3 |
import Home from "../components/Preservation/Home.vue"; |
2 |
import TrainsList from "../components/Preservation/TrainsList.vue"; |
4 |
import TrainsList from "../components/Preservation/TrainsList.vue"; |
3 |
import TrainsShow from "../components/Preservation/TrainsShow.vue"; |
5 |
import TrainsShow from "../components/Preservation/TrainsShow.vue"; |
Lines 9-242
import Settings from "../components/Preservation/Settings.vue";
Link Here
|
9 |
import SettingsProcessingsShow from "../components/Preservation/SettingsProcessingsShow.vue"; |
11 |
import SettingsProcessingsShow from "../components/Preservation/SettingsProcessingsShow.vue"; |
10 |
import SettingsProcessingsFormAdd from "../components/Preservation/SettingsProcessingsFormAdd.vue"; |
12 |
import SettingsProcessingsFormAdd from "../components/Preservation/SettingsProcessingsFormAdd.vue"; |
11 |
|
13 |
|
12 |
const breadcrumbs = { |
14 |
import { $__ } from "../i18n"; |
13 |
home: { |
|
|
14 |
text: "Home", // $t("Home") |
15 |
path: "/cgi-bin/koha/mainpage.pl", |
16 |
}, |
17 |
preservation_home: { |
18 |
text: "Preservation", //$t("Preservation") |
19 |
path: "/cgi-bin/koha/preservation/home.pl", |
20 |
}, |
21 |
trains: { |
22 |
text: "Trains", // $t("Trains") |
23 |
path: "/cgi-bin/koha/preservation/trains", |
24 |
}, |
25 |
waiting_list: { |
26 |
text: "Waiting list", // $t("Waiting list") |
27 |
path: "/cgi-bin/koha/preservation/waiting-list", |
28 |
}, |
29 |
settings: { |
30 |
home: { |
31 |
text: "Settings", // $t("Settings") |
32 |
path: "/cgi-bin/koha/preservation/settings", |
33 |
}, |
34 |
processings: { |
35 |
home: { |
36 |
text: "Processings", //$t("Processings") |
37 |
}, |
38 |
}, |
39 |
}, |
40 |
}; |
41 |
const breadcrumb_paths = { |
42 |
trains: [ |
43 |
breadcrumbs.home, |
44 |
breadcrumbs.preservation_home, |
45 |
breadcrumbs.trains, |
46 |
], |
47 |
settings: [ |
48 |
breadcrumbs.home, |
49 |
breadcrumbs.preservation_home, |
50 |
breadcrumbs.settings.home, |
51 |
], |
52 |
settings_processings: [ |
53 |
breadcrumbs.home, |
54 |
breadcrumbs.preservation_home, |
55 |
breadcrumbs.settings.home, |
56 |
], |
57 |
}; |
58 |
|
59 |
function build_breadcrumb(parent_breadcrumb, current) { |
60 |
let breadcrumb = parent_breadcrumb.flat(Infinity); |
61 |
if (current) { |
62 |
breadcrumb.push({ |
63 |
text: current, |
64 |
}); |
65 |
} |
66 |
return breadcrumb; |
67 |
} |
68 |
|
15 |
|
69 |
export const routes = [ |
16 |
export const routes = [ |
70 |
{ |
17 |
{ |
71 |
path: "/cgi-bin/koha/mainpage.pl", |
18 |
path: "/cgi-bin/koha/mainpage.pl", |
|
|
19 |
is_base: true, |
72 |
beforeEnter(to, from, next) { |
20 |
beforeEnter(to, from, next) { |
73 |
window.location.href = "/cgi-bin/koha/mainpage.pl"; |
21 |
window.location.href = "/cgi-bin/koha/mainpage.pl"; |
74 |
}, |
22 |
}, |
75 |
}, |
23 |
}, |
76 |
{ |
24 |
{ |
77 |
path: "/cgi-bin/koha/preservation/home.pl", |
25 |
path: "/cgi-bin/koha/preservation/home.pl", |
78 |
name: "Home", |
26 |
is_default: true, |
79 |
component: Home, |
27 |
is_base: true, |
80 |
meta: { |
28 |
title: $__("Preservation"), |
81 |
breadcrumb: () => [breadcrumbs.home, breadcrumbs.preservation_home], |
|
|
82 |
}, |
83 |
}, |
84 |
{ |
85 |
path: "/cgi-bin/koha/preservation/trains", |
86 |
children: [ |
29 |
children: [ |
87 |
{ |
30 |
{ |
88 |
path: "", |
31 |
path: "", |
89 |
name: "TrainsList", |
32 |
name: "Home", |
90 |
component: TrainsList, |
33 |
component: markRaw(Home), |
91 |
meta: { |
34 |
title: $__("Home"), |
92 |
breadcrumb: () => breadcrumb_paths.trains, |
35 |
icon: "fa fa-home", |
93 |
}, |
|
|
94 |
}, |
36 |
}, |
95 |
{ |
37 |
{ |
96 |
path: ":train_id", |
38 |
path: "/cgi-bin/koha/preservation/trains", |
|
|
39 |
title: $__("Trains"), |
40 |
icon: "fa fa-train", |
41 |
is_end_node: true, |
97 |
children: [ |
42 |
children: [ |
98 |
{ |
43 |
{ |
99 |
path: "", |
44 |
path: "", |
100 |
name: "TrainsShow", |
45 |
name: "TrainsList", |
101 |
component: TrainsShow, |
46 |
component: markRaw(TrainsList), |
102 |
meta: { |
|
|
103 |
breadcrumb: () => |
104 |
build_breadcrumb( |
105 |
breadcrumb_paths.trains, |
106 |
"Show train" // $t("Show train") |
107 |
), |
108 |
}, |
109 |
}, |
47 |
}, |
110 |
{ |
48 |
{ |
111 |
path: "items", |
49 |
path: ":train_id", |
|
|
50 |
title: $__("Show train"), |
51 |
is_end_node: true, |
112 |
children: [ |
52 |
children: [ |
113 |
{ |
53 |
{ |
114 |
path: "add", |
54 |
path: "", |
115 |
name: "TrainsFormAddItem", |
55 |
name: "TrainsShow", |
116 |
component: TrainsFormAddItem, |
56 |
component: markRaw(TrainsShow), |
117 |
meta: { |
|
|
118 |
breadcrumb: () => |
119 |
build_breadcrumb( |
120 |
breadcrumb_paths.trains, |
121 |
"Add item to train" // $t("Add item to train") |
122 |
), |
123 |
}, |
124 |
}, |
125 |
{ |
126 |
path: "add/:item_ids", |
127 |
name: "TrainsFormAddItems", |
128 |
component: TrainsFormAddItems, |
129 |
meta: { |
130 |
breadcrumb: () => |
131 |
build_breadcrumb( |
132 |
breadcrumb_paths.trains, |
133 |
"Add items to train" // $t("Add items to train") |
134 |
), |
135 |
}, |
136 |
}, |
57 |
}, |
137 |
{ |
58 |
{ |
138 |
path: "edit/:train_item_id", |
59 |
path: "items", |
139 |
name: "TrainsFormEditItem", |
60 |
is_empty: true, |
140 |
component: TrainsFormAddItem, |
61 |
children: [ |
141 |
meta: { |
62 |
{ |
142 |
breadcrumb: () => |
63 |
path: "add", |
143 |
build_breadcrumb( |
64 |
name: "TrainsFormAddItem", |
144 |
breadcrumb_paths.trains, |
65 |
component: markRaw(TrainsFormAddItem), |
145 |
"Edit item in train" // $t("Edit item in train") |
66 |
title: $__("Add item to train"), |
146 |
), |
67 |
}, |
147 |
}, |
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 |
], |
148 |
}, |
81 |
}, |
149 |
], |
82 |
], |
150 |
}, |
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 |
}, |
151 |
], |
96 |
], |
152 |
}, |
97 |
}, |
153 |
{ |
98 |
{ |
154 |
path: "add", |
99 |
path: "/cgi-bin/koha/preservation/waiting-list", |
155 |
name: "TrainsFormAdd", |
100 |
title: $__("Waiting List"), |
156 |
component: TrainsFormAdd, |
101 |
icon: "fa fa-recycle", |
157 |
meta: { |
102 |
is_end_node: true, |
158 |
breadcrumb: () => |
|
|
159 |
build_breadcrumb( |
160 |
breadcrumb_paths.trains, |
161 |
"Add train" // $t("Add train") |
162 |
), |
163 |
}, |
164 |
}, |
165 |
{ |
166 |
path: "edit/:train_id", |
167 |
name: "TrainsFormEdit", |
168 |
component: TrainsFormAdd, |
169 |
meta: { |
170 |
breadcrumb: () => |
171 |
build_breadcrumb( |
172 |
breadcrumb_paths.trains, |
173 |
"Edit train" // $t("Edit train") |
174 |
), |
175 |
}, |
176 |
}, |
177 |
], |
178 |
}, |
179 |
{ |
180 |
path: "/cgi-bin/koha/preservation/waiting-list", |
181 |
name: "WaitingList", |
182 |
component: WaitingList, |
183 |
meta: { |
184 |
breadcrumb: () => [ |
185 |
breadcrumbs.home, |
186 |
breadcrumbs.preservation_home, |
187 |
breadcrumbs.waiting_list, |
188 |
], |
189 |
}, |
190 |
}, |
191 |
{ |
192 |
path: "/cgi-bin/koha/preservation/settings", |
193 |
children: [ |
194 |
{ |
195 |
path: "", |
196 |
name: "Settings", |
197 |
component: Settings, |
198 |
meta: { |
199 |
breadcrumb: () => breadcrumb_paths.settings, |
200 |
}, |
201 |
}, |
202 |
{ |
203 |
path: "processings", |
204 |
children: [ |
103 |
children: [ |
205 |
{ |
104 |
{ |
206 |
path: ":processing_id", |
105 |
path: "", |
207 |
name: "SettingsProcessingsShow", |
106 |
name: "WaitingList", |
208 |
component: SettingsProcessingsShow, |
107 |
component: markRaw(WaitingList), |
209 |
meta: { |
|
|
210 |
breadcrumb: () => |
211 |
build_breadcrumb( |
212 |
breadcrumb_paths.settings_processings, |
213 |
"Show processing" // $t("Show processing") |
214 |
), |
215 |
}, |
216 |
}, |
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: [ |
217 |
{ |
117 |
{ |
218 |
path: "add", |
118 |
path: "", |
219 |
name: "SettingsProcessingsFormAdd", |
119 |
name: "Settings", |
220 |
component: SettingsProcessingsFormAdd, |
120 |
component: markRaw(Settings), |
221 |
meta: { |
|
|
222 |
breadcrumb: () => |
223 |
build_breadcrumb( |
224 |
breadcrumb_paths.settings_processings, |
225 |
"Add processing" // $t("Add processing") |
226 |
), |
227 |
}, |
228 |
}, |
121 |
}, |
229 |
{ |
122 |
{ |
230 |
path: "edit/:processing_id", |
123 |
path: "processings", |
231 |
name: "SettingsProcessingsFormEdit", |
124 |
children: [ |
232 |
component: SettingsProcessingsFormAdd, |
125 |
{ |
233 |
meta: { |
126 |
path: ":processing_id", |
234 |
breadcrumb: () => |
127 |
name: "SettingsProcessingsShow", |
235 |
build_breadcrumb( |
128 |
component: markRaw(SettingsProcessingsShow), |
236 |
breadcrumb_paths.settings_processings, |
129 |
title: $__("Show processing"), |
237 |
"Edit processing" // $t("Edit processing") |
130 |
}, |
238 |
), |
131 |
{ |
239 |
}, |
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 |
], |
240 |
}, |
144 |
}, |
241 |
], |
145 |
], |
242 |
}, |
146 |
}, |
243 |
- |
|
|