summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Traits.pm
diff options
context:
space:
mode:
authorQCyph <dev@lived.nl>2011-08-27 10:50:29 +0200
committerYorhel <git@yorhel.nl>2011-08-27 11:01:10 +0200
commite26056de79c72a113fa1c5cc725e053e0efe3a97 (patch)
tree015770471e514ef07a73e3d7e813eae04e117975 /lib/VNDB/Handler/Traits.pm
parent96c8f09ca054ea21f59bd62b3fdc9de90ebf1348 (diff)
Added filters to character browse page and trait page
Diffstat (limited to 'lib/VNDB/Handler/Traits.pm')
-rw-r--r--lib/VNDB/Handler/Traits.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/VNDB/Handler/Traits.pm b/lib/VNDB/Handler/Traits.pm
index f3abdfeb..0a21011c 100644
--- a/lib/VNDB/Handler/Traits.pm
+++ b/lib/VNDB/Handler/Traits.pm
@@ -27,6 +27,7 @@ sub traitpage {
my $f = $self->formValidate(
{ get => 'p', required => 0, default => 1, template => 'int' },
{ get => 'm', required => 0, default => undef, enum => [qw|0 1 2|] },
+ { get => 'fil', required => 0, default => '' },
);
return $self->resNotFound if $f->{_err};
my $tagspoil = $self->reqCookie('tagspoil')||'';
@@ -83,14 +84,15 @@ sub traitpage {
childtags($self, mt('_traitp_childs'), 'i', $t) if @{$t->{childs}};
if(!$t->{meta} && $t->{state} == 2) {
- my($chars, $np) = $self->dbCharGet(
+ my($chars, $np) = $self->filFetchDB(char => $f->{fil}, {}, {
trait_inc => $trait,
- traitspoil => $f->{m},
+ tagspoil => $f->{m},
results => 50,
page => $f->{p},
what => 'vns',
- );
+ });
+ form action => "/i$t->{id}", 'accept-charset' => 'UTF-8', method => 'get';
div class => 'mainbox';
h1 mt '_traitp_charlist';
@@ -101,12 +103,17 @@ sub traitpage {
a href => "/i$trait?m=2", $f->{m} == 2 ? (class => 'optselected') : (), onclick => "setCookie('tagspoil', 2);return true;", mt '_tagp_spoil2';
end;
+ a id => 'filselect', href => '#c';
+ lit '<i>&#9656;</i> '.mt('_js_fil_filters').'<i></i>';
+ end;
+ input type => 'hidden', class => 'hidden', name => 'fil', id => 'fil', value => $f->{fil};
+
if(!@$chars) {
p; br; br; txt mt '_traitp_nochars'; end;
}
p; br; txt mt '_traitp_cached'; end;
end 'div';
-
+ end 'form';
@$chars && $self->charBrowseTable($chars, $np, $f, "/i$trait?m=$f->{m}");
}