dkforest

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

gist.gohtml (1028B)


      1 {{ define "content" }}
      2 
      3 <div class="container">
      4     <div>
      5 
      6         <h3>
      7             {{ .Data.Gist.Name }}
      8             {{ if $.AuthUser }}
      9                 {{ if or (eq $.AuthUser.ID .Data.Gist.UserID) $.AuthUser.IsAdmin }}
     10                     <a href="/admin/gists/{{ $.Data.Gist.UUID }}/edit" class="btn btn-sm btn-secondary">Edit</a>
     11                 {{ end }}
     12             {{ end }}
     13             {{ if .Data.Gist.Password }}
     14                 <form method="post" style="display: inline-block">
     15                     <input type="hidden" name="csrf" value="{{ .CSRF }}" />
     16                     <button type="submit" value="logout" name="btn_submit" id="logout_btn" class="btn btn-sm btn-secondary">{{ t "Logout" . }}</button>
     17                 </form>
     18             {{ end }}
     19         </h3>
     20 
     21         {{ if .Data.Highlighted }}
     22             {{ .Data.Highlighted | safe }}
     23         {{ else }}
     24             <pre><code>{{ .Data.Gist.Content }}</code></pre>
     25         {{ end }}
     26 
     27         <div style="height: 100px;"></div>
     28     </div>
     29 </div>
     30 
     31 {{ end }}