[%# spamreports/view.tt Display spam reports Authors: Jen Griffin Copyright (c) 2015 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'. %] [%- CALL dw.active_resource_group( "foundation" ) -%] [%- dw.need_res( { group => "foundation" } "stc/css/pages/admin/spamreports.css" ) -%] [%# This title logic is a convoluted mess. I did what I could. #%] [%- IF view_by == 'ip'; ip_ehtml = view_what | html; sections.title = '.view.byip.title' | ml( count = count, ip = ip_ehtml, state = view_state ); ELSE; IF view_by == 'poster'; title = ".view.byposter.title"; ELSIF view_by == 'posterid'; title = ".view.byposterid.title"; ELSIF view_by == 'journal'; title = ".view.byjournal.title"; END; title_extra = "($view_state: $count)"; IF view_u.is_identity; title_extra = "($view_u.user) $title_extra"; END; sections.title = title | ml( user = view_u.ljuser_display( head_size = "24x24" ) ); sections.title = "$sections.title $title_extra"; sections.windowtitle = title | ml( user = view_u.display_name ); sections.windowtitle = "$sections.windowtitle $title_extra"; END -%] [%- IF view_by == 'posterid' AND ! view_u.is_expunged; -%]
[%- IF show_posted; ncp = view_u.num_comments_posted; '.view.poster.comments.posted' | ml( posted_comma = commafy( ncp ), posted_raw = ncp ); END; UNLESS view_u.is_identity; IF show_posted; ', '; END; ncr = view_u.num_comments_received; '.view.poster.comments.received' | ml( received_comma = commafy( ncr ), received_raw = ncr ); ', '; nop = view_u.number_of_posts; '.view.poster.entries.posted' | ml( entries_comma = commafy( nop ), entries_raw = nop ); END -%]
[%- END -%]

[ << [% '.nav.frontpage' | ml %] ] [ [% statelink %] ] [%- IF count > 1 -%] [ [% ".nav.sort.${view_sort}" | ml %] ] [%- END -%]

[%- IF ! count -%]

[% '.view.noreports' | ml %]

[%- ELSE -%] [%- FOREACH row IN rows -%] [% IF view_state == 'open'; '
'; dw.form_auth; closeform( [ row.srid ], dw.ml( '.report.individual.close' ) ); '
'; END %]
[%- IF view_by == 'journal' -%]
[% ".report.individual.by" | ml( spamlocation = row.spamloc ) %]
[% row.poster.ljuser_display %]
[%- ELSE -%]
[% ".report.individual.in" | ml( spamlocation = row.spamloc ) %]
[% row.journal.ljuser_display %]
[%- END -%]
[% ".report.individual.reporttime" | ml %]
[% row.reporttime %]
[% ".report.individual.spamtime" | ml( spamlocation = row.spamloc ) %]
[% IF row.posttime; row.posttime; ELSE; ".report.individual.spamtime.notrecorded" | ml; END %]
[% ".report.individual.client" | ml %]
[% IF row.client; row.client | html; ELSE; ".report.individual.client.notrecorded" | ml; END %]
[% ".report.individual.subject" | ml %]
[% IF row.subject; row.subject | html; ELSE; ".report.individual.subject.none" | ml; END %]
[% ".report.individual.body" | ml %]
[% IF row.body; row.body | html; ELSE; ".report.individual.body.none" | ml; END %]
[%- END -%]

[% IF view_state == 'open'; '

'; dw.form_auth; closeform( srids, dw.ml( '.view.closeall' ) ); END %] [%- IF view_by == 'ip' -%] [%- IF reason AND reason.talk_ip_test; -%] [% '.report.individual.sysban.done' | ml %] [%- IF remote.has_priv( 'sysban' ) -%]
[%- END -%] [%- ELSIF remote AND remote.has_priv( 'sysban', 'talk_ip_test' ); -%] [%# Here is where we need to make sure we don't sysban an invalid IP. # For now, only allow IPv4 addresses to be sysbanned. #%] [%- IF is_ipv4; form.checkbox( label = dw.ml( ".report.individual.sysban.ip" ), name = "sysban_ip", value = view_what ); -%]
[%- ELSE -%] [% ".report.individual.sysban.ip.invalid" | ml %] [%- END -%] [%- END -%] [%- END -%] [% IF view_state == 'open'; '
'; END %]

[% '.view.numreports' | ml( count_comma = commafy( count ), count_raw = count ) %]

[%- END -%]