mourningdove/views/admin/sysban/index.tt

94 lines
2.5 KiB
Text
Raw Normal View History

2026-05-24 01:03:05 +00:00
[%# Frontend for managing/setting/clearing sysbans.
#
# Authors:
# Juliet Kemp <juliet.kemp@gmail.com> -- original page
# Jen Griffin <kareila@livejournal.com> -- TT conversion
#
# Copyright (c) 2009-2020 by Dreamwidth Studios, LLC.
#
# This program is free software; you may redistribute it and/or modify it under
# the same terms as Perl itself. For a copy of the license, please reference
# 'perldoc perlartistic' or 'perldoc perlgpl'.
%]
[%- sections.title = '.title' | ml -%]
[%- CALL dw.active_resource_group( "foundation" ) -%]
[%- sections.head = BLOCK %]
<style type="text/css">
#content input, #content select {
display: inline;
height: auto;
width: auto;
margin: 1em;
}
#content select {
padding-right: 2rem;
}
#content td {
border: solid 2px rgb(230,230,230);
vertical-align: top;
}
#content th {
border: solid 2px rgb(180,180,180);
text-align: center;
}
</style>
[% END %]
<p>
<form method='post' action='sysban'>
[% dw.form_auth %]
[% form.select( label = dw.ml( '.label.type' ),
name = 'bantype', items = sysban_menu );
form.submit( name = 'addnew', value = dw.ml( '.btn.addnew' ) );
form.submit( name = 'query', value = dw.ml( '.btn.query' ) ) %]
</form>
</p>
<form method='post' action='sysban'>
[% dw.form_auth %]
<p>
[% form.textbox( label = dw.ml( '.label.queryone' ), value = '',
name = 'queryvalue', id = 'queryvalue' );
form.submit( name = 'queryone', value = dw.ml( '.btn.queryone' ) ) %]
</p>
<p>
[% form.checkbox( label = dw.ml( '.label.expiredcheck' ), value = '1',
name = 'expiredcheck', id = 'expiredcheck',
selected = formdata.expiredcheck ) %]
</p>
</form>
[%- IF action == 'queryone';
banquery = formdata.queryvalue | html;
IF sysbans.defined && sysbans.size -%]
<h3>[% '.header.queryone' | ml( banquery = banquery ) %]</h3>
<table class="table">
<thead><tr>
<th>[% '.col.type' | ml %]</th>
<th>[% '.col.exp' | ml %]</th>
<th>[% '.col.note' | ml %]</th>
</tr></thead>
[%- FOREACH bantype IN sysbans.keys.sort -%]
[%- FOREACH banrow IN sysbans.$bantype -%]
<tr>
<td>[% bantype %]</td>
<td>[% localtime( banrow.expire ) %]</td>
<td>[% banrow.note | html %]</td>
</tr>
[%- END -%]
[%- END -%]
</table>
[%- ELSIF banquery -%]
<p>[% '.txt.nomatch' | ml( banquery = banquery ) %]</p>
[%- END -%]
[%- END -%]