dkforest

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

link.gohtml (3417B)


      1 {{ define "title" }}dkf - link - {{ .Data.Link.Title }}{{ end }}
      2 
      3 {{ define "content" }}
      4 <div class="container-fluid mb-5">
      5 
      6     <nav aria-label="breadcrumb">
      7         <ol class="breadcrumb">
      8             <li class="breadcrumb-item"><a href="/links">Links</a></li>
      9             <li class="breadcrumb-item active">{{ .Data.Link.Title }}</li>
     10         </ol>
     11     </nav>
     12 
     13     <div class="container-fluid">
     14         <div class="pb-2 mb-4 border-bottom d-flex justify-content-between align-items-center">
     15             <h2>{{ .Data.Link.Title }}</h2>
     16             <div>
     17                 {{ if .AuthUser.IsModerator }}
     18                     <a href="/links/{{ .Data.Link.UUID }}/edit" class="btn btn-secondary ml-1">Edit</a>
     19                     <a href="/links/{{ .Data.Link.UUID }}/delete" class="btn btn-secondary ml-1">Delete</a>
     20                 {{ end }}
     21             </div>
     22         </div>
     23 
     24         <strong>Owner:</strong>
     25         {{ if .Data.Link.OwnerUserID }}
     26             <a href="/u/{{ .Data.Link.OwnerUser.Username }}" {{ .Data.Link.OwnerUser.GenerateChatStyle | attr }}>@{{ .Data.Link.OwnerUser.Username }}</a>
     27             (
     28                 <a href="/links/{{ .Data.Link.UUID }}/claim-certificate">certificate</a>
     29                 {{ if eq .AuthUser.ID (.Data.Link.OwnerUserID | derefUserID) }}
     30                     | <a href="/links/{{ .Data.Link.UUID }}/claim">re-sign</a>
     31                 {{ end }}
     32             )
     33         {{ else }}
     34             <a href="/links/{{ .Data.Link.UUID }}/claim">claim ownership</a>
     35         {{ end }}<br />
     36         <strong>Created at:</strong> {{ .Data.Link.CreatedAt.Format "Jan 02, 2006 15:04:05" }}<br />
     37         <strong>Link:</strong> <a href="{{ .Data.Link.URL }}" rel="noopener noreferrer" target="_blank">{{ .Data.Link.URL }}</a><br />
     38         <strong>Description:</strong><br />
     39         {{ .Data.Link.DescriptionSafe | n2br | safe }}<br />
     40 
     41         {{ if .Data.Mirrors }}
     42             <hr />
     43             <h3>Mirrors</h3>
     44             <div>
     45                 {{ range .Data.Mirrors }}
     46                     <div><a href="{{ .MirrorURL }}" rel="noopener noreferrer" target="_blank">{{ .MirrorURL }}</a></div>
     47                 {{ end }}
     48             </div>
     49         {{ end }}
     50 
     51         {{ if .Data.PgpKeys }}
     52             <hr />
     53 
     54             <h3>Public keys</h3>
     55             {{ range .Data.PgpKeys }}
     56                 <div class="mb-3 pb-4" style="border-bottom: 1px solid #424242;">
     57                     <div class="float-right">
     58                         <form method="post" action="/api/v1/pgp/{{ .ID }}/download">
     59                             <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
     60                             <button class="btn btn-secondary">Download .asc</button>
     61                         </form>
     62                     </div>
     63                     <div>Title: <strong>{{ .Title }}</strong> | <small style="color: #82e17f;">{{ .GetKeyID }}</small></div>
     64                     {{ if .Description }}<div>Description: {{ .Description }}</div>{{ end }}
     65                     <div>Fingerprint: <span style="color: #82e17f;">{{ .GetKeyFingerprint }}</span></div>
     66                     <div>
     67                         <textarea id="pgpPublicKey" rows="10" class="form-control mono" readonly style="max-width: 650px; white-space: pre; overflow-wrap: normal;">{{ .PgpPublicKey }}</textarea>
     68                     </div>
     69                 </div>
     70             {{ end }}
     71         {{ end }}
     72     </div>
     73 
     74 </div>
     75 {{ end }}