uploads.gohtml (1931B)
1 {{ define "extra-head" }} 2 <style> 3 .btn-xs { 4 margin: 0 !important; 5 padding: 0 4px !important; 6 font-size: 11px !important; 7 } 8 </style> 9 {{ end }} 10 11 {{ define "sub-content" }} 12 13 <div class="card mb-3"> 14 <div class="card-header"> 15 {{ t "File uploaded" . }} 16 </div> 17 <div class="card-body"> 18 <div class="mb-3">{{ .Data.TotalSize | int64bytes }}</div> 19 <table class="table table-sm table-striped table-hover"> 20 <tr> 21 <th>User</th> 22 <th>File name</th> 23 <th>File size</th> 24 <th class="text-center">Password?</th> 25 <th>Created at</th> 26 <th class="text-right">Actions</th> 27 </tr> 28 {{ range .Data.Uploads }} 29 <tr> 30 <td>{{ .User.Username }}</td> 31 <td><a href="/uploads/{{ .FileName }}">{{ .OrigFileName }}</a></td> 32 <td>{{ .FileSize | int64bytes }}</td> 33 <td class="text-center"> 34 {{ (ne .Password "") | fmtBool }} 35 </td> 36 <td>{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</td> 37 <td class="text-right"> 38 <form method="post"> 39 <input type="hidden" name="formName" value="deleteUpload" /> 40 <input type="hidden" name="csrf" value="{{ $.CSRF }}" /> 41 <input type="hidden" name="file_name" value="{{ .FileName }}" /> 42 <button type="submit" class="btn btn-danger btn-sm">×</button> 43 </form> 44 </td> 45 </tr> 46 {{ else }} 47 <tr> 48 <td colspan="6"><em>No file to display</em></td> 49 </tr> 50 {{ end }} 51 </table> 52 </div> 53 </div> 54 55 {{ end }}