Add template file for previous commit

This commit is contained in:
Alessio 2024-05-03 15:26:30 -07:00
parent 62500d69dd
commit 47dbd4fe42
2 changed files with 22 additions and 2 deletions

View File

@ -0,0 +1,22 @@
{{/*
Equivalent of an "author info", but for chats; could be an author info or a group-chat.
*/}}
{{define "chat-profile-image"}}
{{if (eq .Type "ONE_TO_ONE")}}
{{range .Participants}}
{{if (ne .UserID (active_user).ID)}}
<!-- This is some fuckery; I have no idea why "hx-target" is needed, but otherwise it targets the #chat-view. -->
<div class="click-eater" hx-trigger="click consume" hx-target="body">
{{template "author-info" (user .UserID)}}
</div>
{{end}}
{{end}}
{{else}}
<div class="groupchat-info row">
{{template "circle-profile-img-no-link" (dict "IsContentDownloaded" false "ProfileImageUrl" .AvatarImageRemoteURL)}}
<div class="click-eater" hx-trigger="click consume" hx-target="body">
<div class="groupchat-info__display-name">{{.Name}}</div>
</div>
</div>
{{end}}
{{end}}

View File

@ -549,8 +549,6 @@ func (p Profile) NextDMPage(c DMCursor) DMChatView {
` + c.SortOrder.OrderByClause() + ` ` + c.SortOrder.OrderByClause() + `
limit ? limit ?
` `
fmt.Printf("query: %s\n", q)
fmt.Printf("Bind values: %#v\n", bind_values)
err := p.DB.Select(&msgs, q, bind_values...) err := p.DB.Select(&msgs, q, bind_values...)
if err != nil { if err != nil {