Merge branch 'master' into eval-code
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 16 Jun 2010 19:40:27 +0000 (21:40 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 16 Jun 2010 19:40:27 +0000 (21:40 +0200)
lib/MojoFacets.pm
lib/MojoFacets/Data.pm
templates/admin.html.ep

index 9a5b315..fb45ed5 100644 (file)
@@ -47,7 +47,7 @@ sub startup {
     my $r = $self->routes;
 
     # Default route
-    $r->route('/:controller/:action/:id')->to('data#index', id => 1);
+    $r->route('/:controller/:action/:id')->to('data#index', id => 0);
 
 #      $self->plugin( 'request_timer' );
 
index f8adc7f..3a02f05 100644 (file)
@@ -531,6 +531,11 @@ sub _data_sorted_by {
 sub items {
        my $self = shift;
 
+       if ( my $show = $self->param('id') ) {
+               $self->param('show', $show);
+               warn "show $show\n";
+       }
+
        my $path = $self->session('path');
        $self->redirect_to('/data/index') unless defined $loaded->{ $path };
 
index 8190794..e9b953c 100644 (file)
@@ -7,7 +7,7 @@ items:
 % foreach my $show ( glob 'templates/data/items/*.html.ep' ) {
 %  $show =~ s{^.+/([^/]+)\.html\.ep$}{$1};
 %  my $class = session('show') eq $show ? 'class=active' : '';
-<a href="<%= url_for( controller => 'data', action => 'items' )->query( show => $show ) %>" <%= $class %>><%= $show %></a>
+<a href="<%= url_for( controller => 'data', action => 'items', id => $show ) %>" <%= $class %>><%= $show %></a>
 % }
 
 % if ( $self->can('_export_path') && glob $self->_export_path('*') ) {