warn about MAX_FACETS but include rest of checked
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 6 Jun 2010 16:32:24 +0000 (18:32 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 6 Jun 2010 16:32:24 +0000 (18:32 +0200)
This allows us to keep selected values on next submit

templates/data/facet.html.ep

index a7583b8..bb0b020 100644 (file)
 % my $max_facets = $ENV{MAX_FACETS} || 10000;
 % my $facet_nr  = 0;
 % foreach my $n ( @$facet_names ) {
-%  if ( $facet_nr++ > $max_facets ) {
+%  if ( $facet_nr++ == $max_facets ) {
 <div class=alert>
-To keep browser memory usage at sane level, only <%= $max_facets %> facets are loaded to browser.
-This can be changed in <a href="/config">config</a>.
+First <a href="/config"><%= $max_facets %></a> facets displayed in full.
+&middot;
+Below are just checked values from rest of <%= $facet_count - $max_facets %> items.
 </div>
-%    last;
+%  }
+%  if ( $facet_nr > $max_facets && ! $checked->{$n} ) {
+%    next;
 %  }
 <li>
 <label>