/[SQLSession]/trunk/lib/SQLSession/Dispatcher.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/SQLSession/Dispatcher.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 33 by dpavlin, Sat Dec 9 01:15:02 2006 UTC revision 46 by dpavlin, Sun Jan 21 12:40:13 2007 UTC
# Line 11  before '*' => run { Line 11  before '*' => run {
11          my $top = Jifty->web->navigation;          my $top = Jifty->web->navigation;
12          my $edit = Jifty->config->app('edit');          my $edit = Jifty->config->app('edit');
13          $top->child( 'New' => url => '/new' ) if ($edit);          $top->child( 'New' => url => '/new' ) if ($edit);
14          $top->child( 'List' => url => '/list' );          my $l = $top->child( 'List' => url => '/list' );
15    
16            my $databases = SQLSession::Model::DatabaseCollection->new();
17            $databases->unlimit;
18            while ( my $db = $databases->next ) {
19                    my $label = $db->name;
20    #               $label .= ' [' . $db->dsn . ']' if ($edit);
21                    $l->child( $label => url => '/list/database/' . $db->id );
22            }
23    
24            if ( Jifty->web->current_user->id ) {
25                    $top->child( 'Logout' => url => '/logout' );
26            } else {
27                    $top->child( 'Login' => url => '/login' );
28                    $top->child( 'Signup' => url => '/signup' );
29            }
30    
31  };  };
32    
33    
# Line 31  under qr{sql/(\d+)} => run { Line 47  under qr{sql/(\d+)} => run {
47    
48  };  };
49    
50    under 'list' => [
51    
52            on qr{database/(\d+)} => run {
53                    set database_id => $1;
54            },
55    
56            show '/list',
57    ];
58    
59  on 'new' => run {  on 'new' => run {
60          show '/sql';          show '/sql';
61  };  };

Legend:
Removed from v.33  
changed lines
  Added in v.46

  ViewVC Help
Powered by ViewVC 1.1.26