| 1 | {{ define "page" -}} |
| 2 | <div class="shithub-settings-page"> |
| 3 | {{ template "admin-nav" . }} |
| 4 | <div class="shithub-settings-content"> |
| 5 | <h1>{{ .Repo.Name }} <span class="shithub-fg-muted">#{{ .Repo.ID }}</span></h1> |
| 6 | {{ with .Notice }}<p class="shithub-flash shithub-flash-notice">{{ . }}</p>{{ end }} |
| 7 | |
| 8 | <section class="shithub-settings-section"> |
| 9 | <h2>Details</h2> |
| 10 | <ul> |
| 11 | <li>Visibility: <code>{{ .Repo.Visibility }}</code></li> |
| 12 | <li>Default branch: <code>{{ .Repo.DefaultBranch }}</code></li> |
| 13 | <li>Disk used: {{ .Repo.DiskUsedBytes }} bytes</li> |
| 14 | <li>Stars: {{ .Repo.StarCount }} · Watchers: {{ .Repo.WatcherCount }} · Forks: {{ .Repo.ForkCount }}</li> |
| 15 | <li>Created: {{ relativeTime .Repo.CreatedAt.Time }}</li> |
| 16 | {{ if .Repo.IsArchived }}<li>Archived {{ relativeTime .Repo.ArchivedAt.Time }}</li>{{ end }} |
| 17 | {{ if .Repo.DeletedAt.Valid }}<li>Soft-deleted {{ relativeTime .Repo.DeletedAt.Time }}</li>{{ end }} |
| 18 | </ul> |
| 19 | </section> |
| 20 | |
| 21 | <section class="shithub-settings-section"> |
| 22 | <h2>Force actions</h2> |
| 23 | <p class="shithub-hint">These bypass owner consent. Use only for emergency takedown / abuse response.</p> |
| 24 | {{ if .Repo.IsArchived }} |
| 25 | <form method="POST" action="/admin/repos/{{ .Repo.ID }}/unarchive" style="display:inline"> |
| 26 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 27 | <button type="submit" class="shithub-button">Force-unarchive</button> |
| 28 | </form> |
| 29 | {{ else }} |
| 30 | <form method="POST" action="/admin/repos/{{ .Repo.ID }}/archive" style="display:inline"> |
| 31 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 32 | <button type="submit" class="shithub-button">Force-archive</button> |
| 33 | </form> |
| 34 | {{ end }} |
| 35 | |
| 36 | <form method="POST" action="/admin/repos/{{ .Repo.ID }}/delete"> |
| 37 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 38 | <label>Type <code>{{ .Repo.Name }}</code> to confirm |
| 39 | <input type="text" name="confirm" required></label> |
| 40 | <button type="submit" class="shithub-button shithub-button-danger">Force-delete (skip grace)</button> |
| 41 | </form> |
| 42 | </section> |
| 43 | </div> |
| 44 | </div> |
| 45 | {{- end }} |