Files
JellyPy/data/interfaces/default/home_stats.html
Tim e7b305a1d5 Early implementation of friendly names. This be aware that this writes a new table to your plexWatch database.
Note: To edit friendly name, go to user page and click the pencil icon next to the user name. Currently only works on home stats and user info page.
Adjust some table styling issues.
Fix bug with user IP modal details not showing.
Fix users default list order.
2015-06-29 01:35:17 +02:00

156 lines
6.1 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: home_stats.html
Version: 0.1
Variable names: data [array]
data[array_index] :: Usable parameters
data['stat_id'] Returns the name of the stat. Either 'top_tv', 'popular_tv', 'top_user' or 'top_platform'
data['rows'] Returns an array containing stat data
data[array_index]['rows'] :: Usable parameters
== Only if 'stat_id' is 'top_tv' or 'popular_tv' ==
grandparent_thumb Returns location of the item's thumbnail. Use with pms_image_proxy.
rating_key Returns the unique identifier for the media item.
orig_title Returns the title for the associated stat.
== Only if 'stat_id' is 'top_tv' or 'top_user' or 'top_platform' ==
total_plays Returns the count for the associated stat.
== Only of 'stat_id' is 'popular_tv' ==
users_watched Returns the count for the associated stat.
== Only if 'stat_id' is 'top_user' ==
thumb Returns url of the user's gravatar. Returns '' if none exists.
user Returns the username for the associated stat.
friendly_name Returns the friendly name of the user for the associated stat.
== Only if 'stat_id' is 'top_platform' ==
platform_type Returns the platform name for the associated stat.
DOCUMENTATION :: END
</%doc>
% if data != None:
% if data[0]['rows']:
<div class="user-platforms">
<ul>
% for a in data:
% if a['stat_id'] == 'top_tv':
<div class="home-platforms-instance">
<li>
<span>
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
% if a['rows'][0]['grandparent_thumb'] != '':
<img class="home-platforms-instance-poster"
src="pms_image_proxy?img=${a['rows'][0]['grandparent_thumb']}&width=162&height=240">
% else:
<img class="home-platforms-instance-poster" src="interfaces/default/images/poster.png">
% endif
</a>
</span>
<div class="home-platforms-instance-name">
<h4>Most Watched TV</h4>
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
<h5>${a['rows'][0]['orig_title']}</h5>
</a>
</div>
<div class="user-platforms-instance-playcount">
<h3>${a['rows'][0]['total_plays']}</h3>
<p> plays</p>
</div>
</li>
</div>
% elif a['stat_id'] == 'popular_tv':
<div class="home-platforms-instance">
<li>
<span>
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
% if a['rows'][0]['grandparent_thumb'] != '':
<img class="home-platforms-instance-poster"
src="pms_image_proxy?img=${a['rows'][0]['grandparent_thumb']}&width=162&height=240">
% else:
<img class="home-platforms-instance-poster" src="interfaces/default/images/poster.png">
% endif
</a>
</span>
<div class="home-platforms-instance-name">
<h4>Most Popular TV</h4>
<a href="info?rating_key=${a['rows'][0]['rating_key']}">
<h5>${a['rows'][0]['orig_title']}</h5>
</a>
</div>
<div class="user-platforms-instance-playcount">
<h3>${a['rows'][0]['users_watched']}</h3>
<p> users</p>
</div>
</li>
</div>
% elif a['stat_id'] == 'top_users':
<div class="home-platforms-instance">
<li>
<span>
<a href="user?user=${a['rows'][0]['user']}">
% if a['rows'][0]['thumb'] != '':
<img class="home-platforms-instance-oval" src="${a['rows'][0]['thumb']}"
class="poster-face">
% else:
<img class="home-platforms-instance-oval"
src="interfaces/default/images/gravatar-default.png">
% endif
</a>
</span>
<div class="home-platforms-instance-name">
<h4>Most Active User</h4>
<a href="user?user=${a['rows'][0]['user']}">
<h5>${a['rows'][0]['friendly_name']}</h5>
</a>
</div>
<div class="user-platforms-instance-playcount">
<h3>${a['rows'][0]['total_plays']}</h3>
<p> plays</p>
</div>
</li>
</div>
% elif a['stat_id'] == 'top_platforms':
<div class="home-platforms-instance">
<li>
<div id="platform-stat">
<img class="home-platforms-instance-box" src="interfaces/default/images/platforms/default.png">
</div>
<div class="home-platforms-instance-name">
<h4>Most Active Platform</h4>
<h5>${a['rows'][0]['platform_type']}</h5>
</div>
<div class="user-platforms-instance-playcount">
<h3>${a['rows'][0]['total_plays']}</h3>
<p> plays</p>
</div>
</li>
</div>
<script>
$("#platform-stat").html("<img class='home-platforms-instance-box' src='" + getPlatformImagePath('${a['rows'][0]['platform_type']}') + "'>");
</script>
% endif
% endfor
</ul>
</div>
% else:
<div class="muted">No stats for selected period.</div><br>
% endif
% else:
<div class="muted">There was an error loading your PlexWatch data. Please check your <a href="config">settings</a>.
</div><br>
% endif