From 21b2e681988ae70683af60eb72f3e6b9289a1555 Mon Sep 17 00:00:00 2001 From: minie4 Date: Sat, 26 Aug 2023 21:54:02 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20profile=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Save class filter, timetable and timetable groups in profiles - Easily switch between profiles - Rename profiles - Export/Import/Duplicate profiles --- src/components/history-list.vue | 5 +- src/components/settings/profile-card.vue | 76 ++++++++++ src/components/settings/radio-card.vue | 76 ++++++++++ src/components/settings/timetable-card.vue | 96 +++---------- src/components/substitution-list.vue | 4 +- src/router/index.js | 6 + src/store.js | 61 +++++--- src/strings.js | 16 +++ src/views/SettingsView.vue | 6 + src/views/TimetableView.vue | 15 +- src/views/settings/FilteringSettings.vue | 4 +- src/views/settings/ProfileSettings.vue | 134 ++++++++++++++++++ src/views/settings/TimetableGroupSettings.vue | 4 +- src/views/settings/TimetableSettings.vue | 12 +- 14 files changed, 401 insertions(+), 114 deletions(-) create mode 100644 src/components/settings/profile-card.vue create mode 100644 src/components/settings/radio-card.vue create mode 100644 src/views/settings/ProfileSettings.vue diff --git a/src/components/history-list.vue b/src/components/history-list.vue index 112df05..8c368df 100644 --- a/src/components/history-list.vue +++ b/src/components/history-list.vue @@ -1,5 +1,5 @@ + + diff --git a/src/components/settings/radio-card.vue b/src/components/settings/radio-card.vue new file mode 100644 index 0000000..9d3ade3 --- /dev/null +++ b/src/components/settings/radio-card.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/components/settings/timetable-card.vue b/src/components/settings/timetable-card.vue index 1dcd18c..8bc0368 100644 --- a/src/components/settings/timetable-card.vue +++ b/src/components/settings/timetable-card.vue @@ -1,15 +1,14 @@ - - diff --git a/src/components/substitution-list.vue b/src/components/substitution-list.vue index fb6ec94..c220612 100644 --- a/src/components/substitution-list.vue +++ b/src/components/substitution-list.vue @@ -1,5 +1,5 @@ @@ -9,7 +9,7 @@ import RadioButtons from "@/components/settings/radio-buttons.vue"; diff --git a/src/views/settings/ProfileSettings.vue b/src/views/settings/ProfileSettings.vue new file mode 100644 index 0000000..4e4fc2d --- /dev/null +++ b/src/views/settings/ProfileSettings.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/views/settings/TimetableGroupSettings.vue b/src/views/settings/TimetableGroupSettings.vue index d51f12f..e62936c 100644 --- a/src/views/settings/TimetableGroupSettings.vue +++ b/src/views/settings/TimetableGroupSettings.vue @@ -1,5 +1,5 @@ @@ -9,7 +9,7 @@ import MultiselectButtons from "@/components/settings/multiselect-buttons.vue"; diff --git a/src/views/settings/TimetableSettings.vue b/src/views/settings/TimetableSettings.vue index dcb9a9a..599cb8b 100644 --- a/src/views/settings/TimetableSettings.vue +++ b/src/views/settings/TimetableSettings.vue @@ -4,7 +4,7 @@ import { timetable, timetables, localTimetables, - timetableId, + activeProfile, baseUrl, fetchTimetables, } from "@/store"; @@ -78,7 +78,7 @@ async function uploadTimetable(id) { } else { loadingProgress.value = 0.5; await fetchTimetables(); - timetableId.value = id; + activeProfile.value.timetableId = id; } loadingProgress.value = 1; @@ -94,10 +94,10 @@ async function uploadTimetable(id) { v-for="timetable in localTimetables" :key="timetable.id" :timetable="timetable" - :selected="timetableId == timetable.id" + :selected="activeProfile.timetableId == timetable.id" :editable="true" :remote="false" - @click="timetableId = timetable.id" + @click="activeProfile.timetableId = timetable.id" @edit="$router.push('timetable/edit/' + timetable.id)" @copy="copyTimetable(timetable)" @delete=" @@ -129,10 +129,10 @@ async function uploadTimetable(id) { v-for="timetable in timetables" :key="timetable.id" :timetable="timetable" - :selected="timetableId == timetable.id" + :selected="activeProfile.timetableId == timetable.id" :editable="canEditTimetable(timetable.id)" :remote="true" - @click="timetableId = timetable.id" + @click="activeProfile.timetableId = timetable.id" @copy="copyTimetable(timetable)" @export="exportTimetable(timetable)" @upload="uploadTimetable(timetable.id)"