mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 09:42:57 -07:00
include dynamic library background and thumbnail
This commit is contained in:
parent
a772fc0bcf
commit
bd2517e190
2 changed files with 17 additions and 4 deletions
|
@ -76,6 +76,8 @@ DOCUMENTATION :: END
|
||||||
<div id="stats-background-${stat_id}" class="dashboard-stats-background" style="background-image: url(${page('pms_image_proxy', row0['art'], row0['rating_key'], 500, 280, 40, '282828', 3, fallback=fallback)});">
|
<div id="stats-background-${stat_id}" class="dashboard-stats-background" style="background-image: url(${page('pms_image_proxy', row0['art'], row0['rating_key'], 500, 280, 40, '282828', 3, fallback=fallback)});">
|
||||||
% elif stat_id == 'top_platforms':
|
% elif stat_id == 'top_platforms':
|
||||||
<div id="stats-background-${stat_id}" class="dashboard-stats-background platform-${row0['platform_name']}-rgba no-image">
|
<div id="stats-background-${stat_id}" class="dashboard-stats-background platform-${row0['platform_name']}-rgba no-image">
|
||||||
|
% elif stat_id == 'top_libraries':
|
||||||
|
<div id="stats-background-${stat_id}" class="dashboard-stats-background" style="background-image: url(${page('pms_image_proxy', row0['art'], None, 500, 280, 40, '282828', 3, fallback='art')});">
|
||||||
% else:
|
% else:
|
||||||
<div id="stats-background-${stat_id}" class="dashboard-stats-background flat">
|
<div id="stats-background-${stat_id}" class="dashboard-stats-background flat">
|
||||||
% endif
|
% endif
|
||||||
|
@ -112,7 +114,11 @@ DOCUMENTATION :: END
|
||||||
% elif stat_id == 'most_concurrent':
|
% elif stat_id == 'most_concurrent':
|
||||||
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon stats-${stat_id} transparent hidden-xs"></div>
|
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon stats-${stat_id} transparent hidden-xs"></div>
|
||||||
% elif stat_id == 'top_libraries':
|
% elif stat_id == 'top_libraries':
|
||||||
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon library-${row0['section_type']} hidden-xs"></div>
|
% if row0['thumb'].startswith('http'):
|
||||||
|
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat hidden-xs" style="background-image: url(${page('pms_image_proxy', row0['thumb'], None, 80, 80)});"></div>
|
||||||
|
% else:
|
||||||
|
<div id="stats-thumb-${stat_id}" class="dashboard-stats-flat svg-icon library-${row0['section_type']} hidden-xs"></div>
|
||||||
|
% endif
|
||||||
% endif
|
% endif
|
||||||
<div class="dashboard-stats-info-container">
|
<div class="dashboard-stats-info-container">
|
||||||
<div id="stats-title-${stat_id}" class="dashboard-stats-info-title">
|
<div id="stats-title-${stat_id}" class="dashboard-stats-info-title">
|
||||||
|
|
|
@ -783,6 +783,7 @@
|
||||||
var art = $(elem).data('art');
|
var art = $(elem).data('art');
|
||||||
var thumb = $(elem).data('thumb');
|
var thumb = $(elem).data('thumb');
|
||||||
var user_id = $(elem).data('user_id');
|
var user_id = $(elem).data('user_id');
|
||||||
|
var library_type = $(elem).data('library-type');
|
||||||
var user_thumb = $(elem).data('user_thumb');
|
var user_thumb = $(elem).data('user_thumb');
|
||||||
var rating_key = $(elem).data('rating_key');
|
var rating_key = $(elem).data('rating_key');
|
||||||
var guid = $(elem).data('guid');
|
var guid = $(elem).data('guid');
|
||||||
|
@ -810,10 +811,16 @@
|
||||||
$('#stats-background-' + stat_id).removeClass(function (index, className) {
|
$('#stats-background-' + stat_id).removeClass(function (index, className) {
|
||||||
return (className.match (/(^|\s)platform-\S+/g) || []).join(' ');
|
return (className.match (/(^|\s)platform-\S+/g) || []).join(' ');
|
||||||
}).addClass('platform-' + $(elem).data('platform') + '-rgba');
|
}).addClass('platform-' + $(elem).data('platform') + '-rgba');
|
||||||
} else if (stat_id == 'top_libraries') {
|
} else if (stat_id === 'top_libraries') {
|
||||||
|
$('#stats-background-' + stat_id).css('background-image', 'url(' + page('pms_image_proxy', art, null, 500, 280, 40, '282828', 3, 'art') + ')');
|
||||||
$('#stats-thumb-' + stat_id).removeClass(function (index, className) {
|
$('#stats-thumb-' + stat_id).removeClass(function (index, className) {
|
||||||
return (className.match (/(^|\s)library-\S+/g) || []).join(' ');
|
return (className.match (/(^|\s)svg-icon library-\S+/g) || []).join(' ')});
|
||||||
}).addClass('library-' + $(elem).data('library-type'));
|
if (thumb.startsWith('http')) {
|
||||||
|
$('#stats-thumb-' + stat_id).css('background-image', 'url(' + page('pms_image_proxy', thumb, null, 300, 300, null, null, null, 'cover') + ')');
|
||||||
|
} else {
|
||||||
|
$('#stats-thumb-' + stat_id).css('background-image', '')
|
||||||
|
.addClass('svg-icon library-' + library_type);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (rating_key) {
|
if (rating_key) {
|
||||||
if (live) {
|
if (live) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue