dkforest

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

links.gohtml (3736B)


      1 {{ define "title" }}dkf - links{{ end }}
      2 
      3 {{ define "content" }}
      4 
      5 <div class="container-fluid mb-5">
      6 
      7     <div class="mb-2">
      8         We try with our utmost diligence and effort to ensure that the archive is free from abuse content,
      9         but sometimes sites change retroactively, if anything degen is found, please notify the staff.
     10     </div>
     11 
     12     <div class="d-flex justify-content-between align-items-center">
     13         <form method="get" action="/links" class="d-inline-block">
     14             <div class="input-group" style="width: 600px;">
     15                 <input type="text" name="search" class="form-control form-control-sm d-inline" value="{{ .Data.Search }}" placeholder="Search" />
     16                 <div class="input-group-append">
     17                     <button class="btn btn-secondary btn-sm">search</button>
     18                 </div>
     19             </div>
     20         </form>
     21         <div class="ml-2">
     22             <a href="/links/download" class="btn btn-sm btn-secondary">Download links</a>
     23             {{ if .AuthUser.IsModerator }}
     24                 <a href="/new-link" class="btn btn-sm btn-secondary"><i class="fa fa-plus fa-fw"></i> New link</a>
     25                 <a href="/links/upload" class="btn btn-sm btn-secondary"><i class="fa fa-plus fa-fw"></i> Batch insert links</a>
     26                 <form action="/links/reindex" method="post" class="d-inline">
     27                     <input type="hidden" name="csrf" value="{{ .CSRF }}" />
     28                     <button type="submit" class="btn btn-sm btn-secondary"><i class="fa fa-refresh fa-fw"></i> Reindex</button>
     29                 </form>
     30             {{ end }}
     31         </div>
     32     </div>
     33 
     34     <div class="border-bottom pb-2 mb-2">
     35         {{ range .Data.Categories }}
     36             <a class="badge badge-pill badge-secondary" href="/links?category={{ .Name }}">{{ .Name }} ({{ .Count }})</a>
     37         {{ end }}
     38         <a class="badge badge-pill badge-secondary" href="/links?category=uncategorized">uncategorized</a>
     39     </div>
     40 
     41     <div>{{ .Data.LinksCount }} results</div>
     42 
     43     <table class="table table-striped table-sm table-novpadding table-hover">
     44         {{ range .Data.Links }}
     45             <tr>
     46                 <td>
     47                     {{ if and $.AuthUser.IsModerator .DeletedAt }}
     48                         <form action="/links/{{ .UUID }}/restore" method="post" class="d-inline">
     49                             <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
     50                             <button type="submit" class="btn btn-danger" role="link" style="padding: 0 3px;" title="restore">&#8635;</button>
     51                         </form>
     52                     {{ end }}
     53                     <a href="/links/{{ .UUID }}">{{ .Title }}</a> - {{ .Description | trunc 100 }}<br />
     54                     <a class="mono" style="color: gray; font-size: 10px;" href="{{ .URL }}" rel="noopener noreferrer" target="_blank">{{ .URL }}</a>
     55                     {{ range $idx, $el := .Mirrors }}
     56                         [<a href="{{ .MirrorURL }}" rel="noopener noreferrer" target="_blank">mirror {{ addInt $idx 1 }}</a>]
     57                     {{ end }}
     58                 </td>
     59             </tr>
     60         {{ else }}
     61             <tr>
     62                 <td><em>No links to display</em></td>
     63             </tr>
     64         {{ end }}
     65     </table>
     66 
     67     {{ if or (gt .Data.CurrentPage 1) (lt .Data.CurrentPage .Data.MaxPage) }}
     68         <div class="mb-5">
     69             <a href="?p={{ add .Data.CurrentPage -1 }}" class="btn btn-light{{ if le .Data.CurrentPage 1 }} disabled{{ end }}">&laquo; {{ t "Prev" . }}</a>
     70             <a href="?p={{ add .Data.CurrentPage 1 }}" class="btn btn-light{{ if eq .Data.CurrentPage .Data.MaxPage }} disabled{{ end }}">{{ t "Next" . }} &raquo;</a>
     71         </div>
     72     {{ end }}
     73 
     74 </div>
     75 {{ end }}