1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-14 16:26:23 -07:00
gochan/templates/manage_filebans.html

77 lines
No EOL
3.4 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="{{webPath "manage/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>Regular expression</td><td><input type="checkbox" name="isregex" id="isregex"/></td></tr>
<tr><td>Board:</td><td><select name="boardid" id="boardid">
<option value="0">All boards</option>
{{- range $b, $board := $.allBoards -}}
<option value="{{$board.ID}}" {{if eq (dereference $.ban.BoardID) $board.ID}}selected{{end}}>/{{$board.Dir}}/ - {{$board.Title}}</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>Regular expression</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 := (intPtrToBoardDir $ban.BoardID "" "?")}}{{if eq $uri ""}}<i>All boards</i>{{else}}/{{$uri}}/{{end}}</td>
<td>{{$staff := (getStaffNameFromID $ban.StaffID)}}{{if eq $staff ""}}<i>?</i>{{else}}{{$staff}}{{end}}</td>
<td>{{$ban.StaffNote}}</td>
<td><a href="{{webPath "manage/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="{{webPath "manage/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="boardid" id="boardid">
<option value="0">All boards</option>
{{- range $b, $board := $.allBoards -}}
<option value="{{$board.ID}}" {{if eq (dereference $.ban.BoardID) $board.ID}}selected{{end}}>/{{$board.Dir}}/ - {{$board.Title}}</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 := (intPtrToBoardDir $ban.BoardID "" "?")}}{{if eq $uri ""}}<i>All boards</i>{{else}}/{{$uri}}/{{end}}</td>
<td>{{$staff := (getStaffNameFromID $ban.StaffID)}}{{if eq $staff ""}}<i>?</i>{{else}}{{$staff}}{{end}}</td>
<td>{{$ban.StaffNote}}</td>
<td><a href="{{webPath "manage/filebans"}}?delcsb={{$ban.ID}}#checksum-bans">Delete</a></td>
</tr>
{{- end -}}
</table>
{{end}}
</div>
</div>