summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/ULists.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-12-21 10:53:32 +0100
committerYorhel <git@yorhel.nl>2010-12-21 10:53:32 +0100
commite77484d81461c322656615759ba77ea25713a8d6 (patch)
treeb750f8e165ead267bdd2fc4ad900f181997535cb /lib/VNDB/Handler/ULists.pm
parent19e353c480091ec607324ee09a8821dd3d895975 (diff)
Added vnlists.status filter to /u+/list
Can only filter on one option. If there are more things to filter on it would make sense to use the filter selector, but for now this will do.
Diffstat (limited to 'lib/VNDB/Handler/ULists.pm')
-rw-r--r--lib/VNDB/Handler/ULists.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm
index a6d6198d..d9051347 100644
--- a/lib/VNDB/Handler/ULists.pm
+++ b/lib/VNDB/Handler/ULists.pm
@@ -331,6 +331,7 @@ sub vnlist {
{ name => 's', required => 0, default => 'title', enum => [ 'title', 'vote' ] },
{ name => 'c', required => 0, default => 'all', enum => [ 'all', 'a'..'z', 0 ] },
{ name => 'v', required => 0, default => 0, enum => [ -1..1 ] },
+ { name => 't', required => 0, default => -1, enum => [ -1, @{$self->{vnlist_status}} ] },
);
return 404 if $f->{_err};
@@ -363,6 +364,7 @@ sub vnlist {
sort => $f->{s}, reverse => $f->{o} eq 'd',
voted => $f->{v} == 0 ? undef : $f->{v} < 0 ? 0 : $f->{v},
$f->{c} ne 'all' ? (char => $f->{c}) : (),
+ $f->{t} >= 0 ? (status => $f->{t}) : (),
);
my $title = $own ? mt '_rlist_title_my' : mt '_rlist_title_other', $u->{username};
@@ -376,6 +378,7 @@ sub vnlist {
local $_ = "/u$uid/list";
$_ .= '?c='.($n eq 'c' ? $v : $f->{c});
$_ .= ';v='.($n eq 'v' ? $v : $f->{v});
+ $_ .= ';t='.($n eq 't' ? $v : $f->{t});
if($n eq 'page') {
$_ .= ';o='.($n eq 'o' ? $v : $f->{o});
$_ .= ';s='.($n eq 's' ? $v : $f->{s});
@@ -391,10 +394,14 @@ sub vnlist {
}
end;
p class => 'browseopts';
- a href => $url->(v => 0), 0 == $f->{v} ? (class => 'optselected') : (), mt '_rlist_voted_all';
+ a href => $url->(v => 0), 0 == $f->{v} ? (class => 'optselected') : (), mt '_rlist_all';
a href => $url->(v => 1), 1 == $f->{v} ? (class => 'optselected') : (), mt '_rlist_voted_only';
a href => $url->(v => -1), -1 == $f->{v} ? (class => 'optselected') : (), mt '_rlist_voted_none';
end;
+ p class => 'browseopts';
+ a href => $url->(t => -1), -1 == $f->{t} ? (class => 'optselected') : (), mt '_rlist_all';
+ a href => $url->(t => $_), $_ == $f->{t} ? (class => 'optselected') : (), mt '_vnlist_status_'.$_ for @{$self->{vnlist_status}};
+ end;
end;
_vnlist_browse($self, $own, $list, $np, $f, $url, $uid);