projects
/
MojoFacets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60cdf27
)
sort numeric facets with more than 5 values ascending
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 May 2010 16:01:43 +0000
(18:01 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 May 2010 16:01:43 +0000
(18:01 +0200)
This heuristics allow us to see simple yes/no/maybe lists still as a
count, especially if they are numeric
lib/MojoFacets/Data.pm
patch
|
blob
|
history
diff --git
a/lib/MojoFacets/Data.pm
b/lib/MojoFacets/Data.pm
index
65aef48
..
dee9765
100644
(file)
--- a/
lib/MojoFacets/Data.pm
+++ b/
lib/MojoFacets/Data.pm
@@
-603,7
+603,8
@@
sub facet {
my $numeric = $self->_is_numeric($name);
my $sort = $self->param('sort');
- $sort ||= $numeric ? 'a' : 'c';
+ # sort numeric facets with more than 5 values ascending
+ $sort ||= $numeric && $#facet_names > 4 ? 'a' : 'c';
@facet_names = sort {
my $result;