Improve playlist view on info page

This commit is contained in:
JonnyWong16 2020-09-30 15:54:18 -07:00
commit c5ea50d480
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
5 changed files with 58 additions and 12 deletions

View file

@ -122,10 +122,10 @@ DOCUMENTATION :: END
<a href="${page('info', child['rating_key'])}" title="${child['title']}">${child['title']}</a>
</h3>
</div>
% elif data['children_type'] == 'track' or media_type == 'playlist':
<% i = 'even' if loop.index % 2 == 0 else 'odd' %>
<div class="item-children-list-item-${i}">
<span class="item-children-list-item-index">&nbsp;${child['media_index'] or loop.index + 1}</span>
% elif data['children_type'] == 'track':
<% e = 'even' if loop.index % 2 == 0 else 'odd' %>
<div class="item-children-list-item-${e}">
<span class="item-children-list-item-index">&nbsp;${child['media_index']}</span>
<span class="item-children-list-item-title">
<a href="${page('info', child['rating_key'])}" title="${child['title']}">${child['title']}</a>
% if child['original_title']:
@ -137,12 +137,54 @@ DOCUMENTATION :: END
<script>$('#item-children-list-item-duration-${loop.index + 1}').text(moment.utc(${child['duration']}).format("${f}"));</script>
</span>
</div>
% elif media_type == 'playlist':
<% e = 'even' if loop.index % 2 == 0 else 'odd' %>
<div class="item-children-list-item-${e}">
<span class="item-children-list-item-index">&nbsp;${loop.index + 1}</span>
<span class="item-children-list-item-title">
% if child['media_type'] == 'movie':
<span class="media-type-tooltip" data-toggle="tooltip" title="Movie"><i class="fa fa-film fa-fw"></i></span>&nbsp;
<a href="${page('info', child['rating_key'])}" title="${child['title']}">
${child['title']}
</a>
<span class="text-muted"> (${child['year']})</span>
% elif child['media_type'] == 'episode':
<span class="media-type-tooltip" data-toggle="tooltip" title="Episode"><i class="fa fa-television fa-fw"></i></span>&nbsp;
<a href="${page('info', child['grandparent_rating_key'])}" title="${child['grandparent_title']}">
${child['grandparent_title']}
</a> -
<a href="${page('info', child['rating_key'])}" title="${child['title']}">
${child['title']}
</a>
<span class="text-muted"> (<a class="no-highlight" href="${page('info', child['parent_rating_key'])}" title="${child['parent_title']}">S${child['parent_media_index']}</a> &middot; <a class="no-highlight" href="${page('info', child['rating_key'])}" title="${child['title']}">E${child['media_index']}</a>)</span>
% elif child['media_type'] == 'track':
<span class="media-type-tooltip" data-toggle="tooltip" title="Track"><i class="fa fa-music fa-fw"></i></span>&nbsp;
<a href="${page('info', child['rating_key'])}" title="${child['title']}">
${child['title']}
</a> -
<a href="${page('info', child['grandparent_rating_key'])}" title="${child['grandparent_title']}">
${child['grandparent_title']}
</a>
<span class="text-muted"> (<a class="no-highlight" href="${page('info', child['parent_rating_key'])}" title="${child['parent_title']}">${child['parent_title']}</a>)</span>
% endif
</span>
<span class="item-children-list-item-duration" id="item-children-list-item-duration-${loop.index + 1}">
<% f = 'h:mm:ss' if cast_to_int(child['duration']) >= 3600000 else 'm:ss' %>
<script>$('#item-children-list-item-duration-${loop.index + 1}').text(moment.utc(${child['duration']}).format("${f}"));</script>
</span>
</div>
% endif
</li>
% endif
% endfor
</ul>
</div>
<script>
$('body').tooltip({
selector: '[data-toggle="tooltip"]',
container: 'body'
});
</script>
% endif
% endif