warn about MAX_FACETS but include rest of checked
[MojoFacets.git] / templates / data / facet.html.ep
index b14bea3..bb0b020 100644 (file)
 <%= include 'sorting' %>
 
 <ul id=facet>
+% my $max_facets = $ENV{MAX_FACETS} || 10000;
+% my $facet_nr  = 0;
 % foreach my $n ( @$facet_names ) {
+%  if ( $facet_nr++ == $max_facets ) {
+<div class=alert>
+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>
+%  }
+%  if ( $facet_nr > $max_facets && ! $checked->{$n} ) {
+%    next;
+%  }
 <li>
 <label>
 <input type=checkbox name="filter_vals" value="<%= $n %>" <%= $checked->{$n} && defined $facet->{$n} ? 'checked' : '' %>>