Compare commits

...

2 commits

Author SHA1 Message Date
Gabriel Simmer b0675e9f56
Also conditionally render for showpaste template
Some checks reported warnings
Nix build / tests (pull_request) Has been cancelled
2023-08-18 08:54:56 +01:00
Gabriel Simmer 020adfd213
Conditionally render profile picture img 2023-08-17 21:24:53 +01:00
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@
<main> <main>
<nav> <nav>
<a href="/">tclip</a>{{if .UserInfo}} - <a href="/paste/list">List</a> - <a href="/help">Help</a>{{end}} <a href="/">tclip</a>{{if .UserInfo}} - <a href="/paste/list">List</a> - <a href="/help">Help</a>{{end}}
{{if .UserInfo}}<div class="right">{{.UserInfo.DisplayName}} <img style="width:32px;height:32px" src="{{.UserInfo.ProfilePicURL}}" /></div>{{end}} {{if .UserInfo}}<div class="right">{{.UserInfo.DisplayName}} {{if .UserInfo.ProfilePicURL}}<img style="width:32px;height:32px" src="{{.UserInfo.ProfilePicURL}}" />{{end}}</div>{{end}}
</nav> </nav>
<h1>{{.Title}}</h1> <h1>{{.Title}}</h1>

View file

@ -4,10 +4,10 @@
{{if .UserInfo}} {{if .UserInfo}}
{{if ne .PasterUserID .UserID}} {{if ne .PasterUserID .UserID}}
<div class="right">{{.PasterDisplayName}} <img style="width:32px;height:32px" src="{{.PasterProfilePicURL}}" /></div> <div class="right">{{.PasterDisplayName}} {{if .PasterProfilePicURL}}<img style="width:32px;height:32px" src="{{.PasterProfilePicURL}}" />{{end}}</div>
{{end}} {{end}}
{{else}} {{else}}
<div class="right">{{.PasterDisplayName}} <img style="width:32px;height:32px" src="{{.PasterProfilePicURL}}" /></div> <div class="right">{{.PasterDisplayName}} {{if .PasterProfilePicURL}}<img style="width:32px;height:32px" src="{{.PasterProfilePicURL}}" />{{end}}</div>
{{end}} {{end}}
<p>Created at {{.CreatedAt}}</p> <p>Created at {{.CreatedAt}}</p>