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

Implement paper and widescreen display size for activity #4026

Merged
merged 5 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/src/assets/icons/BigScreen.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/src/assets/icons/PaperSize.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions frontend/src/components/activity/ScheduleEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Displays a single scheduleEntry

<template>
<content-card
class="ec-schedule-entry"
toolbar
back
:loaded="!scheduleEntry()._meta.loading && !activity.camp()._meta.loading"
:max-width="isPaperDisplaySize ? '944px' : ''"
>
<template #title>
<v-toolbar-title class="font-weight-bold">
Expand Down Expand Up @@ -91,6 +93,12 @@ Displays a single scheduleEntry
<template v-else>{{ $tc('global.button.back') }}</template>
</v-btn>

<v-btn text icon class="d-none d-md-block" @click="toggleDisplaySize">
<v-icon v-if="isPaperDisplaySize" class="resize-icon"
>$vuetify.icons.bigScreen</v-icon
>
<v-icon v-else class="resize-icon">$vuetify.icons.paperSize</v-icon>
</v-btn>
<!-- hamburger menu -->
<v-menu v-if="!layoutMode" offset-y>
<template #activator="{ on, attrs }">
Expand Down Expand Up @@ -268,6 +276,7 @@ export default {
editActivityTitle: false,
categoryChangeState: null,
loading: true,
isPaperDisplaySize: true,
}
},
computed: {
Expand Down Expand Up @@ -316,6 +325,8 @@ export default {

// reload data every time user navigates to Activity view
async mounted() {
this.isPaperDisplaySize =
localStorage.getItem('activityIsPaperDisplaySize') !== 'false'
this.loading = true
await this.scheduleEntry().activity()._meta.load // wait if activity is being loaded as part of a collection
this.loading = false
Expand Down Expand Up @@ -352,6 +363,10 @@ export default {
// redirect to Picasso
this.$router.push(periodRoute(this.scheduleEntry().period()))
},
toggleDisplaySize() {
this.isPaperDisplaySize = !this.isPaperDisplaySize
localStorage.setItem('activityIsPaperDisplaySize', this.isPaperDisplaySize)
},
},
}
</script>
Expand All @@ -366,4 +381,13 @@ export default {
.e-category-chip-save-icon {
font-size: 18px;
}

.ec-schedule-entry {
transition: max-width 0.7s ease;
}

.resize-icon,
.resize-icon :deep(svg) {
width: 28px !important;
manuelmeister marked this conversation as resolved.
Show resolved Hide resolved
}
</style>
4 changes: 4 additions & 0 deletions frontend/src/plugins/vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import eCampLogo from '@/assets/eCampLogo.svg'
import CeviLogo from '@/assets/CeviLogo.svg'
import JublaLogo from '@/assets/JublaLogo.svg'
import TentDay from '@/assets/tents/TentDay.svg'
import PaperSize from '@/assets/icons/PaperSize.svg'
import BigScreen from '@/assets/icons/BigScreen.svg'
import i18n from '@/plugins/i18n'
import colors from 'vuetify/lib/util/colors'

Expand All @@ -27,6 +29,8 @@ class VuetifyLoaderPlugin {
cevi: { component: CeviLogo },
jubla: { component: JublaLogo },
tentDay: { component: TentDay },
paperSize: { component: PaperSize },
bigScreen: { component: BigScreen },
},
},
theme: {
Expand Down