diff options
author | Yorhel <git@yorhel.nl> | 2008-11-15 13:25:57 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-11-15 13:25:57 +0100 |
commit | d97f5a7658a7a9029ada1b1d0a3a3bac9d031f6e (patch) | |
tree | 404ec59be4829ed20addd8b1b692ea50c3a6dd22 /lib | |
parent | 4db2d7228c600190c5035e324f0d061891480e8b (diff) |
Another history browser filter: item type
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 1 | ||||
-rw-r--r-- | lib/VNDB/DB/Misc.pm | 2 | ||||
-rw-r--r-- | lib/VNDB/Handler/Misc.pm | 21 |
3 files changed, 19 insertions, 5 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 72904af8..68bab0b3 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -25,6 +25,7 @@ TODO: - Added threads and posts counts to the global statistics - Improved diff calculation - Whitespace around input fields are removed + - Automated edits filter to history browser 1.23 - 2008-10-22 (r117) - Removed redirects for old revision URLs (the code wasn't very secure...) diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm index 1a3fdc0e..3469dc17 100644 --- a/lib/VNDB/DB/Misc.pm +++ b/lib/VNDB/DB/Misc.pm @@ -82,7 +82,7 @@ sub dbItemInsert { } -# Options: type, iid, uid, auto, hidden page, results +# Options: type, iid, uid, auto, hidden, page, results sub dbRevisionGet { my($self, %o) = @_; $o{results} ||= 10; diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index 33851ad0..4bbbfb0e 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -36,6 +36,7 @@ sub history { { name => 'p', required => 0, default => 1, template => 'int' }, { name => 'm', required => 0, default => 0, enum => [ 0, 1 ] }, { name => 'h', required => 0, default => 1, enum => [ -1..1 ] }, + { name => 't', required => 0, default => '', enum => [ 'v', 'r', 'p' ] }, ); return 404 if $f->{_err}; @@ -51,6 +52,7 @@ sub history { what => 'item user', $type && $type ne 'u' ? ( type => $type, iid => $id ) : (), $type eq 'u' ? ( uid => $id ) : (), + $f->{t} ? ( type => $f->{t} ) : (), page => $f->{p}, results => 50, auto => $f->{m}, @@ -66,20 +68,31 @@ sub history { local $_ = ($type ? "/$type$id" : '').'/hist'; $_ .= '?m='.($n eq 'm' ? $v : $f->{m}); $_ .= '&h='.($n eq 'h' ? $v : $f->{h}); + $_ .= '&t='.($n eq 't' ? $v : $f->{t}); }; div class => 'mainbox'; h1 $title; - p class => 'browseopts'; - a !$f->{m} ? (class => 'optselected') : (), href => $u->(m => 0), 'Show automated edits'; - a $f->{m} ? (class => 'optselected') : (), href => $u->(m => 1), 'Hide automated edits'; - end; + if($type ne 'u') { + p class => 'browseopts'; + a !$f->{m} ? (class => 'optselected') : (), href => $u->(m => 0), 'Show automated edits'; + a $f->{m} ? (class => 'optselected') : (), href => $u->(m => 1), 'Hide automated edits'; + end; + } if($self->authCan('del')) { p class => 'browseopts'; a $f->{h} == 1 ? (class => 'optselected') : (), href => $u->(h => 1), 'Hide deleted items'; a $f->{h} == -1 ? (class => 'optselected') : (), href => $u->(h => -1), 'Show deleted items'; end; } + if(!$type || $type eq 'u') { + p class => 'browseopts'; + a !$f->{t} ? (class => 'optselected') : (), href => $u->(t => ''), 'Show all items'; + a $f->{t} eq 'v' ? (class => 'optselected') : (), href => $u->(t => 'v'), 'Only visual novels'; + a $f->{t} eq 'r' ? (class => 'optselected') : (), href => $u->(t => 'r'), 'Only releases'; + a $f->{t} eq 'p' ? (class => 'optselected') : (), href => $u->(t => 'p'), 'Only producers'; + end; + } end; $self->htmlBrowse( |