shorter MAX_FACETS message to fit in the middle
[MojoFacets.git] / templates / data / facet.html.ep
index bb0b020..25e3df3 100644 (file)
 <%= include 'sorting' %>
 
 <ul id=facet>
-% my $max_facets = $ENV{MAX_FACETS} || 10000;
+% my $max_facets = $ENV{MAX_FACETS} ||= 10000;
 % my $facet_nr  = 0;
+% my $all_values = param('all_values');
+% $max_facets = $facet_count if $all_values;
 % foreach my $n ( @$facet_names ) {
 %  if ( $facet_nr++ == $max_facets ) {
 <div class=alert>
-First <a href="/config"><%= $max_facets %></a> facets displayed in full.
+First <a title="config MAX_FACETS" href="/config"><%= $max_facets %></a> shown
 &middot;
-Below are just checked values from rest of <%= $facet_count - $max_facets %> items.
+<a href="<%= url_for()->query( name => $name, all_values => 1 ) %>">Show all <%= $facet_count %></a>
 </div>
 %  }
 %  if ( $facet_nr > $max_facets && ! $checked->{$n} ) {
@@ -55,6 +57,15 @@ Below are just checked values from rest of <%= $facet_count - $max_facets %> ite
 % if ( $#$facet_names < 5000 ) {
 <script type="text/javascript" src="/facet_graph.js"></script>
 % }
+<script type="text/javascript">
+$(document).ready( function(){
+       console.debug('check alert');
+       var a = $('.alert');
+       if ( a.length ) {
+               $('.middle').html( a.html() );
+       }
+});
+</script>
 
 % if ( $#$facet_names < 100 ) {
 <pre class=debug><%#= dumper $facet %></pre>