parent
ef62af75df
commit
b0bd3f34f1
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JavaScriptLibraryMappings">
|
<component name="JavaScriptLibraryMappings">
|
||||||
<file url="PROJECT" libraries="{libraries}" />
|
<file url="PROJECT" libraries="{jQuery-1.9.1}" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="libraries" type="javaScript">
|
|
||||||
<properties>
|
|
||||||
<sourceFilesUrls>
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/require.js" />
|
|
||||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
|
|
||||||
</sourceFilesUrls>
|
|
||||||
</properties>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrapSwitch.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/toastr-1.1.5.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
|
|
||||||
<root url="file://$PROJECT_DIR$/JsLibraries/require.js" />
|
|
||||||
</CLASSES>
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</component>
|
|
@ -1,12 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
define([
|
define(
|
||||||
'app',
|
[
|
||||||
'Calendar/UpcomingCollection'
|
'marionette'
|
||||||
|
], function (Marionette) {
|
||||||
], function () {
|
return Marionette.ItemView.extend({
|
||||||
NzbDrone.Calendar.UpcomingItemView = Backbone.Marionette.ItemView.extend({
|
template: 'Calendar/UpcomingItemTemplate',
|
||||||
template : 'Calendar/UpcomingItemTemplate',
|
tagName : 'div'
|
||||||
tagName : 'div'
|
});
|
||||||
});
|
});
|
||||||
});
|
|
@ -1,121 +1,121 @@
|
|||||||
.calendar {
|
.calendar {
|
||||||
th, td {
|
th, td {
|
||||||
border-color: #eeeeee;
|
border-color : #eeeeee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.primary {
|
.primary {
|
||||||
border-color: #007ccd;
|
border-color : #007ccd;
|
||||||
background-color: #007ccd;
|
background-color : #007ccd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fc-event-skin {
|
.fc-event-skin {
|
||||||
background-color: #007ccd;
|
background-color : #007ccd;
|
||||||
border: 1px solid #007ccd;
|
border : 1px solid #007ccd;
|
||||||
border-radius: 4px;
|
border-radius : 4px;
|
||||||
text-align: center;
|
text-align : center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
border-color: #14b8d4;
|
border-color : #14b8d4;
|
||||||
background-color: #14b8d4;
|
background-color : #14b8d4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inverse {
|
.inverse {
|
||||||
border-color: #333333;
|
border-color : #333333;
|
||||||
background-color: #333333;
|
background-color : #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.warning {
|
.warning {
|
||||||
border-color: #ffa93c;
|
border-color : #ffa93c;
|
||||||
background-color: #ffa93c;
|
background-color : #ffa93c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danger {
|
.danger {
|
||||||
border-color: #ea494a;
|
border-color : #ea494a;
|
||||||
background-color: #ea494a;
|
background-color : #ea494a;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
background-color: #eeeeee;
|
background-color : #eeeeee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.purple {
|
.purple {
|
||||||
border-color: #7932ea;
|
border-color : #7932ea;
|
||||||
background-color: #7932ea;
|
background-color : #7932ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
.success {
|
.success {
|
||||||
border-color: #4cb158;
|
border-color : #4cb158;
|
||||||
background-color: #4cb158;
|
background-color : #4cb158;
|
||||||
}
|
}
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 17.5px;
|
font-size : 17.5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.event {
|
.event {
|
||||||
display: inline-block;
|
display : inline-block;
|
||||||
width: 100%;
|
width : 100%;
|
||||||
margin-bottom: 10px;
|
margin-bottom : 10px;
|
||||||
border-top: 1px solid #eeeeee;
|
border-top : 1px solid #eeeeee;
|
||||||
padding-top: 10px;
|
padding-top : 10px;
|
||||||
|
|
||||||
.primary {
|
.primary {
|
||||||
border-color: #007ccd;
|
border-color : #007ccd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
border-color: #14b8d4;
|
border-color : #14b8d4;
|
||||||
}
|
}
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
text-transform: none !important;
|
text-transform : none !important;
|
||||||
font-weight: 500;
|
font-weight : 500;
|
||||||
color: #008dcd;
|
color : #008dcd;
|
||||||
margin: 5px 0px;
|
margin : 5px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inverse {
|
.inverse {
|
||||||
border-color: #333333;
|
border-color : #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.warning {
|
.warning {
|
||||||
border-color: #ffa93c;
|
border-color : #ffa93c;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
color: #999999;
|
color : #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danger {
|
.danger {
|
||||||
border-color: #ea494a;
|
border-color : #ea494a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
text-align: center;
|
text-align : center;
|
||||||
display: inline-block;
|
display : inline-block;
|
||||||
border-left: 4px solid #eeeeee;
|
border-left : 4px solid #eeeeee;
|
||||||
padding-left: 16px;
|
padding-left : 16px;
|
||||||
float: left;
|
float : left;
|
||||||
margin-right: 20px;
|
margin-right : 20px;
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
line-height: 1em;
|
line-height : 1em;
|
||||||
color: #555555;
|
color : #555555;
|
||||||
font-weight: 300;
|
font-weight : 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-weight: 500;
|
font-weight : 500;
|
||||||
line-height: 0.8em;
|
line-height : 0.8em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.purple {
|
.purple {
|
||||||
border-color: #7932ea;
|
border-color : #7932ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
.success {
|
.success {
|
||||||
border-color: #4cb158;
|
border-color : #4cb158;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
define(['app','cells/nzbdronecell'], function () {
|
|
||||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
|
||||||
className: 'series-status-cell',
|
|
||||||
|
|
||||||
render: function () {
|
|
||||||
this.$el.empty();
|
|
||||||
var monitored = this.model.get('monitored');
|
|
||||||
var status = this.model.get('status');
|
|
||||||
|
|
||||||
if (!monitored) {
|
|
||||||
this.$el.html('<i class="icon-pause grid-icon" title="Not Monitored"></i>');
|
|
||||||
}
|
|
||||||
else if (status === 'continuing') {
|
|
||||||
this.$el.html('<i class="icon-play grid-icon" title="Continuing"></i>');
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
this.$el.html('<i class="icon-stop grid-icon" title="Ended"></i>');
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,17 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
define(['app'], function () {
|
define({
|
||||||
|
Execute: function (name, properties) {
|
||||||
|
var data = { command: name };
|
||||||
|
|
||||||
NzbDrone.Commands.Execute = function (name, properties) {
|
if (properties) {
|
||||||
var data = { command: name };
|
$.extend(data, properties);
|
||||||
|
}
|
||||||
|
|
||||||
if (properties) {
|
return $.ajax({
|
||||||
$.extend(data, properties);
|
type: 'POST',
|
||||||
|
url : window.ApiRoot + '/command',
|
||||||
|
data: JSON.stringify(data)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
return $.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url : NzbDrone.Constants.ApiRoot + '/command',
|
|
||||||
data: JSON.stringify(data)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
@ -1,78 +1,85 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Layout', 'Release/Collection'], function () {
|
define(
|
||||||
|
[
|
||||||
|
'marionette',
|
||||||
|
'Episode/Summary/View',
|
||||||
|
'Episode/Search/Layout',
|
||||||
|
'Release/Collection',
|
||||||
|
'Shared/SpinnerView'
|
||||||
|
], function (Marionette, SummaryView, SearchLayout, ReleaseCollection, SpinnerView) {
|
||||||
|
|
||||||
NzbDrone.Episode.Layout = Backbone.Marionette.Layout.extend({
|
return Marionette.Layout.extend({
|
||||||
template: 'Episode/LayoutTemplate',
|
template: 'Episode/LayoutTemplate',
|
||||||
|
|
||||||
|
|
||||||
regions: {
|
regions: {
|
||||||
summary : '#episode-summary',
|
summary : '#episode-summary',
|
||||||
activity: '#episode-activity',
|
activity: '#episode-activity',
|
||||||
search : '#episode-search'
|
search : '#episode-search'
|
||||||
},
|
},
|
||||||
|
|
||||||
ui: {
|
ui: {
|
||||||
summary : '.x-episode-summary',
|
summary : '.x-episode-summary',
|
||||||
activity: '.x-episode-activity',
|
activity: '.x-episode-activity',
|
||||||
search : '.x-episode-search'
|
search : '.x-episode-search'
|
||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
|
|
||||||
'click .x-episode-summary' : 'showSummary',
|
'click .x-episode-summary' : 'showSummary',
|
||||||
'click .x-episode-activity': 'showActivity',
|
'click .x-episode-activity': 'showActivity',
|
||||||
'click .x-episode-search' : 'showSearch'
|
'click .x-episode-search' : 'showSearch'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
this.showSummary();
|
this.showSummary();
|
||||||
this._releaseSearchActivated = false;
|
this._releaseSearchActivated = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
showSummary: function (e) {
|
showSummary: function (e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ui.summary.tab('show');
|
this.ui.summary.tab('show');
|
||||||
this.summary.show(new NzbDrone.Episode.Summary.View({model: this.model}));
|
this.summary.show(new SummaryView({model: this.model}));
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
showActivity: function (e) {
|
showActivity: function (e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ui.activity.tab('show');
|
this.ui.activity.tab('show');
|
||||||
},
|
},
|
||||||
|
|
||||||
showSearch: function (e) {
|
showSearch: function (e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._releaseSearchActivated) {
|
if (this._releaseSearchActivated) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.ui.search.tab('show');
|
this.ui.search.tab('show');
|
||||||
this.search.show(new NzbDrone.Shared.SpinnerView());
|
this.search.show(new SpinnerView());
|
||||||
|
|
||||||
var releases = new NzbDrone.Release.Collection();
|
var releases = new ReleaseCollection();
|
||||||
var promise = releases.fetchEpisodeReleases(this.model.id);
|
var promise = releases.fetchEpisodeReleases(this.model.id);
|
||||||
|
|
||||||
promise.done(function () {
|
promise.done(function () {
|
||||||
if (!self.isClosed) {
|
if (!self.isClosed) {
|
||||||
self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases}));
|
self.search.show(new SearchLayout({collection: releases}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,68 +1,70 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
define([
|
define(
|
||||||
'app',
|
[
|
||||||
'Cells/FileSizeCell',
|
'marionette',
|
||||||
'Cells/QualityCell',
|
'backgrid',
|
||||||
'Release/ApprovalStatusCell',
|
'Cells/FileSizeCell',
|
||||||
'Release/DownloadReportCell'
|
'Cells/QualityCell',
|
||||||
], function () {
|
'Release/ApprovalStatusCell',
|
||||||
|
'Release/DownloadReportCell'
|
||||||
|
], function (Marionette, Backgrid, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell) {
|
||||||
|
|
||||||
NzbDrone.Episode.Search.Layout = Backbone.Marionette.Layout.extend({
|
return Marionette.Layout.extend({
|
||||||
template: 'Episode/Search/LayoutTemplate',
|
template: 'Episode/Search/LayoutTemplate',
|
||||||
|
|
||||||
regions: {
|
regions: {
|
||||||
grid: '#episode-release-grid'
|
grid: '#episode-release-grid'
|
||||||
},
|
|
||||||
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
name : 'age',
|
|
||||||
label : 'Age',
|
|
||||||
sortable: true,
|
|
||||||
cell : Backgrid.IntegerCell
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'title',
|
|
||||||
label : 'Title',
|
|
||||||
sortable: true,
|
|
||||||
cell : Backgrid.StringCell
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'size',
|
|
||||||
label : 'Size',
|
|
||||||
sortable: true,
|
|
||||||
cell : NzbDrone.Cells.FileSizeCell
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'quality',
|
|
||||||
label : 'Quality',
|
|
||||||
sortable: true,
|
|
||||||
cell : NzbDrone.Cells.QualityCell
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
columns:
|
||||||
name : 'rejections',
|
[
|
||||||
label: 'decision',
|
{
|
||||||
cell : NzbDrone.Release.ApprovalStatusCell
|
name : 'age',
|
||||||
},
|
label : 'Age',
|
||||||
{
|
sortable: true,
|
||||||
name : 'download',
|
cell : Backgrid.IntegerCell
|
||||||
label: '',
|
},
|
||||||
cell : NzbDrone.Release.DownloadReportCell
|
{
|
||||||
}
|
name : 'title',
|
||||||
],
|
label : 'Title',
|
||||||
|
sortable: true,
|
||||||
|
cell : Backgrid.StringCell
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'size',
|
||||||
|
label : 'Size',
|
||||||
|
sortable: true,
|
||||||
|
cell : FileSizeCell
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'quality',
|
||||||
|
label : 'Quality',
|
||||||
|
sortable: true,
|
||||||
|
cell : QualityCell
|
||||||
|
},
|
||||||
|
|
||||||
onShow: function () {
|
|
||||||
if (!this.isClosed) {
|
|
||||||
this.grid.show(new Backgrid.Grid(
|
|
||||||
{
|
{
|
||||||
|
name : 'rejections',
|
||||||
|
label: 'decision',
|
||||||
|
cell : ApprovalStatusCell
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'download',
|
||||||
|
label: '',
|
||||||
|
cell : DownloadReportCell
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
onShow: function () {
|
||||||
|
if (!this.isClosed) {
|
||||||
|
this.grid.show(new Backgrid.Grid({
|
||||||
row : Backgrid.Row,
|
row : Backgrid.Row,
|
||||||
columns : this.columns,
|
columns : this.columns,
|
||||||
collection: this.collection,
|
collection: this.collection,
|
||||||
className : 'table table-hover'
|
className : 'table table-hover'
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
define(['app'], function () {
|
define(
|
||||||
|
[
|
||||||
|
'marionette'
|
||||||
|
], function (Marionette) {
|
||||||
|
|
||||||
NzbDrone.Episode.Summary.View = Backbone.Marionette.ItemView.extend({
|
return Marionette.ItemView.extend({
|
||||||
template: 'Episode/Summary/ViewTemplate'
|
template: 'Episode/Summary/ViewTemplate'
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,31 +1,50 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
define(['app', 'handlebars'], function (App,Handlebars) {
|
define(
|
||||||
Handlebars.registerHelper('formBuilder', function () {
|
[
|
||||||
var ret = '';
|
'handlebars'
|
||||||
_.each(this.fields, function (field) {
|
], function (Handlebars) {
|
||||||
ret += NzbDrone.Form.FieldBuilder(field);
|
|
||||||
});
|
|
||||||
|
|
||||||
return new Handlebars.SafeString(ret);
|
var formBuilder = function (field) {
|
||||||
});
|
if (!field.type) {
|
||||||
|
return Handlebars.helpers.partial.apply(field,
|
||||||
|
[
|
||||||
|
'Form/TextboxTemplate'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (field.type === 'password') {
|
||||||
|
return Handlebars.helpers.partial.apply(field,
|
||||||
|
[
|
||||||
|
'Form/PasswordTemplate'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
NzbDrone.Form.FieldBuilder = function (field) {
|
if (field.type === 'checkbox') {
|
||||||
if (!field.type) {
|
return Handlebars.helpers.partial.apply(field,
|
||||||
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
|
[
|
||||||
}
|
'Form/CheckboxTemplate'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
if (field.type === 'password') {
|
if (field.type === 'select') {
|
||||||
return Handlebars.helpers.partial.apply(field, ['Form/PasswordTemplate']);
|
return Handlebars.helpers.partial.apply(field,
|
||||||
}
|
[
|
||||||
|
'Form/SelectTemplate'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
if (field.type === 'checkbox') {
|
return Handlebars.helpers.partial.apply(field,
|
||||||
return Handlebars.helpers.partial.apply(field, ['Form/CheckboxTemplate']);
|
[
|
||||||
}
|
'Form/TextboxTemplate'
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
if (field.type === 'select') {
|
Handlebars.registerHelper('formBuilder', function () {
|
||||||
return Handlebars.helpers.partial.apply(field, ['Form/SelectTemplate']);
|
var ret = '';
|
||||||
}
|
_.each(this.fields, function (field) {
|
||||||
|
ret += this.FieldBuilder(field);
|
||||||
|
});
|
||||||
|
|
||||||
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
|
return new Handlebars.SafeString(ret);
|
||||||
};
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,49 +1,55 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
define(['app', 'signalR'], function () {
|
define(
|
||||||
|
[
|
||||||
|
'signalR'
|
||||||
|
], function () {
|
||||||
|
|
||||||
|
_.extend(Backbone.Collection.prototype, {BindSignalR: function (options) {
|
||||||
|
|
||||||
|
if (!options || !options.url) {
|
||||||
|
console.assert(this.url, 'url must be provided or collection must have url');
|
||||||
|
options = {
|
||||||
|
url: this.url.replace('api', 'signalr')
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
_.extend(Backbone.Collection.prototype, {BindSignalR: function (options) {
|
var self = this;
|
||||||
|
|
||||||
|
var _getStatus = function (status) {
|
||||||
|
switch (status) {
|
||||||
|
case 0:
|
||||||
|
return 'connecting';
|
||||||
|
case 1:
|
||||||
|
return 'connected';
|
||||||
|
case 2:
|
||||||
|
return 'reconnecting';
|
||||||
|
case 4:
|
||||||
|
return 'disconnected';
|
||||||
|
default:
|
||||||
|
throw 'invalid status ' + status;
|
||||||
|
}
|
||||||
|
|
||||||
if (!options || !options.url) {
|
|
||||||
console.assert(this.url, 'url must be provided or collection must have url');
|
|
||||||
options = {
|
|
||||||
url: this.url.replace('api', 'signalr')
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
var _getStatus = function (status) {
|
|
||||||
switch (status) {
|
|
||||||
case 0:
|
|
||||||
return 'connecting';
|
|
||||||
case 1:
|
|
||||||
return 'connected';
|
|
||||||
case 2:
|
|
||||||
return 'reconnecting';
|
|
||||||
case 4:
|
|
||||||
return 'disconnected';
|
|
||||||
default:
|
|
||||||
throw 'invalid status ' + status;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var connection = $.connection(options.url);
|
var connection = $.connection(options.url);
|
||||||
|
|
||||||
connection.stateChanged(function (change) {
|
connection.stateChanged(function (change) {
|
||||||
console.debug('{0} [{1}]'.format(options.url, _getStatus(change.newState)));
|
console.debug('{0} [{1}]'.format(options.url, _getStatus(change.newState)));
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.received(function (model) {
|
connection.received(function (model) {
|
||||||
console.debug(model);
|
console.debug(model);
|
||||||
self.fetch();
|
self.fetch();
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.start({ transport: ['longPolling'] });
|
connection.start({ transport:
|
||||||
|
[
|
||||||
|
'longPolling'
|
||||||
|
] });
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}});
|
}});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
'use strict';
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
'backgrid'
|
||||||
|
], function (Backgrid) {
|
||||||
|
return Backgrid.Cell.extend({
|
||||||
|
className: 'series-status-cell',
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
this.$el.empty();
|
||||||
|
var monitored = this.model.get('monitored');
|
||||||
|
var status = this.model.get('status');
|
||||||
|
|
||||||
|
if (!monitored) {
|
||||||
|
this.$el.html('<i class="icon-pause grid-icon" title="Not Monitored"></i>');
|
||||||
|
}
|
||||||
|
else if (status === 'continuing') {
|
||||||
|
this.$el.html('<i class="icon-play grid-icon" title="Continuing"></i>');
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
this.$el.html('<i class="icon-stop grid-icon" title="Ended"></i>');
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
'app',
|
||||||
|
'marionette'
|
||||||
|
], function (App, Marionette) {
|
||||||
|
|
||||||
|
return Marionette.ItemView.extend({
|
||||||
|
template: 'Quality/Profile/DeleteTemplate',
|
||||||
|
|
||||||
|
events: {
|
||||||
|
'click .x-confirm-delete': '_removeProfile'
|
||||||
|
},
|
||||||
|
|
||||||
|
_removeProfile: function () {
|
||||||
|
|
||||||
|
this.model.destroy({
|
||||||
|
wait: true
|
||||||
|
}).done(function () {
|
||||||
|
App.modalRegion.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
@ -1,37 +1,38 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
define(['app'], function () {
|
define(
|
||||||
NzbDrone.Shared.FormatHelpers.FileSizeHelper = function (sourceSize) {
|
[
|
||||||
var size = Number(sourceSize);
|
'sugar'
|
||||||
return size.bytes(1);
|
], {
|
||||||
};
|
FileSizeHelper: function (sourceSize) {
|
||||||
|
var size = Number(sourceSize);
|
||||||
|
return size.bytes(1);
|
||||||
|
},
|
||||||
|
|
||||||
NzbDrone.Shared.FormatHelpers.DateHelper = function (sourceDate) {
|
DateHelper: function (sourceDate) {
|
||||||
if (!sourceDate) {
|
if (!sourceDate) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var date = Date.create(sourceDate);
|
|
||||||
|
|
||||||
if (date.isYesterday()) {
|
var date = Date.create(sourceDate);
|
||||||
return 'Yesterday';
|
|
||||||
}
|
|
||||||
if (date.isToday()) {
|
|
||||||
return 'Today';
|
|
||||||
}
|
|
||||||
if (date.isTomorrow()) {
|
|
||||||
return 'Tomorrow';
|
|
||||||
}
|
|
||||||
if (date.isAfter(Date.create('tomorrow')) && date.isBefore(Date.create().addDays(7))) {
|
|
||||||
return date.format('{Weekday}');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (date.isAfter(Date.create().addDays(6))) {
|
if (date.isYesterday()) {
|
||||||
return date.relative().replace(' from now', '');
|
return 'Yesterday';
|
||||||
}
|
}
|
||||||
|
if (date.isToday()) {
|
||||||
|
return 'Today';
|
||||||
|
}
|
||||||
|
if (date.isTomorrow()) {
|
||||||
|
return 'Tomorrow';
|
||||||
|
}
|
||||||
|
if (date.isAfter(Date.create('tomorrow')) && date.isBefore(Date.create().addDays(7))) {
|
||||||
|
return date.format('{Weekday}');
|
||||||
|
}
|
||||||
|
|
||||||
return date.format('{MM}/{dd}/{yyyy}');
|
if (date.isAfter(Date.create().addDays(6))) {
|
||||||
};
|
return date.relative().replace(' from now', '');
|
||||||
|
}
|
||||||
|
|
||||||
return NzbDrone.Shared.FormatHelpers;
|
return date.format('{MM}/{dd}/{yyyy}');
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue