mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-27 15:26:25 -07:00
108 lines
No EOL
3.8 KiB
HTML
108 lines
No EOL
3.8 KiB
HTML
<h2>{{with $.edit}}Edit filter{{else}}New filter{{end}}</h2>
|
|
<form id="filterform" action="{{webPath `/manage/filters`}}{{with $.edit}}?edit={{.ID}}{{end}}" method="POST">
|
|
Filter conditions are checked against a post before the message body is formatted and after the IP is checked against the <a href="{{webPath `/manage/bans`}}">ban list</a>.
|
|
Tripcode searches do not include the prefix "!".
|
|
<table>
|
|
<tr>
|
|
<th>Conditions</th>
|
|
<td id="conditions">
|
|
<fieldset class="fld-cndtns">
|
|
<table>
|
|
<tr class="field-cndtn">
|
|
<th>Field/Condition:</th>
|
|
<td>
|
|
<select name="field1" class="sel-field">
|
|
{{- range $_,$field := .fields}}<option value="{{$field.Value}}">{{$field.Text}}</option>{{end -}}
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr class="search-cndtn">
|
|
<th>Search:</th>
|
|
<td><input type="text" name="search1"></td>
|
|
</tr>
|
|
<tr class="regex-cndtn">
|
|
<th></th>
|
|
<td><label>Is regex <input type="checkbox" name="isregex1"/></label></td>
|
|
</tr>
|
|
<tr class="btns-cndtn">
|
|
<td></td>
|
|
<td>
|
|
<a href="#" class="rem-cndtn">Remove condition</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</fieldset>
|
|
</td>
|
|
<tr>
|
|
<td></td>
|
|
<td><a href="#" id="add-cndtn">Add condition</a></td>
|
|
</tr>
|
|
</tr>
|
|
<tr>
|
|
<th>Action</th>
|
|
<td>
|
|
<select name="action" id="action">
|
|
<option value="reject">Reject post</option>
|
|
<option value="ban">Ban IP</option>
|
|
<option value="log">Log match</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th id="reason">Reason</th>
|
|
<td><textarea name="reason" rows="5" cols="35"></textarea></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Board(s):</th>
|
|
<td id="boardslist">
|
|
<label for="allboards">All boards <input type="checkbox" name="allboards" id="allboards"></label>
|
|
{{- range $_,$board := .allBoards -}}
|
|
<label for="applyboard{{$board.ID}}">/{{$board.Dir}}/ - {{$board.Title}} <input type="checkbox" name="applyboard{{$board.ID}}" id="applyboard{{$board.ID}}"></label>
|
|
{{- end -}}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<input type="submit" name="dofilter" value="Submit Filter">
|
|
</form>
|
|
<hr/>
|
|
<h2>Filter list</h2>
|
|
<form action="{{webPath `/manage/filters`}}" method="GET">
|
|
Show only filters for: <select name="boardsearch" id="boardsearch">
|
|
<option value="">All boards</option>
|
|
{{- range $_, $board := $.allBoards}}
|
|
<option value="{{$board.Dir}}" {{if eq $.boardSearch $board.Dir}}selected{{end}}>/{{$board.Dir}}/ - {{$board.Title}}</option>
|
|
{{- end -}}
|
|
</select>
|
|
<select name="show" id="">
|
|
<option value="all" {{if or (eq $.show `all`) (eq $.show ``)}}selected{{end}}>All filters</option>
|
|
<option value="active" {{if eq $.show `active`}}selected{{end}}>Only active</option>
|
|
<option value="inactive" {{if eq $.show `inactive`}}selected{{end}}>Only inactive</option>
|
|
</select>
|
|
<input type="submit" value="Show">
|
|
</form>
|
|
</form>
|
|
<table class="mgmt-table filterlist">
|
|
<colgroup>
|
|
<col class="row-actions">
|
|
<col class="filter-action">
|
|
<col class="filter-conditions">
|
|
<col class="staff-note">
|
|
<col class="row-staff">
|
|
<col class="is-active">
|
|
<col class="row-date">
|
|
</colgroup>
|
|
<tr>
|
|
<th>Actions</th><th>Filter action</th><th>Conditions</th><th>Staff note</th><th>Staff</th><th>Is active</th><th>Last modified</th>
|
|
</tr>
|
|
{{- range $f, $filter := $.filters -}}
|
|
<tr>
|
|
<td><a href="{{webPath `/manage/filters`}}?edit={{$filter.ID}}">Edit</a> | <a href="{{webPath `/manage/filters`}}?{{if $filter.IsActive}}disable{{else}}enable{{end}}={{$filter.ID}}">{{if $filter.IsActive}}Disable{{else}}Enable{{end}}</a></td>
|
|
<td>{{index $.actions $filter.MatchAction}}</td>
|
|
<td>{{index $.conditions $f}}</td>
|
|
<td>{{$filter.StaffNote}}</td>
|
|
<td>{{index $.staff $f}}</td>
|
|
<td>{{$filter.IsActive}}</td>
|
|
<td>{{formatTimestamp $filter.IssuedAt}}</td>
|
|
</tr>
|
|
{{- end -}}
|
|
</table> |