2023-01-04 15:33:50 -08:00
< form method = "POST" action = "{{webPath " manage / bans " } } " >
2018-10-08 11:14:45 -07:00
< input type = "hidden" name = "do" value = "add" / >
2022-11-16 15:11:55 -08:00
< h2 > Add IP ban< / h2 >
2018-10-05 15:21:36 -07:00
< table >
2024-01-09 13:11:22 -08:00
< tr > < th > IP/Mask< / th > < td > < input type = "text" name = "ip" value = "{{banMask .ban}}" style = "width: 100%;" / > < / td > < / tr >
2022-11-17 16:32:28 -08:00
< tr > < th > Duration< / th > < td > < input type = "text" name = "duration" style = "width: 100%;" { { if gt . ban . ID 0 } } value = "{{until .ban.ExpiresAt}}" { { end } } / > < / td > < / tr >
2022-11-16 15:11:55 -08:00
< tr > < th > < / th > < td > e.g. '1y2mo3w4d5h6m7s',< br / > '1 year 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds'< br / > Optional if "Permanent" is checked, required otherwise< / td > < / tr >
2022-11-17 16:32:28 -08:00
< tr > < th > Permanent< / th > < td > < input type = "checkbox" name = "permanent" id = "permanent" { { if . ban . Permanent } } checked { { end } } > (overrides the duration)< / td > < / tr >
< tr > < th > Appeal wait time< / th > < td > < input type = "text" name = "appealwait" id = "appealwait" style = "width: 100%;" > < / td > < / tr >
< tr > < th > < / th > < td > Same syntax as above, but optional.< br / > If left blank, they can appeal immediately< / td > < / tr >
< tr > < th > No appeals< / th > < td > < input type = "checkbox" name = "noappeals" / > < / td > (if checked, Appeal wait time field is ignored)< / tr >
< tr > < th > Thread starting ban< / th > < td > < input type = "checkbox" name = "threadban" / > (user can reply to threads but can't make new threads)< / td > < / tr >
2022-11-16 15:11:55 -08:00
{{with $.bannedForPostID}}< tr > < th > Banned for post ID< / th > < td > {{$.bannedForPostID}}< / td > < / tr > {{end}}
< tr > < th > Board< / th > < td > < select name = "boardid" id = "boardid" >
< option value = "0" > All boards< / option >
{{- range $b, $board := $.allBoards -}}
2022-11-17 16:32:28 -08:00
< option value = "{{$board.ID}}" { { if eq ( dereference $ . ban . BoardID ) $ board . ID } } selected { { end } } > /{{$board.Dir}}/ - {{$board.Title}}< / option >
2022-11-16 15:11:55 -08:00
{{- end -}}
< / select > < / td > < / tr >
2022-11-17 16:32:28 -08:00
< tr > < th > Reason< / th > < td > < textarea name = "reason" style = "width: 100%;" rows = "6" placeholder = "Message to be displayed to the banned user" > < / textarea > < / td > < / tr >
< tr > < th > Staff note< / th > < td > < textarea name = "staffnote" style = "width: 100%;" rows = "6" placeholder = "Private note that only staff can see" > < / textarea > < / td > < / tr >
2018-10-05 15:21:36 -07:00
< / table >
2023-01-04 15:33:50 -08:00
< input type = "submit" value = "Ban user" / > < input type = "button" name = "docancel" value = "Cancel" onclick = "window.location = './manage/bans'; return false" / >
2018-10-08 11:14:45 -07:00
< / form >
2018-10-03 00:31:43 -07:00
2022-11-17 16:32:28 -08:00
< h2 id = "banlist" > Banlist< / h2 >
2023-01-04 15:33:50 -08:00
< form action = "{{webPath " manage / bans " } } " method = "get" >
Filter board: < select name = "filterboardid" id = "filterboardid" onchange = "window.location = '{{webPath " manage / bans ? filterboardid = "}}' + this.value + '#banlist'" >
2022-11-17 16:32:28 -08:00
< option value = "0" > All boards< / option >
{{- range $b, $board := $.allBoards -}}
< option value = "{{$board.ID}}" { { if eq $ . filterboardid $ board . ID } } selected { { end } } > /{{$board.Dir}}/ - {{$board.Title}}< / option >
{{- end -}}
< / select > < input type = "submit" >
< / form >
2024-03-08 14:50:28 -08:00
< table class = "mgmt-table banlist" >
2022-11-17 16:32:28 -08:00
< tr > < th > Action< / th > < th > IP< / th > < th > Board< / th > < th > Reason< / th > < th > Staff< / th > < th > Staff note< / th > < th > Banned post text< / th > < th > Set< / th > < th > Expires< / th > < th > Appeal at< / th > < / tr >
2022-11-16 15:11:55 -08:00
{{range $_, $ban := $.banlist -}}
< tr >
2024-03-08 14:50:28 -08:00
< td class = "table-actions" > < a href = "{{webPath `manage/bans?edit=`}}{{$ban.ID}}" > Edit< / a > | < a href = "{{webPath `manage/bans?delete=`}}{{$ban.ID}}" > Delete< / a > < / td >
2023-12-31 18:02:42 -08:00
< td > {{banMask $ban}}< / td >
2022-11-16 15:11:55 -08:00
< td > {{if not $ban.BoardID}}< i > all< / i > {{else}}/{{getBoardDirFromID $ban.BoardID}}/{{end}}< / td >
< td > {{$ban.Message}}< / td >
< td > {{getStaffNameFromID $ban.StaffID}}< / td >
< td > {{$ban.StaffNote}}< / td >
< td > {{if not $ban.BannedForPostID}}< i > N/A< / i > {{else}}{{$ban.CopyPostText}}{{end}}< / td >
< td > {{formatTimestamp $ban.IssuedAt}}< / td >
< td >
{{- if $ban.Permanent}}< i > Never< / i > {{else}}{{formatTimestamp $ban.ExpiresAt}}{{end -}}
< / td >
< td >
{{- if $ban.CanAppeal}}{{formatTimestamp $ban.AppealAt}}{{else}}< i > Never< / i > {{end -}}
< / td >
< / tr >
2022-04-14 21:20:32 -07:00
{{end}}< / table >