| 1 | {{ define "impersonation-banner" -}} |
| 2 | {{ with .Viewer }} |
| 3 | {{ if .ImpersonatedUserID }} |
| 4 | <div class="shithub-imp-banner" role="alert"> |
| 5 | <strong>Impersonating</strong> {{ .Username }} (#{{ .ID }}) |
| 6 | · {{ if .ImpersonateWriteOK }}<span class="shithub-imp-write">writes ENABLED</span>{{ else }}<span class="shithub-imp-read">read-only</span>{{ end }} |
| 7 | <form method="POST" action="/admin/impersonate/stop" style="display:inline; margin-left: 0.75rem"> |
| 8 | <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> |
| 9 | <button type="submit" class="shithub-button">Stop impersonation</button> |
| 10 | </form> |
| 11 | </div> |
| 12 | {{ end }} |
| 13 | {{ end }} |
| 14 | {{- end }} |