chat-controls.gohtml (4317B)
1 {{ define "base" }} 2 <html lang="en"> 3 <head> 4 <title></title> 5 <link rel="stylesheet" type="text/css" href="/public/css/bootstrap.min.css?v={{ .VERSION }}" /> 6 <link rel="stylesheet" type="text/css" href="/public/css/style.css?v={{ .VERSION }}" /> 7 <style> 8 html, body {background-color: transparent; } 9 .btn-xs { 10 margin: 0 !important; 11 padding: 0 4px !important; 12 font-size: 11px !important; 13 } 14 form { 15 padding: 0; 16 margin: 0; 17 } 18 </style> 19 </head> 20 <body> 21 <div style="margin: 0 15px;"> 22 <a href="/api/v1/chat/messages/{{ .Data.RoomName }}{{ if .Data.IsStream }}/stream{{ end }}{{ .Data.ChatQueryParams }}" target="iframe2" class="btn btn-xs btn-secondary" title="Refresh messages">↻</a> 23 {{ if .Data.IsStream }}<a href="/api/v1/chat/messages/{{ .Data.RoomName }}/refresh{{ .Data.ChatQueryParams }}" class="btn btn-xs btn-secondary" title="Stop tab loading icon">□</a>{{ end }} 24 <a href="/chat/{{ .Data.RoomName }}/archive" rel="noopener noreferrer" target="_blank">{{ t "Read all messages" . }}</a> 25 {{ if .Data.ToggleMentions }} 26 <a href="/chat/{{ .Data.RoomName }}?mentionsOnly=0" class="btn btn-xs btn-success" title="Only Mentions are displayed" target="_top">@</a> 27 {{ else }} 28 <a href="/chat/{{ .Data.RoomName }}?mentionsOnly=1" class="btn btn-xs btn-secondary" title="All messages displayed" target="_top">@</a> 29 {{ end }} 30 {{ if eq .Data.TogglePms 1 }} 31 <a href="/chat/{{ .Data.RoomName }}?pmonly=2" class="btn btn-xs btn-success" title="Only PMs are displayed" target="_top">PM</a> 32 {{ else if eq .Data.TogglePms 2 }} 33 <a href="/chat/{{ .Data.RoomName }}?pmonly=0" class="btn btn-xs btn-warning" title="PMs are hidden" target="_top">PM</a> 34 {{ else }} 35 <a href="/chat/{{ .Data.RoomName }}?pmonly=1" class="btn btn-xs btn-secondary" title="All messages displayed" target="_top">PM</a> 36 {{ end }} 37 <form method="post" class="d-inline-block"> 38 <input type="hidden" name="formName" value="toggle-ignored" /> 39 <input type="hidden" name="csrf" value="{{ .CSRF }}" /> 40 <button class="btn btn-xs {{ if .AuthUser.DisplayIgnored }}btn-warning{{ else }}btn-secondary{{ end }}" title="toggle ignored users">Ignored</button> 41 </form> 42 {{ if .AuthUser.IsModerator }} 43 <form method="post" class="d-inline-block"> 44 <input type="hidden" name="formName" value="toggle-m" /> 45 <input type="hidden" name="csrf" value="{{ .CSRF }}" /> 46 <button class="btn btn-xs {{ if .AuthUser.DisplayModerators }}btn-secondary{{ else }}btn-warning{{ end }}" title="toggle moderators messages">Mod</button> 47 </form> 48 {{ end }} 49 {{ if .AuthUser.CanSeeHB }} 50 <form method="post" class="d-inline-block"> 51 <input type="hidden" name="formName" value="toggle-hb" /> 52 <input type="hidden" name="csrf" value="{{ .CSRF }}" /> 53 <button class="btn btn-xs btn-secondary" title="toggle hellban messages">HB ({{ if .AuthUser.DisplayHellbanned }}on{{ else }}off{{ end }})</button> 54 </form> 55 {{ end }} 56 {{ if .AuthUser.ChatReadMarkerEnabled }} 57 <form method="post" class="d-inline-block"> 58 <input type="hidden" name="formName" value="update-read-marker" /> 59 <input type="hidden" name="csrf" value="{{ .CSRF }}" /> 60 <button class="btn btn-xs btn-secondary">Update read marker</button> 61 </form> 62 {{ end }} 63 <form method="post" class="d-inline-block"> 64 <input type="hidden" name="formName" value="afk" /> 65 <input type="hidden" name="csrf" value="{{ .CSRF }}" /> 66 <button class="btn btn-xs {{ if .AuthUser.AFK }}btn-danger{{ else }}btn-secondary{{ end }}">afk</button> 67 </form> 68 </div> 69 </body> 70 </html> 71 {{ end }}