summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/VNBrowse.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-11-27 12:02:25 +0100
committerYorhel <git@yorhel.nl>2009-11-27 12:02:25 +0100
commite69b417f9ce6e73e6c1a477048d167f9490f9d5a (patch)
tree04164691c32897d64d626037aa16accd287c93d5 /lib/VNDB/Handler/VNBrowse.pm
parent4b6421198ab810375b6d152f0eb581a01c1017b5 (diff)
Display VN ratings on tag pages as well
With this method I managed to reuse the VN list table code for the lists on both the VN browser and the tag pages. And optimized away the dbTagVNs() function while I was at it (dbVNGet() is powerful enough)
Diffstat (limited to 'lib/VNDB/Handler/VNBrowse.pm')
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm47
1 files changed, 1 insertions, 46 deletions
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index dbe80ac1..c7944a46 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -85,52 +85,7 @@ sub list {
my $url = "/v/$char?q=$f->{q};ti=$f->{ti};te=$f->{te}";
$_ and $url .= ";pl=$_" for @{$f->{pl}};
$_ and $url .= ";ln=$_" for @{$f->{ln}};
- $self->htmlBrowse(
- class => 'vnbrowse',
- items => $list,
- options => $f,
- nextpage => $np,
- pageurl => "$url;o=$f->{o};s=$f->{s}",
- sorturl => $url,
- header => [
- @ti ? [ mt('_vnbrowse_col_score'), 'tagscore', undef, 'tc_s' ] : (),
- [ mt('_vnbrowse_col_title'), 'title', undef, @ti ? 'tc_t' : 'tc1' ],
- [ '', 0, undef, 'tc2' ],
- [ '', 0, undef, 'tc3' ],
- [ mt('_vnbrowse_col_released'), 'rel', undef, 'tc4' ],
- [ mt('_vnbrowse_col_popularity'), 'pop', undef, 'tc5' ],
- [ mt('_vnbrowse_col_rating'), 'rating', undef, 'tc6' ],
- ],
- row => sub {
- my($s, $n, $l) = @_;
- Tr $n % 2 ? (class => 'odd') : ();
- if(@ti) {
- td class => 'tc_s';
- tagscore $l->{tagscore}, 0;
- end;
- }
- td class => @ti ? 'tc_t' : 'tc1';
- a href => '/v'.$l->{id}, title => $l->{original}||$l->{title}, shorten $l->{title}, 100;
- end;
- td class => 'tc2';
- $_ ne 'oth' && cssicon $_, mt "_plat_$_"
- for (sort split /\//, $l->{c_platforms});
- end;
- td class => 'tc3';
- cssicon "lang $_", mt "_lang_$_"
- for (reverse sort split /\//, $l->{c_languages});
- end;
- td class => 'tc4';
- lit $self->{l10n}->datestr($l->{c_released});
- end;
- td class => 'tc5', sprintf '%.2f', ($l->{c_popularity}||0)*100;
- td class => 'tc6';
- txt sprintf '%.2f', $l->{c_rating}||0;
- b class => 'grayedout', sprintf ' (%d)', $l->{c_votecount};
- end;
- end;
- },
- );
+ $self->htmlBrowseVN($list, $f, $np, $url, scalar @ti);
$self->htmlFooter;
}