added faceted links
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 2 Jun 2010 20:44:32 +0000 (22:44 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 2 Jun 2010 20:44:32 +0000 (22:44 +0200)
public/mojo_facets.css
templates/data/items/list.html.ep

index 13402f0..f267455 100644 (file)
@@ -156,3 +156,10 @@ form.action_filter {
        font-family: monospace;
        color: #444;
 }
        font-family: monospace;
        color: #444;
 }
+
+/* items/list.html.ep */
+a.facet {
+       font-family: monospace;
+       color: #666;
+       text-decoration: none;
+}
index 2f5a75c..a99776e 100644 (file)
@@ -5,7 +5,10 @@
 %  next unless defined $row->{$col};
 %  my $v = ref $row->{$col} eq 'ARRAY' ? join(', ',@{ $row->{$col} }) : $row->{$col};
 %  next if $v =~ m/^\s*$/;
 %  next unless defined $row->{$col};
 %  my $v = ref $row->{$col} eq 'ARRAY' ? join(', ',@{ $row->{$col} }) : $row->{$col};
 %  next if $v =~ m/^\s*$/;
-<li><tt><%= $col %></tt> <%= $v %>
+<li>
+% my $count = defined $filters->{$col} ? $#{ $filters->{$col} } + 1 : '';
+<a class="facet" title="<%= $count %>" href="<%= url_for( action => 'facet' )->query( name => $col, all => 0 ) %>"><%= $col %></a>
+<%= $v %>
 % }
 </ul>
 % }
 % }
 </ul>
 % }