Files

64 lines
1.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<%
const hasPlayer = (typeof player !== 'undefined' && player);
const chartPdgaNumber = hasPlayer ? player.pdgaNumber : pdgaNumber;
%>
<div class="player-detail">
<% if (hasPlayer) { %>
<div class="player-detail-left">
<dl class="detail-grid">
<div>
<dt>Current rating</dt>
<dd><%= player.rating ?? '—' %></dd>
</div>
<div>
<dt>Last month</dt>
<dd><%= player.lastMonthRating ?? '—' %></dd>
</div>
<div>
<dt>Change vs last month</dt>
<dd><%- include('delta-pill', { value: player.ratingChange }) %></dd>
</div>
<div>
<dt>Predicted next update</dt>
<dd><%= player.predictedRating ?? '—' %></dd>
</div>
<div>
<dt>Gap to predicted</dt>
<dd><%- include('delta-pill', { value: player.deltaPredicted, extraClass: 'delta-predicted-pill' }) %></dd>
</div>
<% if (player.stdDev != null && player.rating) { %>
<div>
<dt>Round spread</dt>
<dd>±<%= player.stdDev %></dd>
</div>
<div>
<dt>Rating range</dt>
<dd><%= player.rating - player.stdDev %><%= player.rating + player.stdDev %></dd>
</div>
<% } %>
<% if (player.excludedRoundsCount != null && player.rating) { %>
<div>
<dt>Excluded rounds</dt>
<dd><%= player.excludedRoundsCount %></dd>
</div>
<% } %>
<% if (player.cutoffRating != null && player.rating) { %>
<div>
<dt>Cutoff rating</dt>
<dd><%= player.cutoffRating %></dd>
</div>
<% } %>
</dl>
</div>
<% } %>
<% if (history && history.length > 0) { %>
<div class="player-chart" id="chart-<%= chartPdgaNumber %>"
data-history="<%= JSON.stringify(history) %>">
</div>
<% } else { %>
<div class="loading-chart">No rating history available</div>
<% } %>
</div>
<div class="chart-tooltip" id="tooltip-<%= chartPdgaNumber %>"></div>