dkforest

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

commit 000b7213de62f662de416f7df29a8c3206c70f5d
parent 438a8aeee2ee624804ea3b8ffba9b21a35562aa6
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat, 28 Jan 2023 12:23:07 -0800

simplify template

Diffstat:
Mpkg/web/public/views/pages/chat-messages.gohtml | 18++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/pkg/web/public/views/pages/chat-messages.gohtml b/pkg/web/public/views/pages/chat-messages.gohtml @@ -261,6 +261,12 @@ <a href="{{ $baseTopBarURL }}?quote={{ .UUID }}{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1" class="date date-link" title="{{ .CreatedAt.Format "01-02 15:04:05" }}">{{ .CreatedAt.Format $.Data.DateFormat }}</a>&nbsp; {{- end -}} <a href="/u/{{ .GetProfile $.AuthUser }}" target="_blank" class="f-def-clr">-</a>&nbsp; + {{ $tagType := "tag" }} + {{- if and $.AuthUser.CanSeeHB (or .IsHellbanned .User.IsHellbanned) -}} + {{ $tagType = "htag" }} + {{- else if and $.AuthUser.IsModerator .Moderators -}} + {{ $tagType = "mtag" }} + {{- end -}} {{- if .ToUserID -}} [ {{- if eq .User.ID $.AuthUser.ID -}} @@ -291,12 +297,6 @@ <span {{ .User.GenerateChatStyle | attr }}>{{ .User.Username }}</span> {{- end -}} {{- else -}} - {{ $tagType := "tag" }} - {{- if and $.AuthUser.CanSeeHB (or .IsHellbanned .User.IsHellbanned) -}} - {{ $tagType = "htag" }} - {{- else if and $.AuthUser.IsModerator .Moderators -}} - {{ $tagType = "mtag" }} - {{- end -}} <a {{ .User.GenerateChatStyle | attr }} href="{{ $baseTopBarURL }}?{{ $tagType }}={{ .User.Username }}{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1">{{ .User.Username }}</a> {{- end -}} &nbsp; @@ -321,12 +321,6 @@ {{ .User.Username }} {{- end -}} {{- else -}} - {{ $tagType := "tag" }} - {{- if and $.AuthUser.CanSeeHB (or .IsHellbanned .User.IsHellbanned) -}} - {{ $tagType = "htag" }} - {{- else if and $.AuthUser.IsModerator .Moderators -}} - {{ $tagType = "mtag" }} - {{- end -}} <a {{ .User.GenerateChatStyle | attr }} href="{{ $baseTopBarURL }}?{{ $tagType }}={{ .User.Username }}{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1">{{ .User.Username }}</a> {{- end }} {{ .TrimMe | safe }}