website/web/templates/admin/certification.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

167 lines
7.9 KiB
HTML

{{define "title"}}Admin - Certification Photos{{end}}
{{define "content"}}
{{$Root := .}}
<div class="container">
<section class="hero is-danger is-bold">
<div class="hero-body">
<div class="container">
<h1 class="title">
Admin / Certification Photos
</h1>
</div>
</div>
</section>
<div class="block p-4">
<div class="columns">
<div class="column">
{{if .Pager}}
There {{Pluralize64 .Pager.Total "is" "are"}} <strong>{{.Pager.Total}}</strong> Certification Photo{{Pluralize64 .Pager.Total}}
{{if eq .View "pending"}}
needing approval.
{{else}}
at status "{{.View}}."
{{end}}
{{else if .FoundUser}}
Found user <strong><a href="/u/{{.FoundUser.Username}}" class="has-text-dark">{{.FoundUser.Username}}</a></strong>
(<a href="mailto:{{.FoundUser.Email}}">{{.FoundUser.Email}}</a>)
{{end}}
</div>
<div class="column is-narrow">
<div class="tabs is-toggle">
<ul>
<li{{if eq .View "pending"}} class="is-active"{{end}}>
<a href="{{.Request.URL.Path}}?view=pending">Needing Approval</a>
</li>
<li{{if eq .View "approved"}} class="is-active"{{end}}>
<a href="{{.Request.URL.Path}}?view=approved">Approved</a>
</li>
<li{{if eq .View "rejected"}} class="is-active"{{end}}>
<a href="{{.Request.URL.Path}}?view=rejected">Rejected</a>
</li>
</ul>
</div>
</div>
</div>
<div class="block">
<form method="GET" action="{{.Request.URL.Path}}">
<div class="field block">
<div class="label" for="username">Search username or email:</div>
<input type="text" class="input"
name="username"
id="username"
placeholder="Press Enter to search">
</div>
</form>
</div>
{{if .Pager}}
<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">
{{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>
{{end}}
<div class="columns is-multiline">
{{range .Photos}}
<div class="column is-one-third">
{{$User := $Root.UserMap.Get .UserID}}
<form action="{{$Root.Request.URL.Path}}" method="POST">
{{InputCSRF}}
<input type="hidden" name="user_id" value="{{$User.ID}}">
<div class="card" style="max-width: 512px">
<header class="card-header has-background-link">
<p class="card-header-title has-text-light">
<span class="icon"><i class="fa fa-user"></i></span>
<span>{{or $User.Username "[deleted]"}}</span>
</p>
</header>
<div class="card-image">
<figure class="image">
<img src="{{PhotoURL .Filename}}">
</figure>
</div>
<div class="card-content">
<div class="media block">
<div class="media-left">
<figure class="image is-48x48">
{{if $User.ProfilePhoto.ID}}
<img src="{{PhotoURL $User.ProfilePhoto.CroppedFilename}}">
{{else}}
<img src="/static/img/shy.png">
{{end}}
</figure>
</div>
<div class="media-content">
<p class="title is-4">{{$User.NameOrUsername}}</p>
<p class="subtitle is-6">
<span class="icon"><i class="fa fa-user"></i></span>
<a href="/u/{{$User.Username}}" target="_blank">{{$User.Username}}</a>
</p>
</div>
</div>
<div class="block">
<div class="columns">
<div class="column is-narrow">
<strong>Status:</strong>
</div>
<div class="column">
{{if eq .Status "pending"}}
<strong class="has-text-warning">Pending Approval</strong>
{{else if eq .Status "approved"}}
<strong class="has-text-success">Approved</strong>
{{else if eq .Status "rejected"}}
<strong class="has-text-danger">Rejected</strong>
{{else}}
<strong>{{.Status}}</strong>
{{end}}
</div>
</div>
</div>
<div class="field">
<textarea class="textarea" name="comment"
cols="60" rows="2"
placeholder="Admin comment (for rejection)">{{.AdminComment}}</textarea>
</div>
</div>
<footer class="card-footer">
{{if not (eq .Status "rejected")}}
<button type="submit" name="verdict" value="reject" class="card-footer-item button is-danger">
<span class="icon"><i class="fa fa-xmark"></i></span>
<span>Reject</span>
</button>
{{end}}
{{if not (eq .Status "approved")}}
<button type="submit" name="verdict" value="approve" class="card-footer-item button is-success">
<span class="icon"><i class="fa fa-check"></i></span>
<span>Approve</span>
</button>
{{end}}
</footer>
</div>
</form>
</div>
{{end}}
</div>
</div>
</div>
{{end}}