Updated library cards on the homepage

This commit is contained in:
JonnyWong16 2017-12-10 20:33:14 -08:00
parent 07d8fbb7f4
commit b22ae58f79
3 changed files with 96 additions and 67 deletions

View file

@ -1138,6 +1138,25 @@ a .dashboard-activity-metadata-user-thumb:hover {
border-radius: 4px;
overflow: hidden;
}
.dashboard-stats-library {
background-position: center;
background-size: cover;
height: 100px;
width: 100px;
margin-top: 25px;
margin-right: 5px;
-webkit-flex-shrink: 0;
flex-shrink: 0;
-webkit-transition: background .2s ease-in-out;
transition: background .2s ease-in-out;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
z-index: 1;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
overflow: hidden;
}
.dashboard-stats-info-container {
display: -webkit-flex;
display: flex;
@ -1250,17 +1269,17 @@ a .dashboard-activity-metadata-user-thumb:hover {
-webkit-flex-shrink: 0;
flex-shrink: 0;
}
.dashboard-stats-info-item:first-of-type {
.dashboard-stats-info-item.expanded {
padding: 5px 5px;
line-height: 20px;
}
.dashboard-stats-info-item:first-of-type .sub-heading {
.dashboard-stats-info-item.expanded .sub-heading {
font-size: 13px;
}
.dashboard-stats-info-item:first-of-type .sub-value {
.dashboard-stats-info-item.expanded .sub-value {
font-size: 16px;
}
.dashboard-stats-info-item:first-of-type .sub-count {
.dashboard-stats-info-item.expanded .sub-count {
font-size: 16px;
}
.dashboard-stats-info-item:hover {

View file

@ -122,7 +122,7 @@ DOCUMENTATION :: END
<div class="dashboard-stats-info scoller-content">
<ul class="list-unstyled dashboard-stats-info-list">
% for row in top_stat['rows']:
<li class="dashboard-stats-info-item" data-stat_id="${stat_id}" data-rating_key="${row.get('rating_key')}" data-title="${row.get('title')}"
<li class="dashboard-stats-info-item ${'expanded' if loop.index == 0 else ''}" data-stat_id="${stat_id}" data-rating_key="${row.get('rating_key')}" data-title="${row.get('title')}"
data-art="${row.get('art')}" data-thumb="${row.get('thumb')}" data-platform="${row.get('platform_type')}"
data-user_id="${row.get('user_id')}" data-friendly_name="${row.get('friendly_name')}"
data-last_watch="${row.get('last_watch')}" data-started="${row.get('started')}">

View file

@ -24,73 +24,83 @@ DOCUMENTATION :: END
</%doc>
% if data:
<ul class="list-unstyled">
% for library in data:
<div class="home-platforms-instance">
<div class="home-platforms-instance-overlay">
<div class="home-platforms-instance-background" style="background-image: url(pms_image_proxy?img=${library['art']}&width=500&height=280&fallback=art);"></div>
</div>
<li>
<div class="home-platforms-instance-info">
<div class="home-platforms-instance-name">
% for library in data:
<%
section_id = library['section_id']
%>
<div class="dashboard-stats-instance" id="library-stats-instance-${section_id}" data-section_id="${section_id}">
<div class="dashboard-stats-container">
<div class="dashboard-stats-background-overlay">
<div id="library-stats-background-${section_id}" class="dashboard-stats-background" style="background-image: url(pms_image_proxy?img=${library['art']}&width=500&height=280&fallback=art);"></div>
<a href="library?section_id=${library['section_id']}" title="${library['section_name']}">
% if library['thumb'].startswith("http"):
<div id="library-stats-thumb-${section_id}" class="dashboard-stats-library hidden-xs" style="background-image: url(${library['thumb']});"></div>
% else:
<div id="library-stats-thumb-${section_id}" class="dashboard-stats-library hidden-xs" style="background-image: url(pms_image_proxy?img=${library['thumb']}&width=300&height=300&fallback=cover);"></div>
% endif
</a>
<div class="dashboard-stats-info-container">
<div id="library-stats-title-${section_id}" class="dashboard-stats-info-title">
<h4>
<a href="library?section_id=${library['section_id']}" title="${library['section_name']}">${library['section_name']}</a>
</h4>
<span class="dashboard-stats-stats-units">items</span>
</div>
% if library['section_type'] == 'movie':
<div class="home-platforms-instance-playcount">
<h5>All Movies</h5>
<h3>${library['count']}</h3>
<p> items</p>
<div class="dashboard-stats-info-scroller scrollbar-macosx">
<div class="dashboard-stats-info scoller-content">
<ul class="list-unstyled dashboard-stats-info-list">
<%
h1 = h2 = h3 = ''
if library['section_type'] == 'movie':
h1 = 'Movies'
if library['section_type'] == 'show':
h1, h2, h3 = 'Shows', 'Seasons', 'Episodes'
elif library['section_type'] == 'artist':
h1, h2, h3 = 'Artists', 'Albums', 'Tracks'
elif library['section_type'] == 'photo':
h1, h3 = 'Albums', 'Photos'
%>
% if h1:
<li class="dashboard-stats-info-item expanded">
<div class="sub-heading">&bull;</div>
<div class="sub-value">
${h1}
</div>
% elif library['section_type'] == 'show':
<div class="home-platforms-instance-playcount">
<h5>All Shows</h5>
<h3>${library['count']}</h3>
<p> items</p>
<div class="sub-count">
${library['count']}
</div>
<div class="home-platforms-instance-playcount" style="padding-left: 10px;">
<h5>All Episodes</h5>
<h3>${library['child_count']}</h3>
<p> items</p>
</div>
% elif library['section_type'] == 'artist':
<div class="home-platforms-instance-playcount">
<h5>All Artists</h5>
<h3>${library['count']}</h3>
<p> items</p>
</div>
<div class="home-platforms-instance-playcount" style="padding-left: 10px;">
<h5>All Albums</h5>
<h3>${library['parent_count']}</h3>
<p> items</p>
</div>
% elif library['section_type'] == 'photo':
<div class="home-platforms-instance-playcount">
<h5>All Albums</h5>
<h3>${library['count']}</h3>
<p> items</p>
</div>
<div class="home-platforms-instance-playcount" style="padding-left: 10px;">
<h5>All Photos</h5>
<h3>${library['child_count']}</h3>
<p> items</p>
</div>
% endif
</div>
% if library['thumb'].startswith("http"):
<div class="home-platforms-instance-poster">
<div class="home-platforms-library-thumb" style="background-image: url(${library['thumb']});"></div>
</div>
% else:
<div class="home-platforms-instance-poster">
<div class="home-platforms-library-thumb" style="background-image: url(pms_image_proxy?img=${library['thumb']}&width=300&height=300&fallback=cover);"></div>
</div>
% endif
</li>
% endif
% if h2:
<li class="dashboard-stats-info-item expanded">
<div class="sub-heading">&bull;</div>
<div class="sub-value">
${h2}
</div>
% endfor
</ul>
<div class="sub-count">
${library['parent_count']}
</div>
</li>
% endif
% if h3:
<li class="dashboard-stats-info-item expanded">
<div class="sub-heading">&bull;</div>
<div class="sub-value">
${h3}
</div>
<div class="sub-count">
${library['child_count']}
</div>
</li>
% endif
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
% endfor
% else:
<div class="text-muted">No stats to show.</div><br>
% endif