website/web/templates/forum/admin.html
Noah 8085e092bc Forum Reply Enhancements + Better Pagers
* Enhance user experience replying to a forum thread. An inline reply textarea
  is added to page footers, "Quote" buttons on posts will quote the markdown
  source and focus the reply textarea, and "Reply" buttons will put an
  "@ mention" and focus the reply textarea. Users with scripts disabled will
  still be sent to the regular reply page as before.
* Improve all pagers by adding a "QueryPlus" template function that merges the
  page number with other current query parameters.
* Fix private profile picture avatars not displaying in your Notifications for
  profile pics you're allowed to see.
2022-09-10 12:09:46 -07:00

120 lines
4.1 KiB
HTML

{{define "title"}}Forums{{end}}
{{define "content"}}
<div class="block">
<section class="hero is-light is-danger">
<div class="hero-body">
<div class="container">
<h1 class="title">
<span class="icon mr-4"><i class="fa fa-gavel"></i></span>
<span>Forum Administration</span>
</h1>
</div>
</div>
</section>
</div>
{{$Root := .}}
<div class="block p-2">
<a href="/forum/admin/edit" class="button is-success">
<span class="icon"><i class="fa fa-plus"></i></span>
<span>Create New Forum</span>
</a>
</div>
<p class="block p-2">
Found <strong>{{.Pager.Total}}</strong> forum{{Pluralize64 .Pager.Total}} you can manage
(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}}?{{QueryPlus "page" .Pager.Previous}}">Previous</a>
<a class="pagination-next{{if not .Pager.HasNext}} is-disabled{{end}}" title="Next"
href="{{.Request.URL.Path}}?{{QueryPlus "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}}?{{QueryPlus "page" .Page}}">
{{.Page}}
</a>
</li>
{{end}}
</ul>
</nav>
</div>
<div class="block p-2">
{{range .Forums}}
<div class="box">
<div class="columns">
<div class="column">
<h1 class="title">{{.Title}}</h1>
<h2 class="subtitle">
/f/{{.Fragment}}
{{if .Category}}<span class="ml-4">{{.Category}}</span>{{end}}
<span class="ml-4">
by <strong><a href="/u/{{.Owner.Username}}">{{.Owner.Username}}</a></strong>
{{if .Owner.IsAdmin}}<i class="fa fa-gavel has-text-danger ml-1"></i>{{end}}
</span>
</h2>
<div class="content">
<p>
</p>
{{if eq .Description ""}}
<p><em>No description</em></p>
{{else}}
{{ToMarkdown .Description}}
{{end}}
</div>
<div>
{{if .Explicit}}
<div class="tag is-danger is-light">
<span class="icon"><i class="fa fa-fire"></i></span>
Explicit
</div>
{{end}}
{{if .Privileged}}
<div class="tag is-warning is-light">
<span class="icon"><i class="fa fa-gavel"></i></span>
Privileged
</div>
{{end}}
{{if .PermitPhotos}}
<div class="tag is-info is-light">
<span class="icon"><i class="fa fa-camera"></i></span>
PermitPhotos
</div>
{{end}}
<div class="tag is-light">
Created {{.CreatedAt.Format "2006-01-02 15:04:05"}}
</div>
<div class="tag is-light">
Updated {{.UpdatedAt.Format "2006-01-02 15:04:05"}}
</div>
</div>
</div>
<div class="column is-narrow">
<a href="/forum/admin/edit?id={{.ID}}" class="button has-text-success">
<span class="icon"><i class="fa fa-edit"></i></span>
<span>Edit</span>
</a>
</div>
</div>
</div>
{{end}}
</div>
{{end}}