Activity instead of History

New: Renamed history to activity
New: Queue is default tab of activity
This commit is contained in:
Mark McDowall
2014-10-12 00:29:09 -07:00
parent f8fb37bae8
commit 1225bbe8dc
39 changed files with 67 additions and 66 deletions
@@ -0,0 +1,70 @@
'use strict';
define(
[
'Activity/History/HistoryModel',
'backbone.pageable',
'Mixins/AsFilteredCollection',
'Mixins/AsSortedCollection',
'Mixins/AsPersistedStateCollection'
], function (HistoryModel, PageableCollection, AsFilteredCollection, AsSortedCollection, AsPersistedStateCollection) {
var Collection = PageableCollection.extend({
url : window.NzbDrone.ApiRoot + '/history',
model: HistoryModel,
state: {
pageSize: 15,
sortKey : 'date',
order : 1
},
queryParams: {
totalPages : null,
totalRecords: null,
pageSize : 'pageSize',
sortKey : 'sortKey',
order : 'sortDir',
directions : {
'-1': 'asc',
'1' : 'desc'
}
},
filterModes: {
'all' : [null, null],
'grabbed' : ['eventType', '1'],
'imported' : ['eventType', '3'],
'failed' : ['eventType', '4'],
'deleted' : ['eventType', '5']
},
sortMappings: {
'series' : { sortKey: 'series.sortTitle' }
},
initialize: function (options) {
delete this.queryParams.episodeId;
if (options) {
if (options.episodeId) {
this.queryParams.episodeId = options.episodeId;
}
}
},
parseState: function (resp) {
return { totalRecords: resp.totalRecords };
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
Collection = AsFilteredCollection.call(Collection);
Collection = AsSortedCollection.call(Collection);
return AsPersistedStateCollection.call(Collection);
});