A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

66 строки
1.8 KiB

  1. {{define "stats"}}
  2. {{template "header" .}}
  3. <style>
  4. table.classy th { text-align: left }
  5. table.classy th.num { text-align: right }
  6. td + td {
  7. padding-left: 0.5em;
  8. padding-right: 0.5em;
  9. }
  10. td.num {
  11. text-align: right;
  12. }
  13. table.classy.export a { text-transform: inherit; }
  14. td.none {
  15. font-style: italic;
  16. }
  17. </style>
  18. <div class="content-container snug">
  19. {{if .Silenced}}
  20. {{template "user-silenced"}}
  21. {{end}}
  22. {{template "collection-breadcrumbs" .}}
  23. <h1 id="posts-header">Stats</h1>
  24. {{if .Collection}}
  25. {{template "collection-nav" (dict "Alias" .Collection.Alias "Path" .Path "SingleUser" .SingleUser)}}
  26. {{end}}
  27. <p>Stats for all time.</p>
  28. {{if or .Federation .EmailEnabled}}
  29. <h3>Subscribers</h3>
  30. <table id="fediverse" class="classy export">
  31. <tr>
  32. {{if .Federation}}<th>Fediverse Followers</th>{{end}}
  33. {{if .EmailEnabled}}<th>Email Subscribers</th>{{end}}
  34. </tr>
  35. <tr>
  36. {{if .Federation}}<td><a href="/me/c/{{.Collection.Alias}}/subscribers?filter=fediverse">{{.APFollowers}}</a></td>{{end}}
  37. {{if .EmailEnabled}}<td><a href="/me/c/{{.Collection.Alias}}/subscribers">{{.EmailSubscribers}}</a></td>{{end}}
  38. </tr>
  39. </table>
  40. {{end}}
  41. <h3>Top {{len .TopPosts}} posts</h3>
  42. <table class="classy export">
  43. <tr>
  44. <th>Post</th>
  45. {{if not .Collection}}<th>Blog</th>{{end}}
  46. <th class="num">Total Views</th>
  47. </tr>
  48. {{range .TopPosts}}<tr>
  49. <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>
  50. {{ if not $.Collection }}<td>{{if .Collection}}<a href="{{.Collection.CanonicalURL}}">{{.Collection.Title}}</a>{{else}}<em>Draft</em>{{end}}</td>{{ end }}
  51. <td class="num">{{.ViewCount}}</td>
  52. </tr>{{end}}
  53. </table>
  54. </div>
  55. {{template "footer" .}}
  56. {{end}}