-
-
Save gist-master/8b5f7c883ecf91648f769a1ac817a410 to your computer and use it in GitHub Desktop.
Scheduler: templates
This file contains hidden or 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
<template> | |
<require from="aurelia-kendoui-bridge/scheduler/scheduler"></require> | |
<require from="aurelia-kendoui-bridge/common/template"></require> | |
<require from="./templates.css!css"></require> | |
<div id="example" class="k-content"> | |
<ak-scheduler k-date.bind="date" | |
k-start-time.bind="startTime" | |
k-end-time.bind="endTime" | |
k-height.bind="600" | |
k-views.bind="['day', 'agenda']" | |
k-editable.bind="false" | |
k-data-source.bind="dataSource"> | |
<ak-template for="eventTemplate"> | |
<div class="movie-template"> | |
<img src="${image}"> | |
<p>${start | movieTime} - ${end | movieTime}</p> | |
<h3>${title}</h3> | |
<a href="${imdb}">Movie in IMDB</a> | |
</div> | |
</ak-template> | |
</ak-scheduler> | |
</div> | |
</template> |
This file contains hidden or 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
export class Templates { | |
date = new Date('2013/6/13'); | |
startTime = new Date('2013/6/13 10:00'); | |
endTime = new Date('2013/6/13 23:00'); | |
dataSource = [{ | |
title: 'Fast and furious 6', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/fast-and-furious.jpg', | |
imdb: 'https://www.imdb.com/title/tt1905041/', | |
start: new Date('2013/6/13 17:00'), | |
end: new Date('2013/6/13 18:30') | |
}, | |
{ | |
title: 'The Internship', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/the-internship.jpg', | |
imdb: 'https://www.imdb.com/title/tt2234155/', | |
start: new Date('2013/6/13 14:00'), | |
end: new Date('2013/6/13 15:30') | |
}, | |
{ | |
title: 'The Perks of Being a Wallflower', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/wallflower.jpg', | |
imdb: 'https://www.imdb.com/title/tt1659337/', | |
start: new Date('2013/6/13 16:00'), | |
end: new Date('2013/6/13 17:30') | |
}, | |
{ | |
title: 'The Help', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/the-help.jpg', | |
imdb: 'https://www.imdb.com/title/tt1454029/', | |
start: new Date('2013/6/13 12:00'), | |
end: new Date('2013/6/13 13:30') | |
}, | |
{ | |
title: 'Now You See Me', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/now-you-see-me.jpg', | |
imdb: 'https://www.imdb.com/title/tt1670345/', | |
start: new Date('2013/6/13 10:00'), | |
end: new Date('2013/6/13 11:30') | |
}, | |
{ | |
title: 'Fast and furious 6', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/fast-and-furious.jpg', | |
imdb: 'https://www.imdb.com/title/tt1905041/', | |
start: new Date('2013/6/13 19:00'), | |
end: new Date('2013/6/13 20:30') | |
}, | |
{ | |
title: 'The Internship', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/the-internship.jpg', | |
imdb: 'https://www.imdb.com/title/tt2234155/', | |
start: new Date('2013/6/13 17:30'), | |
end: new Date('2013/6/13 19:00') | |
}, | |
{ | |
title: 'The Perks of Being a Wallflower', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/wallflower.jpg', | |
imdb: 'https://www.imdb.com/title/tt1659337/', | |
start: new Date('2013/6/13 17:30'), | |
end: new Date('2013/6/13 19:00') | |
}, | |
{ | |
title: 'The Help', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/the-help.jpg', | |
imdb: 'https://www.imdb.com/title/tt1454029/', | |
start: new Date('2013/6/13 13:30'), | |
end: new Date('2013/6/13 15:00') | |
}, | |
{ | |
title: 'Now You See Me', | |
image: 'https://demos.telerik.com/kendo-ui/content/web/scheduler/now-you-see-me.jpg', | |
imdb: 'https://www.imdb.com/title/tt1670345/', | |
start: new Date('2013/6/13 12:30'), | |
end: new Date('2013/6/13 14:00') | |
}]; | |
} | |
export class MovieTimeValueConverter { | |
toView(date) { | |
if (date) { | |
return `${date.getHours()}:${date.getMinutes()}`; | |
} | |
} | |
} |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<title>Aurelia KendoUI bridge</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.common.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.rtl.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.mobile.all.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.0/bluebird.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.2.1/chroma.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jszip.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script> | |
</head> | |
<body aurelia-app="main"> | |
<h1>Loading...</h1> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script> | |
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/1.0.0-beta.1.0.6/config2.js"></script> | |
<script> | |
System.import('aurelia-bootstrapper'); | |
</script> | |
</body> | |
</html> |
This file contains hidden or 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
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging() | |
.plugin('aurelia-kendoui-bridge); | |
aurelia.start().then(a => a.setRoot()); | |
} |
This file contains hidden or 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
.movie-template img { | |
float: left; | |
margin: 0 8px; | |
} | |
.movie-template p { | |
margin: 5px 0 0; | |
} | |
.movie-template h3 { | |
padding: 0 8px 5px; | |
font-size: 12px; | |
} | |
.movie-template a { | |
color: #ffffff; | |
font-weight: bold; | |
text-decoration: none; | |
} | |
.k-state-hover .movie-template a, | |
.movie-template a:hover { | |
color: #000000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment