1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-06 13:26:24 -07:00
gochan/templates/manage_filebans.html
2022-09-15 22:50:45 -07:00

72 lines
No EOL
3.2 KiB
HTML

<div id="fileban-tabs">
<ul>
<li><a href="#filename-bans">Filename bans</a></li>
<li><a href="#checksum-bans">File checksum bans</a></li>
</ul>
<div id="filename-bans">
<h2>Create new filename ban</h2>
<form id="filenamebanform" action="{{.webroot}}manage?action=filebans" method="POST">
<input type="hidden" name="bantype" value="filename">
<table>
<tr><td>Filename:</td><td><input type="text" name="filename" id="filename"></td></tr>
<tr><td>SQL wildcard:<sup><a href="https://www.w3schools.com/sql/sql_wildcards.asp" target="_blank">?</a></sup></td><td><input type="checkbox" name="iswildcard" id="iswildcard"/></td></tr>
<tr><td>Board:</td><td><select name="board">
<option value="">All boards (global ban)</option>
{{- range $b,$uri := .boardURIs -}}<option value="{{$uri}}">/{{$uri}}/</option>{{end -}}
</select></td></tr>
<tr><td>Staff:</td><td>{{.currentStaff}}</td></tr>
<tr><td>Staff note:</td><td><input type="text" name="staffnote"/></td></tr>
</table>
<input type="submit" name="dofilenameban" value="Create"/>
<input type="button" onclick="document.getElementById('filenamebanform').reset()" value="Cancel"/>
</form><hr/>
<h2>Current filename bans</h2>
{{- if eq 0 (len .filenameBans)}}<i>No filename bans</i>{{else -}}
<table border="1">
<tr><th>Filename</th><th>Wildcard</th><th>Board</th><th>Staff</th><th>Staff note</th><th>Action</th></tr>
{{range $b,$ban := .filenameBans}}
<tr>
<td>{{$ban.Filename}}</td>
<td>{{$ban.IsRegex}}</td>
<td>{{$uri := $ban.BoardURI}}{{if eq $uri ""}}<i>All boards</i>{{else}}/{{$uri}}/{{end}}</td>
<td>{{$staff := $ban.StaffName}}{{if eq $staff ""}}<i>?</i>{{else}}{{$staff}}{{end}}</td>
<td>{{$ban.StaffNote}}</td>
<td><a href="{{$.webroot}}manage?action=filebans&delfnb={{$ban.ID}}">Delete</a></td>
</tr>
{{end -}}
</table>
{{- end -}}
</div>
<div id="checksum-bans">
<h2>Create new file checksum ban</h2>
<form id="checksumbanform" action="{{.webroot}}manage?action=filebans#checksum-bans" method="POST">
<input type="hidden" name="bantype" value="checksum">
<table>
<tr><td>Checksum</td><td><input type="text" name="checksum"></td></tr>
<tr><td>Board</td><td><select name="board">
<option value="">All boards (global ban)</option>
{{- range $b,$uri := .boardURIs -}}<option value="{{$uri}}">/{{$uri}}/</option>{{end -}}
</select></td></tr>
<tr><td>Staff:</td><td>{{.currentStaff}}</td></tr>
<tr><td>Staff note:</td><td><input type="text" name="staffnote"/></td></tr>
</table>
<input type="submit" name="dochecksumban" value="Create"/>
<input type="button" onclick="document.getElementById('checksumbanform').reset()" value="Cancel"/>
</form><hr/>
<h2>Current file checksum bans</h2>
{{- if eq 0 (len .checksumBans)}}<i>No file checksum bans</i>{{else -}}
<table border="1">
<tr><th>Checksum</th><th>Board</th><th>Staff</th><th>Staff note</th><th>Action</th></tr>
{{range $b,$ban := .checksumBans}}
<tr>
<td>{{$ban.Checksum}}</td>
<td>{{$uri := $ban.BoardURI}}{{if eq $uri ""}}<i>All boards</i>{{else}}/{{$uri}}/{{end}}</td>
<td>{{$staff := $ban.StaffName}}{{if eq $staff ""}}<i>?</i>{{else}}{{$staff}}{{end}}</td>
<td>{{$ban.StaffNote}}</td>
<td><a href="{{$.webroot}}manage?action=filebans&delcsb={{$ban.ID}}#checksum-bans">Delete</a></td>
</tr>
{{- end -}}
</table>
{{end}}
</div>
</div>