<% if (!layouts || layouts.length === 0) { %>
No layouts found. Click the refresh button to scrape layouts.
<% } else { var oneYearAgo = new Date(); oneYearAgo.setDate(oneYearAgo.getDate() - 365); var activeLayouts = []; var inactiveLayouts = []; layouts.forEach(function(l) { if (l.last_played && new Date(l.last_played) >= oneYearAgo) { activeLayouts.push(l); } else { inactiveLayouts.push(l); } }); var RATING_TIER_HIGH = 970; var RATING_TIER_MID = 940; function ratingTier(r) { if (r == null) return null; if (r >= RATING_TIER_HIGH) return 'green'; if (r >= RATING_TIER_MID) return 'amber'; return 'orange'; } %>
LAYOUTS <%= activeLayouts.length %> active · <%= inactiveLayouts.length %> inactive
<% if (inactiveLayouts.length > 0) { %>
<% } %> <% } %>