mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Added event type icon to history grid.
This commit is contained in:
parent
9d8fd840c4
commit
76fb548ccd
9 changed files with 87 additions and 8 deletions
|
@ -22,18 +22,18 @@ define(['app'], function () {
|
|||
|
||||
var name = this.column.get('name');
|
||||
|
||||
if(name === 'this'){
|
||||
if (name === 'this') {
|
||||
return this.model;
|
||||
}
|
||||
|
||||
var value = this.model.get(name);
|
||||
|
||||
if(!value){
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//if not a model
|
||||
if (!value.get) {
|
||||
if (!value.get && typeof value === 'object') {
|
||||
value = new Backbone.Model(value);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,3 +17,7 @@
|
|||
.quality-cell{
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.history-event-type-cell{
|
||||
width : 10px;
|
||||
}
|
||||
|
|
37
UI/History/EventTypeCell.js
Normal file
37
UI/History/EventTypeCell.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
"use strict";
|
||||
|
||||
define(['app', 'Cells/NzbDroneCell' ], function () {
|
||||
NzbDrone.History.EventTypeCell = NzbDrone.Cells.NzbDroneCell.extend({
|
||||
|
||||
className: 'history-event-type-cell',
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
if (this.cellValue) {
|
||||
|
||||
var icon = 'icon-question';
|
||||
var toolTip = 'unknow event';
|
||||
|
||||
switch (this.cellValue) {
|
||||
case 'grabbed':
|
||||
icon = 'icon-cloud-download';
|
||||
toolTip = 'Episode grabbed from indexer and sent to download client';
|
||||
break;
|
||||
case 'seriesFolderImported':
|
||||
icon = 'icon-hdd';
|
||||
toolTip = 'Existing episode file added to library';
|
||||
break;
|
||||
case 'DownloadFolderImported':
|
||||
icon = 'icon-download-alt';
|
||||
toolTip = 'Episode downloaded succesfully and picked up from download client';
|
||||
break;
|
||||
}
|
||||
|
||||
this.$el.html('<i class="{0}" title="{1}"/>'.format(icon, toolTip));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
|
@ -2,8 +2,8 @@
|
|||
define([
|
||||
'app',
|
||||
'History/Collection',
|
||||
'History/EventTypeCell',
|
||||
'Cells/RelativeDateCell',
|
||||
'Cells/IndexerCell',
|
||||
'Cells/TemplatedCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/EpisodeNumberCell',
|
||||
|
@ -24,9 +24,9 @@ define([
|
|||
|
||||
columns: [
|
||||
{
|
||||
name : 'indexer',
|
||||
label: '',
|
||||
cell : NzbDrone.Cells.IndexerCell
|
||||
name: 'eventType',
|
||||
label:'',
|
||||
cell : NzbDrone.History.EventTypeCell
|
||||
},
|
||||
{
|
||||
name : 'series',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue