plexpy/data/interfaces/default/info.html
Tim 9152fa01af VERY EXPERIMENTAL CHANGES!
History logging is now under the hood. Disabled by default.
Write new database tables and upgrade old ones.
Provide more detail to get_activity.
2015-07-11 22:10:45 +02:00

294 lines
14 KiB
HTML

<%doc>
USAGE DOCUMENTATION :: PLEASE LEAVE THIS AT THE TOP OF THIS FILE
For Mako templating syntax documentation please visit: http://docs.makotemplates.org/en/latest/
Filename: info.html
Version: 0.1
Variable names: data [list]
data :: Usable parameters (if not applicable for media type, blank value will be returned)
== Global keys ==
rating_key Returns the unique identifier for the media item.
type Returns the type of media. Either 'movie', 'episode' or 'show' or 'season'.
art Returns the location of the item's artwork
title Returns the name of the episode, show, season or movie.
duration Returns the standard runtime of the media.
content_rating Returns the age rating for the media.
summary Returns a brief description of the media plot.
grandparent_title Returns the name of the TV show.
parent_index Returns the season number of the TV show.
index Returns the episode number.
parent_thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
writers Returns an array of writers.
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
parent_title Returns the name of the TV show.
rating Returns the 5 star rating value for the movie. Between 1 and 5.
year Returns the release year of the movie.
genres Returns an array of genres.
actors Returns an array of actors.
directors Returns an array of directors.
studio Returns the name of the studio.
DOCUMENTATION :: END
</%doc>
<%inherit file="base.html"/>
<%!
from plexpy import helpers
%>
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/plexwatch-tables.css">
<link rel="stylesheet" href="interfaces/default/css/dataTables.responsive.css">
</%def>
<%def name="body()">
% if data:
<div class="clear"></div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div class="art-face"
style="background-image:url(pms_image_proxy?img=${data['art']}&width=1920&height=1080)">
<div class="summary-wrapper">
<div class="summary-overlay">
<div class="row-fluid">
<div class="span9">
<div class="summary-content-poster hidden-phone hidden-tablet">
% if data['type'] == 'episode':
<img src="pms_image_proxy?img=${data['parent_thumb']}&width=256&height=352">
% else:
<img src="pms_image_proxy?img=${data['thumb']}&width=256&height=352">
% endif
</div>
<div class="summary-content">
<div class="summary-content-title">
% if data['type'] == 'movie':
<h1>${data['title']} (${data['year']})</h1>
% elif data['type'] == 'season':
<h1>${data['parent_title']} (${data['title']})</h1>
% elif data['type'] == 'episode':
<h1>${data['grandparent_title']} (Season ${data['parent_index']}, Episode
${data['index']}) "${data['title']}"</h1>
% else:
<h1>${data['title']}</h1>
% endif
</div>
% if data['type'] == 'movie':
<div id="stars" class="rateit hidden-phone hidden-tablet" data-rateit-value=""
data-rateit-ispreset="true" data-rateit-readonly="true"></div>
% endif
<div class="summary-content-details-wrapper">
<div class="summary-content-director">
% if data['type'] == 'episode' or data['type'] == 'movie':
% if data['directors']:
Directed by <strong> ${data['directors'][0]}</strong>
% else:
Directed by <strong> unknown</strong>
% endif
% elif data['type'] == 'show' or data['type'] == 'season':
Studio <strong> ${data['studio']}</strong>
% endif
</div>
<div class="summary-content-duration">
Runtime <strong> <span id="runtime">${data['duration']}</span> mins</strong>
</div>
<div class="summary-content-content-rating">
Rated <strong> ${data['content_rating']} </strong>
</div>
</div>
<div class="summary-content-summary">
<p> ${data['summary']} </p>
</div>
</div>
</div>
% if data['type'] == 'episode':
<div class="span3">
<div class="summary-content-people-wrapper hidden-phone hidden-tablet">
<div class="summary-content-writers">
<h6><strong>Written by</strong></h6>
<ul>
% for writer in data['writers']:
% if loop.index < 5:
<li>
${writer}
</li>
% endif
% endfor
</ul>
</div>
</div>
</div>
% elif data['type'] == 'movie' or data['type'] == 'show':
<div class="span3">
<div class="summary-content-people-wrapper hidden-phone hidden-tablet">
<div class="summary-content-actors">
<h6><strong>Genres</strong></h6>
<ul>
% for genre in data['genres']:
% if loop.index < 5:
<li>
${genre}
</li>
% endif
% endfor
</ul>
</div>
<div class="summary-content-people-wrapper hidden-phone hidden-tablet">
<div class="summary-content-actors">
<h6><strong>Starring</strong></h6>
<ul>
% for actor in data['actors']:
% if loop.index < 5:
<li>
${actor}
</li>
% endif
% endfor
</ul>
</div>
</div>
</div>
</div>
% elif data['type'] == 'season':
<div class="span3"></div>
% endif
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='container-fluid'>
<div class='row-fluid'>
<div class='span12'>
<div class='table-card-back'>
% if data['type'] == 'movie' or data['type'] == 'episode' or data['type'] == 'show':
<h3>Watch history for <strong>${data['title']}</strong></h3>
</div>
<div class="table-card-back">
<table class="display" id="history_table" width="100%">
<thead>
<tr>
<th class="never" align='left' id="id">ID</th>
<th class="all" align='left' id="time">Time</th>
<th class="all" align='left' id="friendly_name">User</th>
<th class="desktop" align='left' id="platform">Platform</th>
<th class="desktop" align='left' id="ip_address">IP Address</th>
<th class="min-tablet" align='left' id="title">Title</th>
<th class="min-tablet" align='left' id="started">Started</th>
<th class="desktop" align='left' id="paused_counter">Paused</th>
<th class="desktop" align='left' id="stopped">Stopped</th>
<th class="desktop" align='left' id="duration">Duration</th>
<th class="desktop" align='left' id="percent_complete">Completed</th>
<th class="never" align='left' id="rating_key">rating_key</th>
<th class="never" align='left' id="xml"></th>
<th class="never" align='left' id="user"></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div id="info-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="info-modal"
aria-hidden="true">
</div>
% elif data['type'] == 'season':
<div class="wellheader">
<div class="dashboard-wellheader">
<h3>Episode list for <strong>${data['title']}</strong></h3>
</div>
</div>
<div id="episode-list">
</div>
% endif
</div>
</div>
</div>
% else:
<div class="clear"></div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span10 offset1">
<h3>Error retrieving item data. This media may not be available in the Plex Media Server database
anymore.</h3>
</div>
</div>
</div>
% endif
</%def>
<%def name="javascriptIncludes()">
<script src="interfaces/default/js/jquery.rateit.min.js"></script>
<script src="interfaces/default/js/jquery.dataTables.min.js"></script>
<script src="interfaces/default/js/dataTables.responsive.js"></script>
<script src="interfaces/default/js/jquery.dataTables.bootstrap.pagination.integration.js"></script>
<script src="interfaces/default/js/moment-with-locale.js"></script>
% if data:
% if data['type'] == 'movie':
<script>
// Convert rating to 5 star rating type
var starRating = Math.round(${data['rating']} / 2)
$('#stars').attr('data-rateit-value', starRating)
</script>
% endif
% if data['type'] == 'movie' or data['type'] == 'episode':
<script src="interfaces/default/js/tables/history_table.js"></script>
<script>
$(document).ready(function () {
history_table_options.ajax = {
"url": "get_history",
"data": function(d) {
d.rating_key = ${data['rating_key']};
}
}
history_table = $('#history_table').DataTable(history_table_options);
// Hide the title column
history_table.column(5).visible(false);
});
</script>
% elif data['type'] == 'show':
<script src="interfaces/default/js/tables/history_table.js"></script>
<script>
$(document).ready(function () {
history_table_options.ajax = {
"url": "get_history",
"data": function(d) {
d.grandparent_rating_key = ${data['rating_key']};
}
}
history_table = $('#history_table').DataTable(history_table_options);
});
</script>
% endif
% if data['type'] == 'season':
<script>
$.ajax({
url: 'get_children',
type: "GET",
async: true,
data: { rating_key : ${data['rating_key']} },
complete: function(xhr, status) {
$("#episode-list").html(xhr.responseText);
}
});
</script>
% endif
<script>
$("#runtime").html(millisecondsToMinutes($("#runtime").html(), true));
</script>
% endif
</%def>