datatracker/client/agenda/AgendaMobileBar.vue
Nicolas Giard 6f2114fb0c
feat: replace old agenda with agenda-neue (#4406)
* feat: remove old agenda (django-side)

* fix: bring in latest commits

* test: remove -neue from playwright tests

* test: remove agenda selenium js tests

* test: remove agenda views tests

* fix: remove deprecated agenda views (week-view, agenda-by, floor-plan)

* test: fix failing python tests

* test: remove more deprecated tests

* chore: remove deprecated templates

* test: remove unused import

* feat: handle agenda personalize with filter + move agenda specific stuff out of root component

* fix: redirect deprecated urls to agenda / floorplan

* feat: agenda - open picker mode when from personalize path

* fix: safari doesn't support device-pixel-content-box property on ResizeObserver

* test: move floor plan test into main agenda test

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2022-10-12 15:46:28 -05:00

122 lines
2.7 KiB
Vue

<template lang="pug">
.agenda-mobile-bar(v-if='siteStore.viewport < 990')
button(@click='agendaStore.$patch({ filterShown: true })')
i.bi.bi-filter-square-fill.me-2
span Filters
n-badge.ms-2(:value='agendaStore.selectedCatSubs.length', processing)
button(@click='agendaStore.$patch({ calendarShown: true })')
i.bi.bi-calendar3.me-2
span Cal
n-dropdown(
:options='downloadIcsOptions'
size='huge'
:show-arrow='true'
trigger='click'
@select='downloadIcs'
)
button
i.bi.bi-calendar-check.me-2
span .ics
button(@click='agendaStore.$patch({ settingsShown: !agendaStore.settingsShown })')
i.bi.bi-gear
</template>
<script setup>
import { h } from 'vue'
import {
NBadge,
NDropdown,
useMessage
} from 'naive-ui'
import { useAgendaStore } from './store'
import { useSiteStore } from '../shared/store';
// MESSAGE PROVIDER
const message = useMessage()
// STORES
const agendaStore = useAgendaStore()
const siteStore = useSiteStore()
// Download Ics Options
const downloadIcsOptions = [
{
label: 'Subscribe... (webcal)',
key: 'subscribe',
icon: () => h('i', { class: 'bi bi-calendar-week text-blue' })
},
{
label: 'Download... (.ics)',
key: 'download',
icon: () => h('i', { class: 'bi bi-arrow-down-square' })
}
]
// METHODS
function downloadIcs (key) {
message.loading('Generating calendar file... Download will begin shortly.')
let icsUrl = ''
if (agendaStore.pickerMode) {
const sessionKeywords = agendaStore.scheduleAdjusted.map(s => s.sessionKeyword)
icsUrl = `/meeting/${agendaStore.meeting.number}/agenda.ics?show=${sessionKeywords.join(',')}`
} else if (agendaStore.selectedCatSubs.length > 0) {
icsUrl = `/meeting/${agendaStore.meeting.number}/agenda.ics?show=${agendaStore.selectedCatSubs.join(',')}`
} else {
icsUrl = `/meeting/${agendaStore.meeting.number}/agenda.ics`
}
if (key === 'subscribe') {
window.location.assign(`webcal://${window.location.host}${icsUrl}`)
} else {
window.location.assign(icsUrl)
}
}
</script>
<style lang="scss">
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
.agenda-mobile-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background-color: rgba(0,0,0,.75);
backdrop-filter: blur(10px);
display: flex;
justify-content: space-between;
button {
height: 50px;
border: none;
background-color: transparent;
color: #FFF;
padding: 0 15px;
transition: all .4s ease;
& + button {
margin-left: 1px;
}
i.bi {
font-size: 1.2em;
}
&:hover {
background-color: $blue-400;
}
&:active {
background-color: $blue-700;
}
}
}
</style>