diff options
author | Yorhel <git@yorhel.nl> | 2008-11-15 12:52:06 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-11-15 12:52:06 +0100 |
commit | 0c18982e5f21fdf5027a4c079bcbaf7750fe0d1b (patch) | |
tree | df203a15cee7b7201e6d9492124ccf8ff2506c72 /lib | |
parent | c6c8b37d60dfd8943a860043f61a9344ddb1dda6 (diff) |
Automated edits filter
Currently relies on the fact that Multi is the only one making the
automated edits
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/DB/Misc.pm | 5 | ||||
-rw-r--r-- | lib/VNDB/Handler/Misc.pm | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm index 2a88d756..df3d7790 100644 --- a/lib/VNDB/DB/Misc.pm +++ b/lib/VNDB/DB/Misc.pm @@ -82,11 +82,12 @@ sub dbItemInsert { } -# Options: type, iid, uid, page, results +# Options: type, iid, uid, auto, page, results sub dbRevisionGet { my($self, %o) = @_; $o{results} ||= 10; $o{page} ||= 1; + $o{auto} ||= 0; # 0: show, -1:only, 1:hide my %where = ( $o{type} ? ( @@ -95,6 +96,8 @@ sub dbRevisionGet { '!sr.!sid = ?' => [ $o{type}, $o{type}, $o{iid} ] ) : (), $o{uid} ? ( 'c.requester = ?' => $o{uid} ) : (), + $o{auto} ? ( + 'c.requester !s 1' => $o{auto} < 0 ? '=' : '<>' ) : (), ); my @join = ( diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index b2a7af03..330701bb 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -34,6 +34,7 @@ sub history { my $f = $self->formValidate( { name => 'p', required => 0, default => 1, template => 'int' }, + { name => 'm', required => 0, default => 0, enum => [ 0, 1 ] }, ); return 404 if $f->{_err}; @@ -51,28 +52,33 @@ sub history { $type eq 'u' ? ( uid => $id ) : (), page => $f->{p}, results => 50, + auto => $f->{m}, ); $self->htmlHeader(title => $title); $self->htmlMainTabs($type, $obj, 'hist') if $type; + my $baseurl = ($type ? "/$type$id" : '').'/hist'; + div class => 'mainbox'; h1 $title; - p class => 'center', 'Some filter or search options here'; + p class => 'browseopts'; + a !$f->{m} ? (class => 'optselected') : (), href => "$baseurl?m=0", 'Show automated edits'; + a $f->{m} ? (class => 'optselected') : (), href => "$baseurl?m=1", 'Hide automated edits'; + end; end; $self->htmlBrowse( items => $list, options => $f, nextpage => $np, - pageurl => ($type ? "/$type$id" : '').'/hist', + pageurl => "$baseurl?m=$f->{m}", class => 'history', header => [ sub { td colspan => 2, class => 'tc1', 'Rev.' }, [ 'Date' ], [ 'User' ], [ 'Page' ], - #[ 'Edit summary' ], ], row => sub { my($s, $n, $i) = @_; |