diff --git a/aleksis/apps/lesrooster/frontend/components/timetables/Timetable.vue b/aleksis/apps/lesrooster/frontend/components/timetables/Timetable.vue index 5e1ad4fdaabbf7ce747eab9a66c7e5bdcb27c2a5..b0a1cbe896cc1525ea0937eb720635b4b902d74b 100644 --- a/aleksis/apps/lesrooster/frontend/components/timetables/Timetable.vue +++ b/aleksis/apps/lesrooster/frontend/components/timetables/Timetable.vue @@ -87,6 +87,28 @@ export default { </v-card-text> </v-card> </template> + <template #additionalButton="{ selected, mobile }"> + <div :class="{ 'full-width': mobile, 'd-flex': true }" v-if="selected"> + <v-btn + outlined + color="secondary" + small + :class="{ 'mx-3 flex-grow-1': true, 'mb-3': mobile }" + :to="{ + name: 'lesrooster.timetablePrint', + params: { + timeGrid: timeGrid.id, + type: selected.type.toLowerCase(), + id: selected.objId, + }, + }" + target="_blank" + > + <v-icon left>mdi-printer-outline</v-icon> + {{ $t("lesrooster.timetable.print") }} + </v-btn> + </div> + </template> <template #default="{ selected }"> <group-time-table v-if="$route.params.type === 'group'" diff --git a/aleksis/apps/lesrooster/frontend/index.js b/aleksis/apps/lesrooster/frontend/index.js index 0484a7400813364e0d9c951d0459e7a8e4ee0fc5..df8ebf22621c5fc98ef5c4517c8e5f263931f04d 100644 --- a/aleksis/apps/lesrooster/frontend/index.js +++ b/aleksis/apps/lesrooster/frontend/index.js @@ -43,7 +43,14 @@ export default { }, ], }, - + { + path: "timetable/:timeGrid(\\d+)/:type(\\w+)/:id(\\d+)/print/", + component: () => import("aleksis.core/components/LegacyBaseTemplate.vue"), + name: "lesrooster.timetablePrint", + props: { + byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate: true, + }, + }, { path: "validity_ranges/", component: () => import("./components/validity_range/ValidityRange.vue"), diff --git a/aleksis/apps/lesrooster/frontend/messages/en.json b/aleksis/apps/lesrooster/frontend/messages/en.json index 336f8d26769fa3abaca4b4d001811a1a27acf8ad..939fd310d1c5f7544f2cb53605a20d840d0f3711 100644 --- a/aleksis/apps/lesrooster/frontend/messages/en.json +++ b/aleksis/apps/lesrooster/frontend/messages/en.json @@ -128,7 +128,8 @@ } }, "timetable": { - "menu_title": "Timetables" + "menu_title": "Timetables", + "print": "Print" }, "supervision": { "menu_title": "Supervisions",