summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-11-03 09:33:30 +0100
committerYorhel <git@yorhel.nl>2010-11-03 09:33:30 +0100
commitf7ed322c0df68e2f4794a083cd71fa09b6069f39 (patch)
tree37d273abd1772992891899f47ebb07bf75422932 /lib
parent1b6db48e25ffdbce61db30001ac2a36c2dd7856f (diff)
Handler::Discussions: Only display board names different from the filter
Looks cleaner now.
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Discussions.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index 33d20fc9..d1c9e3b9 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -319,7 +319,7 @@ sub board {
end;
end;
- _threadlist($self, $list, $f, $np, "/t/$type$iid") if @$list;
+ _threadlist($self, $list, $f, $np, "/t/$type$iid", $type.$iid) if @$list;
$self->htmlFooter;
}
@@ -348,7 +348,7 @@ sub index {
h1 class => 'boxtitle';
a href => "/t/$_", mt "_dboard_$_";
end;
- _threadlist($self, $list, {p=>1}, 0, "/t");
+ _threadlist($self, $list, {p=>1}, 0, "/t", $_);
}
$self->htmlFooter;
@@ -356,7 +356,7 @@ sub index {
sub _threadlist {
- my($self, $list, $f, $np, $url) = @_;
+ my($self, $list, $f, $np, $url, $board) = @_;
$self->htmlBrowse(
items => $list,
options => $f,
@@ -376,14 +376,15 @@ sub _threadlist {
a $o->{locked} ? ( class => 'locked' ) : (), href => "/t$o->{id}", shorten $o->{title}, 50;
b class => 'boards';
my $i = 1;
- for(sort { $a->{type}.$a->{iid} cmp $b->{type}.$b->{iid} } @{$o->{boards}}) {
+ my @boards = sort { $a->{type}.$a->{iid} cmp $b->{type}.$b->{iid} } grep $_->{type}.($_->{iid}||'') ne $board, @{$o->{boards}};
+ for(@boards) {
last if $i++ > 4;
txt ', ' if $i > 2;
a href => "/t/$_->{type}".($_->{iid}||''),
title => $_->{original}||mt("_dboard_$_->{type}"),
shorten $_->{title}||mt("_dboard_$_->{type}"), 30;
}
- txt ', ...' if @{$o->{boards}} > 4;
+ txt ', ...' if @boards > 4;
end;
end;
td class => 'tc2', $o->{count}-1;