commit 0b74330697d0cf8256da5ff4a50a4e2753a0b218
parent 77da77fc240521b1ad771b98d64545d8e7ded8a0
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 21 May 2023 21:47:28 -0700
remove deprecated template
Diffstat:
1 file changed, 0 insertions(+), 433 deletions(-)
diff --git a/pkg/web/public/views/pages/chat-messages.gohtml b/pkg/web/public/views/pages/chat-messages.gohtml
@@ -1,432 +0,0 @@
-{{ define "base" }}
-<html lang="en">
- <head>
- <title></title>
- {{- if and (not .Data.PreventRefresh) (not .Data.ForceManualRefresh) -}}<meta http-equiv="refresh" content="{{ .AuthUser.RefreshRate }}">{{- end -}}
- {{- if .AuthUser.CollectMetadata -}}<link rel="stylesheet" type="text/css" href="/public/css/meta.css?v={{ .VERSION }}" />{{- end -}}
- <style>
- /* http://meyerweb.com/eric/tools/css/reset/
- v2.0 | 20110126
- License: none (public domain)
- */
- html, body, div, span, applet, object, iframe,
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
- a, abbr, acronym, address, big, cite, code,
- del, dfn, em, img, ins, kbd, q, s, samp,
- small, strike, strong, sub, sup, tt, var,
- b, u, i, center,
- dl, dt, dd, ol, ul, li,
- fieldset, form, label, legend,
- table, caption, tbody, tfoot, thead, tr, th, td,
- article, aside, canvas, details, embed,
- figure, figcaption, footer, header, hgroup,
- menu, nav, output, ruby, section, summary,
- time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
- }
- /* HTML5 display-role reset for older browsers */
- article, aside, details, figcaption, figure,
- footer, header, hgroup, menu, nav, section {
- display: block;
- }
- body {
- line-height: 1;
- }
- ol, ul {
- list-style: none;
- }
- blockquote, q {
- quotes: none;
- }
- blockquote:before, blockquote:after,
- q:before, q:after {
- content: '';
- content: none;
- }
- table {
- border-collapse: collapse;
- border-spacing: 0;
- }
- /* --- end --- */
-
-
- i { font-style: italic; }
-
- /* Remove button padding in FF */
- button::-moz-focus-inner {
- border:0;
- padding:0;
- }
-
- body { font-family: Lato,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; }
- a { color: #00bc8c; text-decoration: none; }
- a:hover { color: #007053; text-decoration: underline; }
- .unread_room { color: #2392da; text-decoration: none; }
- .unread_room:hover { color: #004970; text-decoration: underline; }
- .emoji {
- font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort;
- font-size: 17px;
- }
- .mod-btn {
- width: 16px; height: 16px;
- margin: 0; padding: 0;
- border: 1px solid gray;
- display: inline;
- text-align: center;
- vertical-align: middle;
- user-select: none;
- background-color: #444;
- color: #ea2a2a;
- -webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.25);
- -moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.25);
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- }
- .mod-btn:hover {
- background-color: #222;
- }
- .delete_msg_btn {
- font-size: 15px;
- line-height: 1;
- }
- .delete_msg_btn::after { content: "×"; }
- .hb_btn {
- font-size: 10px;
- line-height: 1.4;
- }
- .hb_btn::after { content: "hb"; }
- .k_btn {
- font-size: 10px;
- line-height: 1.4;
- }
- .k_btn::after { content: "k"; }
- #manualrefresh {
- {{ if not .Data.ForceManualRefresh }}
- top: -200%;
- animation: timeout_messages {{ .Data.ManualRefreshTimeout }}s forwards;
- {{ end }}
- color: #bf2718;
- display: block;
- position: fixed;
- text-align: center;
- left: calc(50% - 200px);
- width: 400px;
- z-index: 2;
- background-color: #500000;
- border: 2px solid #ff0000;
- }
- @keyframes timeout_messages {
- 0% { top: -200%; }
- 99% { top: -200%; }
- 100% { top: 0; }
- }
- .date { color: #999; font-family: 'Courier New', Courier, monospace; font-size: 14px; }
- .date-link:hover { color: #999; text-decoration: underline; }
- .sysmsg { color: #fff; font-family: 'Courier New', Courier, monospace; font-size: 14px; }
- small { font-size: 80%; font-weight: 400; }
- .msg { padding: 3px 0 3px 8px; border-bottom: 1px solid #444; color: #888; position: relative; }
- .msg p:first-of-type { display: inline; }
- strong { font-weight: bold; }
- em { font-style: italic; }
- pre { border: 1px solid #2b442b; padding: 2px; margin: 2px 0; max-height: 300px; overflow: auto; background-color: rgba(39,40,34,0.6) !important;
- font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; }
- code { border: 1px solid #2b442b; color: #f92672; padding: 0 2px; margin: 0px 0; background-color: rgba(39,40,34,0.6) !important; }
- .censored { background-color: black; color: black; padding: 0 3px; }
- .censored:hover { background-color: black; color: white; }
- ul { list-style-type: disc; margin: 0 0 0 15px; }
- * {
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- .afk-indicator { color: #ff9a27; }
- .spacer16 { display: inline-block; width: 16px; }
- .spacer36 { display: inline-block; width: 36px; }
- .spacer56 { display: inline-block; width: 56px; }
- .d-inline { display: inline; }
- .o-wrap { overflow-wrap: break-word; }
- .f-def-clr { color: #888; }
- .f-orange-clr { color: orange; }
- .f-white-clr, .f-white-clr:hover { color: white; }
- .line-through { text-decoration: line-through; }
- .hb-row { background-color: rgba(0, 0, 0, 0.7); opacity: {{ $.AuthUser.GetHellbanOpacityF64 }}; }
- .own-highlight { background-color: rgba(255,241,176,0.05); }
- .read-marker { border-top: {{ $.AuthUser.ChatReadMarkerSize }}px solid {{ $.AuthUser.ChatReadMarkerColor }}; }
- #msgs { {{ if not .AuthUser.HideRightColumn }}width: calc(100% - 170px); float: left; {{ end }}line-height: 1.2; }
- #no-msg { padding-left: 10px; color: #ddd; }
- #rgt-pane { width: 150px; height: 100%; float: left; margin-left: 20px; position: fixed; right: 0; overflow-y: auto; line-height: 1.15; }
- .rgt-title { font-weight: bolder; color: #ced4da; }
- .mb-20px { margin-bottom: 20px; }
- .mb-30px { margin-bottom: 30px; }
- .mt-5px { margin-top: 5px; }
- .mt-10px { margin-top: 10px; }
- .notif, .notif:hover { color: #e74c3c; }
- #msg-err { background-color: #8f2d2d; color: #ffffff; padding: 1px 5px 2px 5px; display: block; text-decoration: none; }
- </style>
- </head>
- <body>
-
- {{ if .Data.ForceManualRefresh }}
- <div id="manualrefresh">
- <h4>Manual refresh required</h4>
- <form method="get" action="/chat/{{ $.Data.RoomName }}" target="_top">
- <input type="submit" value="Reload" />
- </form>
- </div>
- {{ else if not .Data.PreventRefresh }}
- <div id="manualrefresh">
- <h4>Manual refresh required</h4>
- <form method="get">
- <input type="submit" value="Reload" />
- </form>
- </div>
- {{ end }}
-
- {{- if .Data.Error -}}
- <a href="/api/v1/chat/messages/{{ .Data.RoomName }}" id="msg-err">× {{ .Data.Error }}</a>
- {{- end -}}
-
- {{ if or .Data.PmSound .Data.TaggedSound }}
- <audio src="/public/mp3/sound5.mp3" autoplay></audio>
- {{ else if .Data.NewMessageSound }}
- <audio src="/public/mp3/sound6.mp3" autoplay></audio>
- {{ end }}
-
- <div id="msgs">
- {{ $baseTopBarURL := (print "/api/v1/chat/top-bar/" $.Data.RoomName) }}
- {{ $readMarkerRendered := false }}
- {{ $isFirstMsg := true }}
- {{ range $idx, $e := .Data.Messages }}
- {{- if (.UserCanSee $.AuthUser) -}}
- <div id="msgid-{{ .UUID }}" class="msg
- {{- if and (or .User.IsHellbanned .IsHellbanned) $.AuthUser.DisplayHellbanned }} hb-row
- {{- else if and (eq $.AuthUser.ID .User.ID) $.AuthUser.HighlightOwnMessages }} own-highlight{{- end -}}
- {{- if and $.AuthUser.ChatReadMarkerEnabled (.CreatedAt.Before $.Data.ReadMarker.ReadAt) (not $readMarkerRendered) -}}
- {{- if gt $idx 0 }} read-marker{{- end -}}
- {{ $readMarkerRendered = true }}
- {{- end -}}
- ">
- {{- if (.UserCanDelete $.AuthUser) -}}
- {{- if not .TooOldToDelete -}}
- {{- if $.AuthUser.DisplayDeleteButton -}}
- <form method="post" action="/api/v1/chat/messages/delete/{{ .UUID }}" class="d-inline">
- <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
- <button class="mod-btn delete_msg_btn" title="delete"></button>
- </form>
- {{- end -}}
- {{- else if or (and $.AuthUser.IsModerator .TooOldToDelete (ne .UserID $.AuthUser.ID)) $.AuthUser.IsAdmin (and .Room.OwnerUserID (eq (derefUserID .Room.OwnerUserID) $.AuthUser.ID)) -}}
- {{- if $.AuthUser.DisplayDeleteButton -}}
- <form method="post" action="/api/v1/chat/messages/delete/{{ .UUID }}" class="d-inline">
- <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
- <button class="mod-btn delete_msg_btn f-orange-clr" title="delete"></button>
- </form>
- {{- end -}}
- {{- else if $.AuthUser.IsModerator }}
- {{- if $.AuthUser.DisplayDeleteButton -}}
- <div class="spacer16"></div>
- {{- end -}}
- {{- else -}}
- {{- if $.AuthUser.DisplayDeleteButton -}}
- <div class="spacer16"></div>
- {{- end -}}
- {{- end -}}
- {{- if $.AuthUser.IsModerator -}}
- {{- if ne .UserID $.AuthUser.ID -}}
- {{- if $.AuthUser.DisplayHellbanButton -}}
- {{- if eq .User.Username $.NullUsername -}}
- <div class="spacer16"></div>
- {{- else -}}
- {{- if .User.IsHellbanned -}}
- <form method="post" action="/api/v1/users/{{ .UserID }}/unhellban" class="d-inline">
- <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
- <button class="mod-btn hb_btn f-orange-clr line-through" title="unhellban"></button>
- </form>
- {{- else -}}
- <form method="post" action="/api/v1/users/{{ .UserID }}/hellban" class="d-inline">
- <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
- <button class="mod-btn hb_btn f-orange-clr" title="hellban"></button>
- </form>
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- if $.AuthUser.DisplayKickButton -}}
- <form method="post" action="/api/v1/users/{{ .UserID }}/kick" class="d-inline">
- <input type="hidden" name="csrf" value="{{ $.CSRF }}" />
- <button class="mod-btn k_btn f-orange-clr" title="kick"></button>
- </form>
- {{- end -}}
- {{- else -}}
- {{- if and $.AuthUser.DisplayKickButton $.AuthUser.DisplayHellbanButton -}}
- <div class="spacer36"></div>
- {{- else if or $.AuthUser.DisplayKickButton $.AuthUser.DisplayHellbanButton -}}
- <div class="spacer16"></div>
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- else -}}
- {{- if eq $.Data.NbButtons 3 -}}
- <div class="spacer56"></div>
- {{- else if eq $.Data.NbButtons 2 -}}
- <div class="spacer36"></div>
- {{- else if eq $.Data.NbButtons 1 -}}
- <div class="spacer16"></div>
- {{- end -}}
- {{- end -}}
- {{- if ne $.Data.DateFormat "" -}}
- <a href="{{ $baseTopBarURL }}?quote={{ .UUID }}{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1" class="date date-link" title="{{ .CreatedAt.Format "01-02 15:04:05" }}{{ if $isFirstMsg }} ({{ .CreatedAt | since }}){{ end }}">{{ .CreatedAt.Format $.Data.DateFormat }}</a>
- {{- $isFirstMsg = false -}}
- {{- end -}}
- <a href="/u/{{ .GetProfile $.AuthUser }}" target="_blank" class="f-def-clr">-</a>
- {{- if .System -}}
- <span class="sysmsg">{{ .Message | safe }}</span>
- {{- else -}}
- {{- if .Moderators -}}<span class="sysmsg">[<a href="{{ $baseTopBarURL }}?m=1{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1" class="sysmsg f-white-clr">M</a>]</span> {{- end -}}
- {{- if .GroupID -}}<span class="sysmsg">[<a href="{{ $baseTopBarURL }}?g={{ .Group.Name }}{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1" class="sysmsg f-white-clr">{{ .Group.Name }}</a>]</span> {{- end -}}
- {{- if .ToUserID -}}
- [
- {{- template "from-username" dict "Parent" $ "El" . "baseTopBarURL" $baseTopBarURL "CanBeEdited" .CanBeEdited "GenerateChatStyle" .User.GenerateChatStyle -}}
- →
- {{- if eq .ToUser.ID $.AuthUser.ID -}}
- <span {{ .ToUser.GenerateChatStyle | attr }}>{{ .ToUser.Username }}</span>
- {{- else -}}
- <a {{ .ToUser.GenerateChatStyle | attr }} href="{{ $baseTopBarURL }}?pm={{ .ToUser.Username }}{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1">{{ .ToUser.Username }}</a>
- {{- end -}}
- ] -
- {{- else -}}
- {{- template "from-username" dict "Parent" $ "El" . "baseTopBarURL" $baseTopBarURL "CanBeEdited" .CanBeEdited "GenerateChatStyle" .User.GenerateChatStyle -}}
- {{- if not .IsMe -}}
-
- {{- if and $.AuthUser.CanSeeHB (or .IsHellbanned .User.IsHellbanned) (not .ToUserID) -}}
- <a href="{{ $baseTopBarURL }}?hbm=1{{ $.Data.TopBarQueryParams | safeURL }}" target="iframe1" class="f-def-clr">-</a>
- {{- else -}}
- -
- {{- end -}}
- {{- end -}}
- {{- end -}}
- <span {{ .User.GenerateChatStyle | attr }}><span class="o-wrap">{{ .MsgToDisplay | safe }}</span></span>
- {{- end -}}
- </div>
- {{- end -}}
- {{- else -}}
- <div id="no-msg"><em>No message yet</em></div>
- {{- end -}}
- </div>
- {{- if not .AuthUser.HideRightColumn -}}
- <div id="rgt-pane">
- <div class="mb-20px">
- <div class="rgt-title">Inbox (<a href="/settings/inbox" target="_top"{{ if gt .Data.InboxCount 0 }}class="notif"{{ end }}>{{ .Data.InboxCount }}</a>)</div>
- </div>
- <div class="mb-20px">
- <div class="rgt-title">Rooms:</div>
- {{- range .Data.OfficialRooms -}}
- {{- if eq .Name "club" -}}
- {{- if $.AuthUser.IsClubMember -}}
- <div><a href="/chat/club" target="_top"{{ if .IsUnread }} class="unread_room"{{ end }}>#club</a></div>
- {{- end -}}
- {{- else if eq .Name "moderators" -}}
- {{- if $.AuthUser.IsModerator -}}
- <div><a href="/chat/moderators" target="_top"{{ if .IsUnread }} class="unread_room"{{ end }}>#moderators</a></div>
- {{- end -}}
- {{- else -}}
- <div><a href="/chat/{{ .Name }}" target="_top"{{ if .IsUnread }} class="unread_room"{{ end }}>#{{ .Name }}</a></div>
- {{- end -}}
- {{- end -}}
-
- {{- if .Data.SubscribedRooms -}}
- <div class="mt-10px"></div>
- {{ range .Data.SubscribedRooms }}
- <div><a href="/chat/{{ .Name }}" target="_top"{{ if .IsUnread }} class="unread_room"{{ end }}>#{{ .Name }}</a></div>
- {{ end }}
- {{- end -}}
-
- <div class="mt-5px"><a href="/rooms" target="_top">[...]</a></div>
- </div>
- <div class="mb-20px">
- <div class="rgt-title">In this room:</div>
- {{- range .Data.Members -}}
- {{ template "member" dict "Parent" $ "El" . }}
- {{- end -}}
- </div>
- {{- if or .Data.VisibleMemberInChat $.AuthUser.DisplayHellbanned -}}
- <div class="mb-30px">
- {{- if .Data.MembersInChat -}}
- <div class="rgt-title">In other rooms:</div>
- {{- range .Data.MembersInChat -}}
- {{ template "member" dict "Parent" $ "El" . }}
- {{- end -}}
- {{- end -}}
- </div>
- {{- end -}}
- </div>
- {{- end -}}
-
- {{- if .AuthUser.CollectMetadata -}}
- <div class="div_1"></div>
- <div class="div_2"></div>
- <div class="div_f0">a</div>
- {{- end -}}
- </body>
-</html>
-{{ end }}
-
-{{- define "from-username" -}}
- {{ $tagType := "tag" }}
- {{- if .El.ToUserID -}}
- {{ $tagType = "pm" }}
- {{- else if and .Parent.AuthUser.CanSeeHB (or .El.IsHellbanned .El.User.IsHellbanned) -}}
- {{ $tagType = "htag" }}
- {{- else if and .Parent.AuthUser.IsModerator .El.Moderators -}}
- {{ $tagType = "mtag" }}
- {{- end -}}
- {{- if eq .El.User.ID .Parent.AuthUser.ID -}}
- {{- if .CanBeEdited -}}
- <a {{ .GenerateChatStyle | attr }} href="{{ .baseTopBarURL }}?e={{ .El.CreatedAt.Format "15:04:05" }}{{ .Parent.Data.TopBarQueryParams | safeURL }}" target="iframe1">{{ .El.User.Username }}</a>
- {{- else -}}
- <span {{ .GenerateChatStyle | attr }}>{{ .El.User.Username }}</span>
- {{- end -}}
- {{- else -}}
- <a {{ .GenerateChatStyle | attr }} href="{{ .baseTopBarURL }}?{{ $tagType }}={{ .El.User.Username }}{{ .Parent.Data.TopBarQueryParams | safeURL }}" target="iframe1">{{ .El.User.Username }}</a>
- {{- end -}}
-{{- end -}}
-
-{{ define "member" }}
- {{ $baseTopBarURL := (print "/api/v1/chat/top-bar/" $.Parent.Data.RoomName) }}
- {{- if eq .El.Username .Parent.AuthUser.Username -}}
- <div>
- <span style="color: {{ .El.Color }};">{{ .El.Username }}</span>
- {{ if .El.AfkIndicatorEnabled -}}
- <small class="afk-indicator">afk</small>
- {{- end -}}
- </div>
- {{- else -}}
- {{- if or (not .El.IsHellbanned) (eq .Parent.AuthUser.ID .El.UserID) (and .El.IsHellbanned .Parent.AuthUser.IsHellbanned) .Parent.AuthUser.DisplayHellbanned -}}
- <div>
- {{ $tagType := "tag" }}
- {{- if and $.Parent.AuthUser.CanSeeHB .El.IsHellbanned -}}
- {{ $tagType = "htag" }}
- {{- end -}}
- <a href="{{ $baseTopBarURL }}?{{ $tagType }}={{ .El.Username }}{{ .Parent.Data.TopBarQueryParams | safeURL }}"
- target="iframe1"
- {{ if and (.El.IsHellbanned) .Parent.AuthUser.DisplayHellbanned }}class="hb-row"{{ end }}
- style="color: {{ .El.Color }};">{{ .El.Username | first }}</a>
- {{- /* hack to remove spaces between links */ -}}
- <a href="{{ $baseTopBarURL }}?pm={{ .El.Username }}{{ .Parent.Data.TopBarQueryParams | safeURL }}"
- target="iframe1"
- {{ if and (.El.IsHellbanned) .Parent.AuthUser.DisplayHellbanned }}class="hb-row"{{ end }}
- style="color: {{ .El.Color }};">{{ .El.Username | middle }}</a>
- {{- /* hack to remove spaces between links */ -}}
- <a href="/u/{{ .El.Username }}"
- rel="noopener noreferrer" target="_blank"
- {{ if and (.El.IsHellbanned) .Parent.AuthUser.DisplayHellbanned }}class="hb-row"{{ end }}
- style="color: {{ .El.Color }};">{{ .El.Username | last }}</a>
- {{ if .El.AfkIndicatorEnabled -}}
- <small class="afk-indicator">afk</small>
- {{- end -}}
- </div>
- {{- end -}}
- {{- end -}}
-{{ end }}
-\ No newline at end of file