2018-11-08 07:23:08 +01:00
{{define "stats"}}
{{template "header" .}}
<style>
table.classy th { text-align: left }
table.classy th.num { text-align: right }
td + td {
padding-left: 0.5em;
padding-right: 0.5em;
}
td.num {
text-align: right;
}
table.classy.export a { text-transform: inherit; }
td.none {
font-style: italic;
}
</style>
<div class="content-container snug">
2019-11-12 00:21:45 +01:00
{{if .Silenced}}
{{template "user-silenced"}}
2019-10-25 21:04:24 +02:00
{{end}}
2020-08-19 23:09:47 +02:00
{{template "collection-breadcrumbs" .}}
<h1 id="posts-header">Stats</h1>
2020-08-19 22:24:37 +02:00
{{if .Collection}}
{{template "collection-nav" (dict "Alias" .Collection.Alias "Path" .Path "SingleUser" .SingleUser)}}
{{end}}
2018-11-08 07:23:08 +01:00
<p>Stats for all time.</p>
{{if .Federation}}
<h3>Fediverse stats</h3>
<table id="fediverse" class="classy export">
<tr>
<th>Followers</th>
</tr>
<tr>
<td>{{.APFollowers}}</td>
</tr>
</table>
{{end}}
<h3>Top {{len .TopPosts}} posts</h3>
<table class="classy export">
<tr>
<th>Post</th>
{{if not .Collection}}<th>Blog</th>{{end}}
<th class="num">Total Views</th>
</tr>
{{range .TopPosts}}<tr>
2022-03-29 19:23:20 +02:00
<td style="word-break: break-all;"><a href="{{if .Collection}}{{.Collection.CanonicalURL}}{{.Slug.String}}{{else}}/{{.ID}}{{end}}">{{if ne .DisplayTitle ""}}{{.DisplayTitle}}{{else}}<em>{{.ID}}</em>{{end}}</a></td>
2018-11-08 07:23:08 +01:00
{{ if not $.Collection }}<td>{{if .Collection}}<a href="{{.Collection.CanonicalURL}}">{{.Collection.Title}}</a>{{else}}<em>Draft</em>{{end}}</td>{{ end }}
<td class="num">{{.ViewCount}}</td>
</tr>{{end}}
</table>
</div>
{{template "footer" .}}
{{end}}