website/web/templates/forum/board_index.html

127 lines
4.5 KiB
HTML

{{define "title"}}{{.Forum.Title}}{{end}}
{{define "content"}}
<div class="block">
<section class="hero is-light is-success">
<div class="hero-body">
<div class="container">
<h1 class="title">
<span class="icon mr-4"><i class="fa fa-comments"></i></span>
<span>{{.Forum.Title}}</span>
</h1>
</div>
</div>
</section>
</div>
{{$Root := .}}
<div class="block px-4">
<div class="columns">
<div class="column">
<nav class="breadcrumb" aria-label="breadcrumbs">
<ul>
<li><a href="/forum">Forums</a></li>
<li class="is-active">
<a href="{{.Request.URL.Path}}" aria-current="page">{{.Forum.Title}}</a>
</li>
</ul>
</nav>
</div>
<div class="column is-narrow">
<a href="/forum/post?to={{.Forum.Fragment}}" class="button is-primary">
<span class="icon"><i class="fa fa-plus"></i></span>
<span>New Thread</span>
</a>
</div>
</div>
</div>
<p class="block p-2">
Found <strong>{{.Pager.Total}}</strong> post{{Pluralize64 .Pager.Total}} on this forum
(page {{.Pager.Page}} of {{.Pager.Pages}}).
</p>
<div class="block p-2">
<nav class="pagination" role="navigation" aria-label="pagination">
<a class="pagination-previous{{if not .Pager.HasPrevious}} is-disabled{{end}}" title="Previous"
href="{{.Request.URL.Path}}?page={{.Pager.Previous}}">Previous</a>
<a class="pagination-next{{if not .Pager.HasNext}} is-disabled{{end}}" title="Next"
href="{{.Request.URL.Path}}?page={{.Pager.Next}}">Next page</a>
<ul class="pagination-list">
{{$Root := .}}
{{range .Pager.Iter}}
<li>
<a class="pagination-link{{if .IsCurrent}} is-current{{end}}"
aria-label="Page {{.Page}}"
href="{{$Root.Request.URL.Path}}?page={{.Page}}">
{{.Page}}
</a>
</li>
{{end}}
</ul>
</nav>
</div>
{{$Root := .}}
<div class="block p-2">
{{range .Threads}}
{{$Stats := $Root.ThreadMap.Get .ID}}
<div class="box has-background-link-light">
<div class="columns">
<div class="column is-2 has-text-centered">
<div>
<a href="/u/{{.Comment.User.Username}}">
<figure class="image is-96x96 is-inline-block">
{{if .Comment.User.ProfilePhoto.ID}}
<img src="{{PhotoURL .Comment.User.ProfilePhoto.CroppedFilename}}">
{{else}}
<img src="/static/img/shy.png">
{{end}}
</figure>
</a>
</div>
<a href="/u/{{.Comment.User.Username}}">{{.Comment.User.Username}}</a>
</div>
<div class="column content">
<a href="/forum/thread/{{.ID}}" class="has-text-dark">
<h1 class="title pt-0">
{{or .Title "Untitled"}}
</h1>
{{TrimEllipses .Comment.Message 256}}
</a>
<hr class="mb-1">
<div>
<em>Updated {{SincePrettyCoarse .UpdatedAt}} ago</em>
</div>
</div>
<div class="column is-narrow">
<div class="columns is-mobile">
<div class="column has-text-centered">
<div class="box">
<p class="is-size-7">Replies</p>
{{if $Stats}}
{{$Stats.Replies}}
{{else}}
err
{{end}}
</div>
</div>
<div class="column has-text-centered">
<div class="box">
<p class="is-size-7">Views</p>
{{if $Stats}}
{{$Stats.Views}}
{{else}}
err
{{end}}
</div>
</div>
</div>
</div>
</div>
</div>
{{end}}
</div>
{{end}}