downloads.gohtml (1453B)
1 {{ define "sub-content" }} 2 <h2>{{ .Data.DownloadsCount | comma }} Downloads</h2> 3 <table class="table table-striped table-hover table-novpadding table-sm"> 4 <thead> 5 <tr> 6 <th>File</th> 7 <th>User</th> 8 <th>Created at</th> 9 <th class="text-right" style="width: 70px;">Actions</th> 10 </tr> 11 </thead> 12 <tbody> 13 {{ range .Data.Downloads }} 14 <tr> 15 <td>{{ .Filename }}</td> 16 <td> 17 <a href="?u={{ .UserID }}">{{ .User.Username }}</a> 18 </td> 19 <td>{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</td> 20 <td class="text-right"> 21 <form class="d-inline" action="/admin/downloads/{{ .ID }}/delete" method="post"> 22 <input type="hidden" name="csrf" value="{{ $.CSRF }}" /> 23 <button type="submit" class="btn btn-danger btn-sm" title="Delete">X</button> 24 </form> 25 </td> 26 </tr> 27 {{ else }} 28 <tr> 29 <td colspan="2"><em>No downloads to display</em></td> 30 </tr> 31 {{ end }} 32 </tbody> 33 </table> 34 35 <div class="mb-5"> 36 <a href="?p={{ add .Data.CurrentPage -1 }}" class="btn btn-light{{ if le .Data.CurrentPage 1 }} disabled{{ end }}">« {{ t "Prev" . }}</a> 37 <a href="?p={{ add .Data.CurrentPage 1 }}" class="btn btn-light{{ if eq .Data.CurrentPage .Data.MaxPage }} disabled{{ end }}">{{ t "Next" . }} »</a> 38 </div> 39 {{ end }}