insert ¶ between repeatable values
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 20 May 2010 18:35:56 +0000 (20:35 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 20 May 2010 18:35:56 +0000 (20:35 +0200)
public/mojo_facets.css
templates/data/items/table.html.ep

index 7bcbbf1..de5f3b0 100644 (file)
@@ -109,3 +109,8 @@ label.excluded,
 a#excluded {
        color: #800;
 }
+
+/* delimiter for repeatable data */
+span.d {
+       color: #ccc;
+}
index e10ed3b..2577868 100644 (file)
 <%== session('sort') eq 'a' ? '&uarr;' : '&darr;' %>
 % }
 <div class="col_opts">
-<a title="filter by this facet" href="<%= url_for( action => 'facet' )->query( name => $n ) %>"><%== $filters->{$n} ? $#{ $filters->{$n} } + 1 . ' selected' : 'filter' %></a>
+<a title="filter by this facet" href="<%= url_for( action => 'facet' )->query( name => $n ) %>">
+% if ( defined $filters->{$n} ) {
+<%= $#{ $filters->{$n} } + 1 %></a>&nbsp;
+<a title="show all values" href="<%= url_for( action => 'facet' )->query( name => $n, show => 'all' ) %>">all
+% } else {
+filter
+% }
+</a>
 </div>
 </th>
 % }
 % foreach my $row ( @$sorted ) {
 <tr>
 % foreach my $col ( @$columns ) {
-<td<%= $numeric->{$col} ? ' class=numeric' : '' %>><%= ref $row->{$col} eq 'ARRAY' ? join(', ',@{ $row->{$col} }) : $row->{$col} %></td>
+<td<%= $numeric->{$col} ? ' class=numeric' : '' %>>
+%  if ( ref $row->{$col} eq 'ARRAY' ) {
+%   foreach ( @{ $row->{$col} } ) {
+<%= $_ %>
+%    if ( $#{ $row->{$col} } ) {
+<span class=d>&para;</span>
+%    }
+%   }
+%  } elsif ( ref $row->{$col} ) {
+<pre class=debug><%= dumper $row->{$col} %></pre>
+%  } else {
+<%= $row->{$col} %>
+%  }
+</td>
 % }
 </tr>
 % }