dkforest

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

gists.gohtml (1274B)


      1 {{ define "sub-content" }}
      2 <div class="pb-2 mt-4 mb-4 border-bottom">
      3     <div class="float-right">
      4         <a href="/admin/gists/new" class="btn btn-success">
      5             <i class="fa fa-plus fa-fw"></i> New gist
      6         </a>
      7     </div>
      8     <h2>{{ .Data.GistsCount | comma }} Gists</h2>
      9 </div>
     10 
     11 <table class="table table-striped table-hover table-novpadding table-sm">
     12     <thead>
     13     <tr>
     14         <th>Name</th>
     15         <th>User</th>
     16         <th>Created at</th>
     17     </tr>
     18     </thead>
     19     <tbody>
     20     {{ range .Data.Gists }}
     21         <tr>
     22             <td><a href="/gists/{{ .UUID }}">{{ .Name }}</a></td>
     23             <td>
     24                 <a href="?u={{ .UserID }}">{{ .User.Username }}</a>
     25             </td>
     26             <td>{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</td>
     27         </tr>
     28     {{ else }}
     29         <tr>
     30             <td colspan="3"><em>No gists to display</em></td>
     31         </tr>
     32     {{ end }}
     33     </tbody>
     34 </table>
     35 
     36 <div class="mb-5">
     37     <a href="?p={{ add .Data.CurrentPage -1 }}" class="btn btn-light{{ if le .Data.CurrentPage 1 }} disabled{{ end }}">&laquo; {{ t "Prev" . }}</a>
     38     <a href="?p={{ add .Data.CurrentPage 1 }}" class="btn btn-light{{ if eq .Data.CurrentPage .Data.MaxPage }} disabled{{ end }}">{{ t "Next" . }} &raquo;</a>
     39 </div>
     40 {{ end }}