Episode Details episode number is templated

pull/4/head
Mark McDowall 12 years ago
parent e62274bc54
commit 1905b66a66

@ -2,7 +2,6 @@
<FileVersion>1</FileVersion>
<AutoEnableOnStartup>True</AutoEnableOnStartup>
<AllowParallelTestExecution>true</AllowParallelTestExecution>
<AllowTestsToRunInParallelWithThemselves>true</AllowTestsToRunInParallelWithThemselves>
<FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
<FrameworkUtilisationTypeForGallio>Disabled</FrameworkUtilisationTypeForGallio>
<FrameworkUtilisationTypeForMSpec>Disabled</FrameworkUtilisationTypeForMSpec>

@ -3,9 +3,9 @@
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
{{#if episodeTitle}}
<h3>{{episodeTitle}} - {{seasonNumber}}x{{paddedEpisodeNumber}}</h3>
<h3>{{episodeTitle}} - {{episodeNumberHelper}}</h3>
{{else}}
<h3>{{title}} - {{seasonNumber}}x{{paddedEpisodeNumber}}</h3>
<h3>{{title}} - {{episodeNumberHelper}}</h3>
{{/if}}
</div>
<div class="modal-body">

@ -0,0 +1,18 @@
'use strict';
define(
[
'handlebars',
'Shared/FormatHelpers'
], function (Handlebars, FormatHelpers) {
Handlebars.registerHelper('episodeNumberHelper', function () {
if (this.series.seriesType === 'daily') {
return FormatHelpers.DateHelper(this.airDate);
}
else {
return '{0}x{1}'.format(this.seasonNumber, this.paddedEpisodeNumber);
}
});
});

@ -6,6 +6,7 @@ define(
'Handlebars/Helpers/DateTime',
'Handlebars/Helpers/Html',
'Handlebars/Helpers/Numbers',
'Handlebars/Helpers/EpisodeNumber',
'Handlebars/Debug'
], function (Templates) {
return function () {

Loading…
Cancel
Save