-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mdit-plugins
- Loading branch information
Showing
191 changed files
with
4,398 additions
and
2,127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import Vue from 'vue/dist/vue.min'; | ||
import FullCalendar from '@fullcalendar/vue'; | ||
import dayGridPlugin from '@fullcalendar/daygrid'; | ||
import multiMonthPlugin from '@fullcalendar/multimonth'; | ||
import { faSvg } from './utils/vue_util'; | ||
|
||
$(() => { | ||
/* eslint-disable no-new */ | ||
const calendarApp = new Vue({ | ||
el: '#calendar', | ||
components: { | ||
FullCalendar, | ||
faSvg, | ||
}, | ||
data() { | ||
return { | ||
date: '', | ||
showFilter: false, | ||
calendarView: 'monthly', | ||
access: 'both', | ||
cfp: '', | ||
events: [], | ||
calendarOptions: { | ||
plugins: [dayGridPlugin, multiMonthPlugin], | ||
initialView: 'dayGridMonth', | ||
aspectRatio: 1.5, | ||
headerToolbar: { | ||
start: 'title', | ||
center: '', | ||
end: '', | ||
}, | ||
showNonCurrentDates: false, | ||
dayMaxEventRows: 1, | ||
events: async function fetchEvents(info) { | ||
const url = `${window.location.href}?${new URLSearchParams({ | ||
start: info.startStr, | ||
end: info.endStr, | ||
}).toString()}`; | ||
const response = await fetch(url, { | ||
headers: { | ||
Accept: 'application/json', | ||
'X-Requested-With': 'XMLHttpRequest', | ||
}, | ||
}); | ||
if (response && response.ok) { | ||
const responseData = await response.json(); | ||
calendarApp.events = responseData; | ||
return responseData; | ||
} | ||
return false; | ||
}, | ||
eventTimeFormat: { | ||
// like '14:30:00' | ||
hour: '2-digit', | ||
minute: '2-digit', | ||
meridiem: 'short', | ||
}, | ||
}, | ||
}; | ||
}, | ||
mounted() { | ||
this.calendar = this.$refs.fullCalendar.getApi(); | ||
this.updateTitle(); | ||
}, | ||
methods: { | ||
updateTitle() { | ||
this.date = this.calendar.currentData.viewTitle; | ||
}, | ||
updateEvents() { | ||
this.events = this.calendar.getEvents(); | ||
}, | ||
prev() { | ||
this.calendar.prev(); | ||
this.updateTitle(); | ||
}, | ||
next() { | ||
this.calendar.next(); | ||
this.updateTitle(); | ||
}, | ||
toggleFilterMenu() { | ||
this.showFilter = !this.showFilter; | ||
}, | ||
applyFilter() { | ||
this.showFilter = false; // Close filter menu | ||
switch (this.calendarView) { | ||
case 'monthly': | ||
this.calendar.changeView('dayGridMonth'); | ||
break; | ||
case 'yearly': | ||
this.calendar.changeView('multiMonthYear'); | ||
break; | ||
default: | ||
this.calendar.changeView('dayGridMonth'); | ||
} | ||
this.updateTitle(); | ||
this.updateEvents(); | ||
}, | ||
propertyVal(event, key) { | ||
return ( | ||
event && (event[key] || (event.extendedProps && event.extendedProps[key])) | ||
); | ||
}, | ||
}, | ||
computed: { | ||
filteredEvents() { | ||
return this.events | ||
.filter((event) => { | ||
if (this.access === 'member') return event.member_access; | ||
if (this.access === 'free') return !event.member_access; | ||
return event; | ||
}) | ||
.filter((event) => { | ||
if (this.cfp) return event.cfp_open === this.cfp; | ||
return event; | ||
}); | ||
}, | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
.badge { | ||
position: relative; | ||
color: $mui-text-hyperlink; | ||
min-width: $mui-grid-padding; | ||
line-height: $mui-grid-padding; | ||
min-height: $mui-grid-padding; | ||
text-align: center; | ||
display: inline-block; | ||
background-color: transparentize($mui-primary-color, 0.85); | ||
border-radius: 2px; | ||
padding: 0 $mui-grid-padding * 0.5; | ||
font-size: 10px; | ||
text-transform: uppercase; | ||
font-weight: 600; | ||
} | ||
|
||
.badge--round { | ||
border-radius: 50%; | ||
width: 25px; | ||
line-height: 25px; | ||
padding: 0; | ||
} | ||
|
||
.badge--round-smaller { | ||
width: 16px; | ||
line-height: 16px; | ||
} | ||
|
||
.badge--tab { | ||
margin-right: $mui-grid-padding * 0.25; | ||
margin-left: $mui-grid-padding * 0.25; | ||
border-radius: 16px; | ||
padding: 0 4px; | ||
width: auto; | ||
line-height: inherit; | ||
background: $mui-bg-color-primary; | ||
border: 1px solid $mui-bg-color-dark; | ||
background: $mui-bg-color-primary; | ||
} | ||
|
||
.badge-accent { | ||
background-color: $mui-bg-color-accent; | ||
color: $mui-text-dark; | ||
} | ||
|
||
.badge-light { | ||
background-color: $mui-bg-color-dark; | ||
color: $mui-text-dark; | ||
} | ||
|
||
.badge-dark { | ||
background-color: $mui-bg-color-dark; | ||
color: $mui-text-dark; | ||
} | ||
|
||
.badge-danger { | ||
background-color: $mui-danger-color; | ||
color: mui-color('white'); | ||
} | ||
|
||
.badge-success { | ||
background-color: $mui-success-color; | ||
border-color: transparentize($mui-text-success, 0.8); | ||
color: $mui-text-success; | ||
} | ||
|
||
.badge + .badge { | ||
margin-left: $mui-btn-spacing-horizontal; | ||
} |
Oops, something went wrong.