From bb667b338a6ab02b779b77fa3db6a6214fba55ee Mon Sep 17 00:00:00 2001 From: smugg99 Date: Sun, 3 Nov 2024 23:35:58 +0100 Subject: [PATCH] added rest of the pages, made room buttons scale better --- app/config.json | 6 +- .../components.d.ts | 8 +- .../package-lock.json | 32 +++ .../package.json | 3 + .../src/components/DivisionButton.vue | 95 +++++-- .../src/components/RoomButton.vue | 139 +++++++++++ .../src/components/ScheduleTable.vue | 85 ++++--- .../src/components/TeacherButton.vue | 139 +++++++++++ .../src/components/pages/Division.vue | 9 +- .../src/components/pages/Divisions.vue | 119 ++++++--- .../src/components/pages/Room.vue | 69 ++++++ .../src/components/pages/Rooms.vue | 228 +++++++++++++++++ .../src/components/pages/Teacher.vue | 69 ++++++ .../src/components/pages/Teachers.vue | 232 ++++++++++++++++++ .../src/locales/en.js | 6 +- .../src/locales/pl.js | 4 + .../src/router.ts | 10 +- 17 files changed, 1151 insertions(+), 102 deletions(-) create mode 100644 web/optivum-better-schedule-frontend/src/components/RoomButton.vue create mode 100644 web/optivum-better-schedule-frontend/src/components/TeacherButton.vue create mode 100644 web/optivum-better-schedule-frontend/src/components/pages/Room.vue create mode 100644 web/optivum-better-schedule-frontend/src/components/pages/Rooms.vue create mode 100644 web/optivum-better-schedule-frontend/src/components/pages/Teacher.vue create mode 100644 web/optivum-better-schedule-frontend/src/components/pages/Teachers.vue diff --git a/app/config.json b/app/config.json index e220b29..26407b6 100644 --- a/app/config.json +++ b/app/config.json @@ -11,9 +11,9 @@ }, "quantities": { "workers": { - "division": 10, - "teacher": 10, - "room": 10 + "division": 5, + "teacher": 5, + "room": 5 } } }, diff --git a/web/optivum-better-schedule-frontend/components.d.ts b/web/optivum-better-schedule-frontend/components.d.ts index 4d40b2e..8ed41af 100644 --- a/web/optivum-better-schedule-frontend/components.d.ts +++ b/web/optivum-better-schedule-frontend/components.d.ts @@ -11,7 +11,7 @@ declare module 'vue' { AppBar: typeof import('./src/components/AppBar.vue')['default'] ClassesTab: typeof import('./src/components/ClassesTab.vue')['default'] Clock: typeof import('./src/components/clock/Clock.vue')['default'] - copy: typeof import('./src/components/ScheduleTable copy.vue')['default'] + copy: typeof import('./src/components/TeacherButton copy.vue')['default'] Digit: typeof import('./src/components/clock/Digit.vue')['default'] Division: typeof import('./src/components/pages/Division.vue')['default'] DivisionButton: typeof import('./src/components/DivisionButton.vue')['default'] @@ -26,12 +26,18 @@ declare module 'vue' { LanguageSwitcher: typeof import('./src/components/LanguageSwitcher.vue')['default'] Overlay: typeof import('./src/components/Overlay.vue')['default'] Rays: typeof import('./src/components/Rays.vue')['default'] + Room: typeof import('./src/components/pages/Room.vue')['default'] + RoomButton: typeof import('./src/components/RoomButton.vue')['default'] + Rooms: typeof import('./src/components/pages/Rooms.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] ScheduleTable: typeof import('./src/components/ScheduleTable.vue')['default'] Settings: typeof import('./src/components/pages/Settings.vue')['default'] SettingsPage: typeof import('./src/components/pages/SettingsPage.vue')['default'] TabContent: typeof import('./src/components/TabContent.vue')['default'] + Teacher: typeof import('./src/components/pages/Teacher.vue')['default'] + TeacherButton: typeof import('./src/components/TeacherButton.vue')['default'] + Teachers: typeof import('./src/components/pages/Teachers.vue')['default'] ThemeSwitcher: typeof import('./src/components/ThemeSwitcher.vue')['default'] Weather: typeof import('./src/components/Weather.vue')['default'] } diff --git a/web/optivum-better-schedule-frontend/package-lock.json b/web/optivum-better-schedule-frontend/package-lock.json index f666e37..bf3fa42 100644 --- a/web/optivum-better-schedule-frontend/package-lock.json +++ b/web/optivum-better-schedule-frontend/package-lock.json @@ -11,6 +11,8 @@ "@mdi/font": "7.4.47", "axios": "^1.7.7", "iso-639-1": "^3.1.3", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "pinia": "^2.2.4", "roboto-fontface": "*", "three": "^0.169.0", @@ -24,6 +26,7 @@ }, "devDependencies": { "@babel/types": "^7.24.7", + "@types/lodash-es": "^4.17.12", "@types/node": "^20.14.10", "@types/three": "^0.169.0", "@vitejs/plugin-vue": "^5.0.5", @@ -800,6 +803,23 @@ "devOptional": true, "license": "MIT" }, + "node_modules/@types/lodash": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.13.tgz", + "integrity": "sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/lodash-es": { + "version": "4.17.12", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz", + "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/lodash": "*" + } + }, "node_modules/@types/node": { "version": "20.16.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", @@ -1477,6 +1497,18 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "license": "MIT" + }, "node_modules/magic-string": { "version": "0.30.11", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", diff --git a/web/optivum-better-schedule-frontend/package.json b/web/optivum-better-schedule-frontend/package.json index fdbaca0..cbd705f 100644 --- a/web/optivum-better-schedule-frontend/package.json +++ b/web/optivum-better-schedule-frontend/package.json @@ -10,6 +10,8 @@ "@mdi/font": "7.4.47", "axios": "^1.7.7", "iso-639-1": "^3.1.3", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "pinia": "^2.2.4", "roboto-fontface": "*", "three": "^0.169.0", @@ -23,6 +25,7 @@ }, "devDependencies": { "@babel/types": "^7.24.7", + "@types/lodash-es": "^4.17.12", "@types/node": "^20.14.10", "@types/three": "^0.169.0", "@vitejs/plugin-vue": "^5.0.5", diff --git a/web/optivum-better-schedule-frontend/src/components/DivisionButton.vue b/web/optivum-better-schedule-frontend/src/components/DivisionButton.vue index 68d95e2..3dfb39f 100644 --- a/web/optivum-better-schedule-frontend/src/components/DivisionButton.vue +++ b/web/optivum-better-schedule-frontend/src/components/DivisionButton.vue @@ -1,8 +1,12 @@ + @@ -23,17 +27,22 @@ interface VanillaTiltHTMLElement extends HTMLElement { vanillaTilt: VanillaTilt; } -const props = defineProps<{ text: string; index: number; id: number }>(); -const tilt = ref(null); +const props = defineProps<{ + text: string; + designator: string; + index: number; + id: number; +}>(); +const tilt = ref(null); const enableTilt = ref(window.innerWidth > 700); watchEffect(() => { if (enableTilt.value && tilt.value) { VanillaTilt.init(tilt.value, { - max: 20, - speed: 10, - scale: 1.25, + max: 15, + speed: 400, + scale: 1.05, glare: false, reverse: false, transition: true, @@ -43,21 +52,21 @@ watchEffect(() => { } }); -window.addEventListener('resize', () => { +const resizeHandler = () => { enableTilt.value = window.innerWidth > 700; -}); +}; + +window.addEventListener('resize', resizeHandler); onUnmounted(() => { if (tilt.value?.vanillaTilt) { tilt.value.vanillaTilt.destroy(); } - window.removeEventListener('resize', () => { - enableTilt.value = window.innerWidth > 700; - }); + window.removeEventListener('resize', resizeHandler); }); - diff --git a/web/optivum-better-schedule-frontend/src/components/RoomButton.vue b/web/optivum-better-schedule-frontend/src/components/RoomButton.vue new file mode 100644 index 0000000..513cdd5 --- /dev/null +++ b/web/optivum-better-schedule-frontend/src/components/RoomButton.vue @@ -0,0 +1,139 @@ + + + + + diff --git a/web/optivum-better-schedule-frontend/src/components/ScheduleTable.vue b/web/optivum-better-schedule-frontend/src/components/ScheduleTable.vue index 4a6c664..5a87a78 100644 --- a/web/optivum-better-schedule-frontend/src/components/ScheduleTable.vue +++ b/web/optivum-better-schedule-frontend/src/components/ScheduleTable.vue @@ -20,14 +20,15 @@ - - - + + + - {{ groupIndex + 1 - }}. + + {{ groupIndex + 1 }}. +
{{ @@ -36,39 +37,40 @@ formatTime(lessonGroup.lessons[0]?.time_range.end) }}
-
- {{ lesson.full_name }}  - + {{ lesson.full_name }} +   -  {{ lesson.teacher_designator }} + {{ lesson.teacher_designator }} - +   -  {{ lesson.room_designator }} + {{ lesson.room_designator }} - +   -  {{ lesson.division_designator }} + {{ lesson.division_designator }}
-
-
+ + + @@ -96,7 +98,7 @@
+ v-if="day.lesson_groups && day.lesson_groups.some((lg: LessonGroup) => formatTime(lg.lessons[0]?.time_range.start) + ' - ' + formatTime(lg.lessons[0]?.time_range.end) === timeRange)">
{{ lesson.full_name }} @@ -126,12 +128,15 @@ + + diff --git a/web/optivum-better-schedule-frontend/src/components/pages/Division.vue b/web/optivum-better-schedule-frontend/src/components/pages/Division.vue index 07d1a16..180ff34 100644 --- a/web/optivum-better-schedule-frontend/src/components/pages/Division.vue +++ b/web/optivum-better-schedule-frontend/src/components/pages/Division.vue @@ -9,19 +9,16 @@
--> - + - + --> diff --git a/web/optivum-better-schedule-frontend/src/components/pages/Divisions.vue b/web/optivum-better-schedule-frontend/src/components/pages/Divisions.vue index 4d25456..cbacc97 100644 --- a/web/optivum-better-schedule-frontend/src/components/pages/Divisions.vue +++ b/web/optivum-better-schedule-frontend/src/components/pages/Divisions.vue @@ -1,33 +1,49 @@ + \ No newline at end of file + diff --git a/web/optivum-better-schedule-frontend/src/components/pages/Room.vue b/web/optivum-better-schedule-frontend/src/components/pages/Room.vue new file mode 100644 index 0000000..fe65a99 --- /dev/null +++ b/web/optivum-better-schedule-frontend/src/components/pages/Room.vue @@ -0,0 +1,69 @@ + + + + + + \ No newline at end of file diff --git a/web/optivum-better-schedule-frontend/src/components/pages/Rooms.vue b/web/optivum-better-schedule-frontend/src/components/pages/Rooms.vue new file mode 100644 index 0000000..c3eaf80 --- /dev/null +++ b/web/optivum-better-schedule-frontend/src/components/pages/Rooms.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/web/optivum-better-schedule-frontend/src/components/pages/Teacher.vue b/web/optivum-better-schedule-frontend/src/components/pages/Teacher.vue new file mode 100644 index 0000000..11f35f7 --- /dev/null +++ b/web/optivum-better-schedule-frontend/src/components/pages/Teacher.vue @@ -0,0 +1,69 @@ + + + + + + \ No newline at end of file diff --git a/web/optivum-better-schedule-frontend/src/components/pages/Teachers.vue b/web/optivum-better-schedule-frontend/src/components/pages/Teachers.vue new file mode 100644 index 0000000..d97043e --- /dev/null +++ b/web/optivum-better-schedule-frontend/src/components/pages/Teachers.vue @@ -0,0 +1,232 @@ + + + + + + diff --git a/web/optivum-better-schedule-frontend/src/locales/en.js b/web/optivum-better-schedule-frontend/src/locales/en.js index f7079df..5f02a85 100644 --- a/web/optivum-better-schedule-frontend/src/locales/en.js +++ b/web/optivum-better-schedule-frontend/src/locales/en.js @@ -101,7 +101,11 @@ export default { }, page: { title: 'Optivum - Better Schedule', - not_found: 'Page Not Found', + not_found: 'Page not found', + no_schedule: 'No schedule for this day', + no_divisions: 'No divisions found', + no_teachers: 'No teachers found', + no_rooms: 'No classrooms found', home: 'Home', divisions: 'Divisions', division: 'Division - {id}', diff --git a/web/optivum-better-schedule-frontend/src/locales/pl.js b/web/optivum-better-schedule-frontend/src/locales/pl.js index 3508360..ae1d583 100644 --- a/web/optivum-better-schedule-frontend/src/locales/pl.js +++ b/web/optivum-better-schedule-frontend/src/locales/pl.js @@ -102,6 +102,10 @@ export default { page: { title: 'Optivum - Lepszy Plan Lekcji', not_found: 'Nie znaleziono strony', + no_schedule: 'Brak planu na ten dzień', + no_divisions: 'Nie znaleziono klas', + no_teachers: 'Nie znaleziono nauczycieli', + no_rooms: 'Nie znaleziono sali', home: 'Strona główna', divisions: 'Klasy', division: 'Klasa - {id}', diff --git a/web/optivum-better-schedule-frontend/src/router.ts b/web/optivum-better-schedule-frontend/src/router.ts index d8d20ac..3d21b2e 100644 --- a/web/optivum-better-schedule-frontend/src/router.ts +++ b/web/optivum-better-schedule-frontend/src/router.ts @@ -1,19 +1,25 @@ import { createRouter, createWebHistory } from 'vue-router' import MainPage from './components/pages/Home.vue' import DivisionsPage from './components/pages/Divisions.vue' +import TeachersPage from './components/pages/Teachers.vue' +import RoomsPage from './components/pages/Rooms.vue' import SettingsPage from './components/pages/Settings.vue' import DivisionPage from './components/pages/Division.vue' +import TeacherPage from './components/pages/Teacher.vue' +import RoomPage from './components/pages/Room.vue' const routes = [ { path: '/', component: MainPage, meta: { titleKey: 'page.home' } }, { path: '/home', component: MainPage, meta: { titleKey: 'page.home' } }, { path: '/divisions', component: DivisionsPage, meta: { titleKey: 'page.divisions' } }, - { path: '/teachers', component: MainPage, meta: { titleKey: 'page.teachers' } }, - { path: '/rooms', component: MainPage, meta: { titleKey: 'page.rooms' } }, + { path: '/teachers', component: TeachersPage, meta: { titleKey: 'page.teachers' } }, + { path: '/rooms', component: RoomsPage, meta: { titleKey: 'page.rooms' } }, { path: '/settings', component: SettingsPage, meta: { titleKey: 'page.settings' } }, { path: '/division/:id', component: DivisionPage, props: true, meta: { titleKey: 'page.division' } }, + { path: '/teacher/:id', component: TeacherPage, props: true, meta: { titleKey: 'page.teacher' } }, + { path: '/room/:id', component: RoomPage, props: true, meta: { titleKey: 'page.room' } }, ] const router = createRouter({