Fixed approval queue

This commit is contained in:
Asaf Gartner 2024-07-06 18:33:50 +03:00
parent a22b44eb07
commit ed41600061
1 changed files with 76 additions and 73 deletions

View File

@ -1,4 +1,4 @@
{{ template "base.html" . }} {{ template "base-2024.html" . }}
{{ define "extrahead" }} {{ define "extrahead" }}
<style> <style>
@ -9,86 +9,89 @@
{{ end }} {{ end }}
{{ define "content" }} {{ define "content" }}
<div> <div class="w-100 flex flex-column items-center pa3">
{{ range .UnapprovedUsers }} <div class="mw-site">
<div class="flex flex-row bg3 mb3 pa2"> {{ range .UnapprovedUsers }}
<div class=" <div class="flex flex-row bg3 mb3 pa2">
sidebar flex-shrink-0 <div class="
flex flex-column items-stretch-l sidebar flex-shrink-0
overflow-hidden flex flex-column items-stretch-l
" style="width: 200px;"> g2
<a class="db" href="{{ .User.ProfileUrl }}">{{ .User.Username }}</a> overflow-hidden
<div>{{ .User.Name }}</div> " style="width: 200px;">
<div class="w-100 flex-shrink-0 flex justify-center"> <a class="db" href="{{ .User.ProfileUrl }}">{{ .User.Username }}</a>
<img class="br3" alt="{{ .User.Name }}'s Avatar" src="{{ .User.AvatarUrl }}"> <div>{{ .User.Name }}</div>
</div> <div class="w-100 flex-shrink-0 flex justify-center">
<div class="mt3 mt0-ns mt3-l ml3-ns ml0-l flex flex-column items-start overflow-hidden"> <img class="br3" alt="{{ .User.Name }}'s Avatar" src="{{ .User.AvatarUrl }}">
{{ with or .User.Bio .User.Blurb }}
<div class="mb3">{{ . }}</div>
{{ end }}
<div class="w-100 w-auto-ns w-100-l">
{{ if .User.Email }}
<div class="pair flex">
<div class="key flex-auto flex-shrink-0 mr2">Email</div>
<div class="value projectlink truncate">{{ .User.Email }}</div>
</div>
{{ end }}
{{ range .UserLinks }}
<div class="pair flex">
<div class="key flex-auto flex-shrink-0 mr2">{{ .Name }}</div>
<div class="value projectlink truncate"><a class="external" href="{{ .Url }}" ><span class="icon-{{ .Icon }}"></span> {{ .LinkText }}</a></div>
</div>
{{ end }}
<div>{{ absoluteshortdate .User.DateJoined }}</div>
</div> </div>
</div> <div class="mt3 mt0-ns mt3-l ml3-ns ml0-l flex flex-column items-start overflow-hidden">
<div> {{ with or .User.Bio .User.Blurb }}
<form method="POST" class="mb2" action="{{ $.SubmitUrl }}"> <div class="mb3">{{ . }}</div>
{{ csrftoken $.Session }}
<input type="hidden" name="action" value="{{ $.ApprovalAction }}" />
<input type="hidden" name="user_id" value="{{ .User.ID }}" />
<input type="submit" class="w-100" value="Approve User" />
</form>
<form method="POST" action="{{ $.SubmitUrl }}">
{{ csrftoken $.Session }}
<input type="hidden" name="action" value="{{ $.SpammerAction }}" />
<input type="hidden" name="user_id" value="{{ .User.ID }}" />
<input type="submit" class="w-100" value="Mark as spammer" />
</form>
</div>
</div>
<div class="flex-grow-1 flex flex-column ml3">
{{ range .ProjectsWithLinks }}
<div class="project-card flex br2 overflow-hidden items-center relative mv3 w-100">
{{ with .Project.Logo }}
<div class="image-container flex-shrink-0">
<div class="image bg-center cover" style="background-image:url({{ . }})"></div>
</div>
{{ end }} {{ end }}
<div class="details pa3 flex-grow-1"> <div class="w-100 w-auto-ns w-100-l">
<h3 class="mb1"><a href="{{ .Project.Url }}">{{ .Project.Name }}</a></h3> {{ if .User.Email }}
<div class="blurb">{{ .Project.Blurb }}</div>
<div class="badges mt2">
{{ if .Project.LifecycleString }}
<span class="badge {{ .Project.LifecycleBadgeClass }}">{{ .Project.LifecycleString }}</span>
{{ end }}
</div>
{{ range .Links }}
<div class="pair flex"> <div class="pair flex">
<div class="key flex-auto flex-shrink-0 mr2">{{ .Name }}</div> <div class="key flex-auto flex-shrink-0 mr2">Email</div>
<div class="value projectlink truncate"><a class="external" href="{{ .Url }}" ><span class="icon-{{ .Icon }}"></span> {{ .LinkText }}</a></div> <div class="value projectlink truncate">{{ .User.Email }}</div>
</div> </div>
{{ end }} {{ end }}
{{ range .UserLinks }}
<div class="pair flex">
<div class="key flex-auto flex-shrink-0 mr2">{{ .Name }}</div>
<div class="value projectlink truncate"><a class="external" href="{{ .Url }}" ><span class="icon-{{ .Icon }}"></span> {{ .ServiceName }}</a></div>
</div>
{{ end }}
<div>{{ absoluteshortdate .User.DateJoined }}</div>
</div> </div>
</div> </div>
{{ end }} <div class="flex flex-column g3">
{{ range .Timeline }} <form class="hmn-form" method="POST" class="mb2" action="{{ $.SubmitUrl }}">
{{ template "timeline_item.html" . }} {{ csrftoken $.Session }}
{{ end }} <input type="hidden" name="action" value="{{ $.ApprovalAction }}" />
<input type="hidden" name="user_id" value="{{ .User.ID }}" />
<input type="submit" class="w-100 btn-primary" value="Approve User" />
</form>
<form class="hmn-form" method="POST" action="{{ $.SubmitUrl }}">
{{ csrftoken $.Session }}
<input type="hidden" name="action" value="{{ $.SpammerAction }}" />
<input type="hidden" name="user_id" value="{{ .User.ID }}" />
<input type="submit" class="w-100 btn-primary" value="Mark as spammer" />
</form>
</div>
</div>
<div class="flex-grow-1 flex flex-column ml3 g2">
{{ range .ProjectsWithLinks }}
<div class="project-card flex br2 overflow-hidden items-center relative mv3 w-100">
{{ with .Project.Logo }}
<div class="image-container flex-shrink-0">
<div class="image bg-center cover" style="background-image:url({{ . }})"></div>
</div>
{{ end }}
<div class="details pa3 flex-grow-1">
<h3 class="mb1"><a href="{{ .Project.Url }}">{{ .Project.Name }}</a></h3>
<div class="blurb">{{ .Project.Blurb }}</div>
<div class="badges mt2">
{{ if .Project.LifecycleString }}
<span class="badge {{ .Project.LifecycleBadgeClass }}">{{ .Project.LifecycleString }}</span>
{{ end }}
</div>
{{ range .Links }}
<div class="pair flex">
<div class="key flex-auto flex-shrink-0 mr2">{{ .Name }}</div>
<div class="value projectlink truncate"><a class="external" href="{{ .Url }}" ><span class="icon-{{ .Icon }}"></span> {{ .LinkText }}</a></div>
</div>
{{ end }}
</div>
</div>
{{ end }}
{{ range .Timeline }}
{{ template "timeline_item.html" . }}
{{ end }}
</div>
</div> </div>
</div> {{ end }}
{{ end }} </div>
</div> </div>
{{ end }} {{ end }}