Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize settings switches #118

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/src/components/SettingsBaseSwitch.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
const checked = defineModel<boolean>()
defineProps<{ label: string }>()
defineProps<{ label: string; icon?: string }>()
</script>

<template>
<v-row>
<v-col>
<v-switch v-model="checked" class="settings-base-switch">
<v-switch v-model="checked" :true-icon="icon" :false-icon="icon" class="settings-base-switch">
<template #label>{{ label }}</template>
</v-switch>
</v-col>
Expand Down
5 changes: 3 additions & 2 deletions website/src/stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ export const useSettingsStore = defineStore('settings', {

showSubstitutions: true,
showLinksInTimetable: true,
showDatesInTimetable: true,
showHoursInTimetable: true,
highlightCurrentTime: true,
enableLessonDetails: true,

showDatesInTimetable: true,
showHoursInTimetable: true,
enablePullToRefresh: true,

dataCollectionPerformance: navigator.doNotTrack !== '1' && !navigator.globalPrivacyControl,
Expand Down
23 changes: 20 additions & 3 deletions website/src/views/ViewSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
mdiInformationOutline,
mdiKeyOutline,
mdiMessageAlertOutline,
mdiMonitor,
mdiPaletteOutline,
mdiTabletCellphone,
mdiTuneVariant,
mdiUpdate,
mdiWeatherNight,
Expand Down Expand Up @@ -100,11 +102,26 @@ async function updateApp() {

<SettingsBaseSwitch v-model="showSubstitutions" label="Prikaži nadomeščanja" />
<SettingsBaseSwitch v-model="showLinksInTimetable" label="Prikaži povezave v urniku" />
<SettingsBaseSwitch v-model="showDatesInTimetable" label="Prikaži datume v urniku" />
<SettingsBaseSwitch v-model="showHoursInTimetable" label="Prikaži ure v urniku" />
<SettingsBaseSwitch v-model="highlightCurrentTime" label="Označi trenutno uro" />
<SettingsBaseSwitch v-model="enableLessonDetails" label="Klikni za podrobnosti" />
<SettingsBaseSwitch v-model="enablePullToRefresh" label="Potegni za posodobitev" />

<v-divider-settings />

<SettingsBaseSwitch
v-model="showDatesInTimetable"
label="Prikaži datume v urniku"
:icon="mdiMonitor"
/>
<SettingsBaseSwitch
v-model="showHoursInTimetable"
label="Prikaži ure v urniku"
:icon="mdiMonitor"
/>
<SettingsBaseSwitch
v-model="enablePullToRefresh"
label="Potegni za posodobitev"
:icon="mdiTabletCellphone"
/>

<v-divider-settings />

Expand Down