Created
March 6, 2017 21:09
-
-
Save caseyWebb/cdf0b4298a0512ff93af9b16db6aa45f to your computer and use it in GitHub Desktop.
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
import events from '../events' | |
const COURSE_TYPES = new Map([ | |
['/', 0], | |
['/on-demand', 1], | |
['/live', 2], | |
['/assessment', 4] | |
]) | |
export default { | |
title: 'Courses', | |
query: { | |
sponsors: [], | |
tags: [], | |
audiences: [], | |
visible: [], | |
statuses: { | |
default: [1], | |
coerce: (v) => v.length === 0 ? [0] : v | |
}, | |
searchText: '', | |
sort: 'p' | |
}, | |
routes: { | |
'/:type(|assessment|live|on-demand)': { | |
query: { | |
createQueryFactory(ctx) { | |
const q = ctx.$parent.query | |
q.set({ courseType: COURSE_TYPES.get(ctx.pathname) }) | |
return q | |
} | |
}, | |
collection: () => import('./collection'), | |
component: () => ({ | |
template: import('./template.html'), | |
viewModel: import('./viewmodel') | |
}) | |
} | |
}, | |
components: () => ({ | |
shared: [ | |
'filter-button' | |
], | |
'course-list': import('./course-list') | |
'course-list-sorter': import('./course-list-sorter') | |
}), | |
styles: () => [ | |
import('./styles.scss') | |
], | |
prefetch: [ | |
events | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment