Add watched percent to history table tooltip

This commit is contained in:
Jonathan Wong 2015-10-12 00:28:05 -07:00
parent 2680162b67
commit c25c48c1a6
2 changed files with 12 additions and 10 deletions

View file

@ -214,13 +214,13 @@ history_table_options = {
{ {
"targets": [11], "targets": [11],
"data": "watched_status", "data": "watched_status",
"render": function (data, type, full) { "createdCell": function (td, cellData, rowData, row, col) {
if (data == 1) { if (cellData == 1) {
return '<span class="watched-tooltip" data-toggle="tooltip" title="Watched"><i class="fa fa-lg fa-circle"></i></span>' $(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><i class="fa fa-lg fa-circle"></i></span>');
} else if (data == 0.5) { } else if (cellData == 0.5) {
return '<span class="watched-tooltip" data-toggle="tooltip" title="Partial"><i class="fa fa-lg fa-adjust fa-rotate-180"></i></span>' $(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><i class="fa fa-lg fa-adjust fa-rotate-180"></i></span>');
} else { } else {
return '<span class="watched-tooltip" data-toggle="tooltip" title="Unwatched"><i class="fa fa-lg fa-circle-o"></i></span>' $(td).html('<span class="watched-tooltip" data-toggle="tooltip" title="' + rowData['percent_complete'] + '%"><i class="fa fa-lg fa-circle-o"></i></span>');
} }
}, },
"searchable": false, "searchable": false,
@ -236,12 +236,13 @@ history_table_options = {
// Create the tooltips. // Create the tooltips.
$('.expand-history-tooltip').tooltip({ container: 'body' }); $('.expand-history-tooltip').tooltip({ container: 'body' });
$('.external-ip-tooltip').tooltip(); $('.external-ip-tooltip').tooltip({ container: 'body' });
$('.transcode-tooltip').tooltip(); $('.transcode-tooltip').tooltip({ container: 'body' });
$('.media-type-tooltip').tooltip(); $('.media-type-tooltip').tooltip({ container: 'body' });
$('.watched-tooltip').tooltip(); $('.watched-tooltip').tooltip({ container: 'body' });
$('.thumb-tooltip').popover({ $('.thumb-tooltip').popover({
html: true, html: true,
container: 'body',
trigger: 'hover', trigger: 'hover',
placement: 'right', placement: 'right',
content: function () { content: function () {

View file

@ -136,6 +136,7 @@ class DataFactory(object):
"thumb": thumb, "thumb": thumb,
"video_decision": item["video_decision"], "video_decision": item["video_decision"],
"audio_decision": item["audio_decision"], "audio_decision": item["audio_decision"],
"percent_complete": int(round(item['percent_complete'])),
"watched_status": watched_status, "watched_status": watched_status,
"group_count": item["group_count"], "group_count": item["group_count"],
"group_ids": item["group_ids"] "group_ids": item["group_ids"]