Calendar and series details show download progress
This commit is contained in:
parent
c84bd6f21f
commit
d80d89e687
|
@ -43,6 +43,12 @@ define(
|
||||||
eventRender : function (event, element) {
|
eventRender : function (event, element) {
|
||||||
self.$(element).addClass(event.statusLevel);
|
self.$(element).addClass(event.statusLevel);
|
||||||
self.$(element).children('.fc-event-inner').addClass(event.statusLevel);
|
self.$(element).children('.fc-event-inner').addClass(event.statusLevel);
|
||||||
|
|
||||||
|
if (event.progress > 0) {
|
||||||
|
self.$(element).find('.fc-event-time')
|
||||||
|
.after('<span class="downloading-progress pull-right">{0}%</span>'
|
||||||
|
.format(event.progress.toFixed(0)));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
eventClick : function (event) {
|
eventClick : function (event) {
|
||||||
vent.trigger(vent.Commands.ShowEpisodeDetails, {episode: event.model});
|
vent.trigger(vent.Commands.ShowEpisodeDetails, {episode: event.model});
|
||||||
|
@ -85,6 +91,7 @@ define(
|
||||||
end : end,
|
end : end,
|
||||||
allDay : false,
|
allDay : false,
|
||||||
statusLevel : _instance._getStatusLevel(model, end),
|
statusLevel : _instance._getStatusLevel(model, end),
|
||||||
|
progress : _instance._getDownloadProgress(model),
|
||||||
model : model
|
model : model
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -129,6 +136,16 @@ define(
|
||||||
_reloadCalendarEvents: function () {
|
_reloadCalendarEvents: function () {
|
||||||
this.$el.fullCalendar('removeEvents');
|
this.$el.fullCalendar('removeEvents');
|
||||||
this._setEventData(this.collection);
|
this._setEventData(this.collection);
|
||||||
|
},
|
||||||
|
|
||||||
|
_getDownloadProgress: function (element) {
|
||||||
|
var downloading = QueueCollection.findEpisode(element.get('id'));
|
||||||
|
|
||||||
|
if (!downloading) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 100 - (downloading.get('sizeleft') / downloading.get('size') * 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
@import "../Content/Bootstrap/variables";
|
@import "../Content/Bootstrap/variables";
|
||||||
@import "../Content/Bootstrap/buttons";
|
@import "../Content/Bootstrap/buttons";
|
||||||
@import "../Shared/Styles/clickable";
|
@import "../Shared/Styles/clickable";
|
||||||
|
@import "../Content/variables";
|
||||||
|
|
||||||
.calendar {
|
.calendar {
|
||||||
th, td {
|
th, td {
|
||||||
|
@ -100,7 +101,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.purple {
|
.purple {
|
||||||
border-color : #7932ea;
|
border-color : @nzbdronePurple;
|
||||||
}
|
}
|
||||||
|
|
||||||
.episode-title {
|
.episode-title {
|
||||||
|
@ -148,7 +149,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.purple {
|
.purple {
|
||||||
border-color : #7932ea;
|
border-color : @nzbdronePurple;
|
||||||
background-color : #7932ea;
|
background-color : @nzbdronePurple;
|
||||||
|
}
|
||||||
|
|
||||||
|
.downloading-progress {
|
||||||
|
margin-right: 3px;
|
||||||
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,15 @@ define(
|
||||||
var model = this.model;
|
var model = this.model;
|
||||||
var downloading = QueueCollection.findEpisode(model.get('id'));
|
var downloading = QueueCollection.findEpisode(model.get('id'));
|
||||||
|
|
||||||
if (downloading || this.model.get('downloading')) {
|
if (downloading) {
|
||||||
|
var progress = 100 - (downloading.get('sizeleft') / downloading.get('size') * 100);
|
||||||
|
|
||||||
|
this.$el.html('<div class="progress progress-purple" title="Episode is downloading - {0}%" data-container="body">'.format(progress.toFixed(1)) +
|
||||||
|
'<div class="bar" style="width: {0}%;"></div></div>'.format(progress));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (this.model.get('downloading')) {
|
||||||
icon = 'icon-nd-downloading';
|
icon = 'icon-nd-downloading';
|
||||||
tooltip = 'Episode is downloading';
|
tooltip = 'Episode is downloading';
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,12 @@ td.episode-status-cell, td.quality-cell {
|
||||||
.badge {
|
.badge {
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
height : 10px;
|
||||||
|
margin-top : 5px;
|
||||||
|
margin-bottom : 0px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-details-cell {
|
.history-details-cell {
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
@import "Bootstrap/mixins";
|
||||||
|
@import "Bootstrap/variables";
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
|
.progress.episode-progress {
|
||||||
|
width : 125px;
|
||||||
|
position : relative;
|
||||||
|
margin-bottom : 2px;
|
||||||
|
|
||||||
|
.progressbar-back-text, .progressbar-front-text {
|
||||||
|
font-size : 11.844px;
|
||||||
|
font-weight : bold;
|
||||||
|
text-align : center;
|
||||||
|
cursor : default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressbar-back-text {
|
||||||
|
position : absolute;
|
||||||
|
width : 100%;
|
||||||
|
height : 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressbar-front-text {
|
||||||
|
display : block;
|
||||||
|
width : 125px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
position : absolute;
|
||||||
|
overflow : hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-purple .bar, .progress .bar-purple {
|
||||||
|
#gradient > .vertical(@purple, @nzbdronePurple);
|
||||||
|
}
|
|
@ -10,39 +10,11 @@
|
||||||
@import "checkbox-button";
|
@import "checkbox-button";
|
||||||
@import "spinner";
|
@import "spinner";
|
||||||
@import "legend";
|
@import "legend";
|
||||||
|
@import "progress-bars";
|
||||||
@import "../Shared/Styles/clickable";
|
@import "../Shared/Styles/clickable";
|
||||||
@import "../Shared/Styles/card";
|
@import "../Shared/Styles/card";
|
||||||
@import "../Rename/rename";
|
@import "../Rename/rename";
|
||||||
|
|
||||||
.progress.episode-progress {
|
|
||||||
width : 125px;
|
|
||||||
position : relative;
|
|
||||||
margin-bottom : 2px;
|
|
||||||
|
|
||||||
.progressbar-back-text, .progressbar-front-text {
|
|
||||||
font-size : 11.844px;
|
|
||||||
font-weight : bold;
|
|
||||||
text-align : center;
|
|
||||||
cursor : default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progressbar-back-text {
|
|
||||||
position : absolute;
|
|
||||||
width : 100%;
|
|
||||||
height : 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progressbar-front-text {
|
|
||||||
display : block;
|
|
||||||
width : 125px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bar {
|
|
||||||
position : absolute;
|
|
||||||
overflow : hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-toolbar {
|
.page-toolbar {
|
||||||
margin-top : 10px;
|
margin-top : 10px;
|
||||||
margin-bottom : 30px;
|
margin-bottom : 30px;
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
@nzbdroneRed: #C4273C;
|
@nzbdroneRed: #c4273c;
|
||||||
|
@nzbdronePurple: #7932ea;
|
Loading…
Reference in New Issue