mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
started cleaning up episode page.
This commit is contained in:
parent
9efee65966
commit
9a42e305ad
18 changed files with 528 additions and 63 deletions
|
@ -1 +0,0 @@
|
|||
{{title}}
|
|
@ -1,16 +0,0 @@
|
|||
'use strict';
|
||||
define(['app', 'Series/SeasonModel'], function () {
|
||||
|
||||
NzbDrone.Series.Details.EpisodeItemView = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Series/Details/EpisodeItemTemplate',
|
||||
tagName : 'tr',
|
||||
|
||||
ui: {
|
||||
|
||||
},
|
||||
|
||||
events: {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,15 +0,0 @@
|
|||
<h3>{{seasonTitle}}</h3>
|
||||
<table class="table table-hover x-season-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Title</th>
|
||||
<th>Air Date</th>
|
||||
<th>Quality</th>
|
||||
<th>Controls</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="x-episodes">
|
||||
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,16 +0,0 @@
|
|||
'use strict';
|
||||
define(['app', 'Series/Details/EpisodeItemView'], function () {
|
||||
NzbDrone.Series.Details.SeasonCompositeView = Backbone.Marionette.CompositeView.extend({
|
||||
itemView : NzbDrone.Series.Details.EpisodeItemView,
|
||||
itemViewContainer: '.x-episodes',
|
||||
template : 'Series/Details/SeasonCompositeTemplate',
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new NzbDrone.Series.EpisodeCollection();
|
||||
this.collection.fetch({data: {
|
||||
seriesId : this.model.get('seriesId'),
|
||||
seasonNumber: this.model.get('seasonNumber')
|
||||
}});
|
||||
}
|
||||
});
|
||||
});
|
52
UI/Series/Details/SeasonLayout.js
Normal file
52
UI/Series/Details/SeasonLayout.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
'use strict';
|
||||
define(['app'], function () {
|
||||
NzbDrone.Series.Details.SeasonLayout = Backbone.Marionette.Layout.extend({
|
||||
template: 'Series/Details/SeasonLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
episodeGrid: '#x-episode-grid'
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
name : 'episodeNumber',
|
||||
label : '#',
|
||||
editable: false,
|
||||
cell : 'integer'
|
||||
},
|
||||
|
||||
{
|
||||
name : 'title',
|
||||
label : 'Title',
|
||||
editable: false,
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'airDate',
|
||||
label : 'Air Date',
|
||||
editable : false,
|
||||
cell : 'datetime',
|
||||
formatter: new Backgrid.AirDateFormatter()
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
this.episodeCollection = new NzbDrone.Series.EpisodeCollection();
|
||||
this.episodeCollection.fetch({data: {
|
||||
seriesId : this.model.get('seriesId'),
|
||||
seasonNumber: this.model.get('seasonNumber')
|
||||
}});
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
|
||||
this.episodeGrid.show(new Backgrid.Grid(
|
||||
{
|
||||
columns : this.columns,
|
||||
collection: this.episodeCollection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
|
||||
}
|
||||
});
|
||||
});
|
4
UI/Series/Details/SeasonLayoutTemplate.html
Normal file
4
UI/Series/Details/SeasonLayoutTemplate.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div class="series-season">
|
||||
<h3>{{seasonTitle}}</h3>
|
||||
<div id="x-episode-grid"/>
|
||||
</div>
|
|
@ -1,6 +1,21 @@
|
|||
<div>
|
||||
<div class="x-series-details">
|
||||
{{overview}}
|
||||
<div class="row series-page-header">
|
||||
<div class="span2">
|
||||
<a href="{{traktUrl}}" target="_blank">
|
||||
<img class="series-poster img-polaroid" src="{{poster}}">
|
||||
</a>
|
||||
</div>
|
||||
<div class="x-series-seasons"></div>
|
||||
</div>
|
||||
<div class="span9">
|
||||
<div class="row">
|
||||
<h2>{{title}}</h2>
|
||||
</div>
|
||||
<div class="row">
|
||||
{{overview}}
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="label label-info">{{network}}</span>
|
||||
<span class="label label-info">{{runtime}} minutes</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="x-series-seasons"></div>
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
"use strict";
|
||||
define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonCompositeView', 'Series/SeasonCollection'], function () {
|
||||
define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonLayout', 'Series/SeasonCollection'], function () {
|
||||
NzbDrone.Series.Details.SeriesDetailsView = Backbone.Marionette.CompositeView.extend({
|
||||
|
||||
itemView : NzbDrone.Series.Details.SeasonCompositeView,
|
||||
itemView : NzbDrone.Series.Details.SeasonLayout,
|
||||
itemViewContainer: '.x-series-seasons',
|
||||
template : 'Series/Details/SeriesDetailsTemplate',
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new NzbDrone.Series.SeasonCollection();
|
||||
this.collection.fetch({data: { seriesId: this.model.get('id') }});
|
||||
|
||||
//$.backstretch(this.model.get('fanArt'));
|
||||
},
|
||||
|
||||
onClose: function(){
|
||||
$('.backstretch').remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ define([
|
|||
'Series/Index/Table/AirDateCell',
|
||||
'Series/Index/Table/SeriesStatusCell'
|
||||
],
|
||||
function (app) {
|
||||
function () {
|
||||
NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({
|
||||
template: 'Series/Index/SeriesIndexLayoutTemplate',
|
||||
|
||||
|
@ -27,7 +27,61 @@ define([
|
|||
showTable: function () {
|
||||
|
||||
var columns =
|
||||
[
|
||||
[
|
||||
{
|
||||
name : 'status',
|
||||
label : '',
|
||||
editable: false,
|
||||
cell : 'seriesStatus'
|
||||
},
|
||||
{
|
||||
name : 'title',
|
||||
label : 'Title',
|
||||
editable: false,
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'seasonCount',
|
||||
label : 'Seasons',
|
||||
editable: false,
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label : 'Quality',
|
||||
editable: false,
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'network',
|
||||
label : 'Network',
|
||||
editable: false,
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'nextAiring',
|
||||
label : 'Next Airing',
|
||||
editable : false,
|
||||
cell : 'datetime',
|
||||
formatter: new Backgrid.AirDateFormatter()
|
||||
},
|
||||
{
|
||||
name : 'episodes',
|
||||
label : 'Episodes',
|
||||
editable: false,
|
||||
sortable: false,
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'edit',
|
||||
label : '',
|
||||
editable: false,
|
||||
sortable: false,
|
||||
cell : 'string'
|
||||
}
|
||||
];
|
||||
|
||||
var grid = new Backgrid.Grid(
|
||||
{
|
||||
name: 'status',
|
||||
label: '',
|
||||
|
|
|
@ -31,17 +31,28 @@
|
|||
|
||||
return undefined;
|
||||
},
|
||||
fanArt : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 3;
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
traktUrl : function () {
|
||||
return "http://trakt.tv/show/" + this.get('titleSlug');
|
||||
},
|
||||
isContinuing : function () {
|
||||
if (this.get('status') === 0){
|
||||
if (this.get('status') === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
statusText: function () {
|
||||
statusText : function () {
|
||||
if (this.get('status') === 0) {
|
||||
return 'Continuing';
|
||||
}
|
||||
|
@ -56,7 +67,7 @@
|
|||
qualityProfiles : qualityProfileCollection,
|
||||
rootFolders : rootFolders,
|
||||
isExisting : false,
|
||||
status: 0
|
||||
status : 0
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
.series-page-header {
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
.series-posters-item {
|
||||
|
@ -45,6 +47,9 @@
|
|||
display: block;
|
||||
}
|
||||
}
|
||||
.series-season {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.series-poster-container {
|
||||
|
@ -66,4 +71,4 @@
|
|||
left: -120px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue