diff options
author | Yorhel <git@yorhel.nl> | 2011-04-03 18:12:24 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2011-04-03 18:12:24 +0200 |
commit | 0009e62b8b0b3066f10c4269718c9ccc9b312a63 (patch) | |
tree | 8dda1e0ea577da858841a7e28554f1502b715755 /lib/VNDB/Func.pm | |
parent | ed7cad3d6e6c9ac879eb6392bfd4e9368537ab39 (diff) |
Order the traits groups on /i by their 'order' column
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r-- | lib/VNDB/Func.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm index 64b56625..67cd3f7e 100644 --- a/lib/VNDB/Func.pm +++ b/lib/VNDB/Func.pm @@ -139,12 +139,12 @@ sub _parenttags { # a child tags/traits box sub childtags { - my($self, $title, $type, $t) = @_; + my($self, $title, $type, $t, $order) = @_; div class => 'mainbox'; h1 $title; ul class => 'tagtree'; - for my $p (sort { @{$b->{'sub'}} <=> @{$a->{'sub'}} } @{$t->{childs}}) { + for my $p (sort { !$order ? @{$b->{'sub'}} <=> @{$a->{'sub'}} : $a->{$order} <=> $b->{$order} } @{$t->{childs}}) { li; a href => "/$type$p->{id}", $p->{name}; b class => 'grayedout', " ($p->{c_items})" if $p->{c_items}; |