Files
stl/templates/stats.hbs

56 lines
2.3 KiB
Handlebars

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<link rel="icon" type="image/svg+xml" href="/static/icon.svg">
<link rel="stylesheet" href="/static/styles/common.css">
<link rel="stylesheet" href="/static/styles/charts.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu|Ubuntu+Mono&display=swap">
<title>stl</title>
</head>
<body>
<h1 class="title">stl</h1>
{{#each categories_stats}}
{{#if this.last_session_start}}
<div class="hline"></div>
<h2>
<span>Kategori:</span>
<span>{{this.category.name}}</span>
<span style="color: {{this.category.color}};">●</span>
</h2>
<h2>
<span>Senaste session:</span>
<span class="history_entry_started">{{pretty_datetime this.last_session_start}}</span>
<span>i</span>
<span class="history_entry_duration">{{pretty_seconds this.secs_last_session}}</span>
</h2>
<h2>
<span>Senaste veckan:</span>
<span class="history_entry_duration">{{pretty_seconds this.secs_last_week}}</span>
<span>Senaste månaden:</span>
<span class="history_entry_duration">{{pretty_seconds this.secs_last_month}}</span>
</h2>
<h2>Andel per timme:</h2>
<div class="chart_histogram">
<div class="chart_histogram_legend">{{this.bars_max}}&percnt;</div>
{{#each this.bars}}
<div class="chart_histogram_col">
<div style="flex-grow: {{this.2}};"></div>
<div class="chart_histogram_col_line chart_col_tooltip" style="flex-grow: {{this.1}};">
<span class="chart_col_tooltiptext">{{this.1}}&percnt;</span>
</div>
<div class="chart_histogram_col_label">{{this.0}}</div>
</div>
{{/each}}
</div>
{{/if}}
{{/each}}
</body>
</html>