dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

filedrops.gohtml (2209B)


      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 <form method="post">
     14     <input type="hidden" name="formName" value="createFiledrop" />
     15     <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
     16     <button type="submit" class="btn btn-primary btn-sm">New filedrop</button>
     17 </form>
     18 
     19 <div class="card mb-3">
     20     <div class="card-header">
     21         Filedrop
     22     </div>
     23     <div class="card-body">
     24         <div class="mb-3">{{ .Data.TotalSize | int64bytes }}</div>
     25         <table class="table table-sm table-striped table-hover">
     26             <tr>
     27                 <th>UUID</th>
     28                 <th>File name</th>
     29                 <th>File size</th>
     30                 <th>Created at</th>
     31                 <th class="text-right">Actions</th>
     32             </tr>
     33             {{ range .Data.Filedrops }}
     34                 <tr>
     35                     <td>
     36                         {{ if .FileSize }}
     37                             {{ .UUID }}
     38                         {{ else }}
     39                             <a href="/file-drop/{{ .UUID }}">{{ .UUID }}</a>
     40                         {{ end }}
     41                     </td>
     42                     <td><a href="/admin/file-drop/{{ .FileName }}">{{ .OrigFileName }}</a></td>
     43                     <td>{{ .FileSize | int64bytes }}</td>
     44                     <td>{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</td>
     45                     <td class="text-right">
     46                         <form method="post">
     47                             <input type="hidden" name="formName" value="deleteFiledrop" />
     48                             <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
     49                             <input type="hidden" name="file_name" value="{{ .FileName }}" />
     50                             <button type="submit" class="btn btn-danger btn-sm">×</button>
     51                         </form>
     52                     </td>
     53                 </tr>
     54             {{ else }}
     55                 <tr>
     56                     <td colspan="5"><em>No file to display</em></td>
     57                 </tr>
     58             {{ end }}
     59         </table>
     60     </div>
     61 </div>
     62 
     63 {{ end }}