/[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 57 by dpavlin, Thu Jan 25 12:33:38 2007 UTC revision 79 by dpavlin, Mon Jan 29 20:46:20 2007 UTC
# Line 9  use Data::Dump qw/dump/; Line 9  use Data::Dump qw/dump/;
9    
10  before '*' => run {  before '*' => run {
11          my $top = Jifty->web->navigation;          my $top = Jifty->web->navigation;
12          my $edit = Jifty->config->app('edit');          my $edit = Jifty->web->current_user->role('edit');
13          $top->child( 'New' => url => '/new' ) if ($edit);          $top->child( 'New' => url => '/new' ) if ($edit);
14          my $l = $top->child( 'List' => url => '/list' );          my $l = $top->child( 'List' => url => '/list' );
15    
# Line 31  before '*' => run { Line 31  before '*' => run {
31                  $top->child( 'Signup' => url => '/signup' );                  $top->child( 'Signup' => url => '/signup' );
32          }          }
33    
34  };          if ( Jifty->web->current_user->role( 'admin' ) ) {
35                    $top->child( 'Docs' => url => '/__jifty/online_docs/' );
36                    $top->child( 'Administration' => url => '/__jifty/admin/' );
37            }
38    
39    };
40    
41    
42  under qr{sql/(\d+)} => run {  under qr{sql/(\d+)} => run {
# Line 40  under qr{sql/(\d+)} => run { Line 44  under qr{sql/(\d+)} => run {
44          my $q = SQLSession::Model::Query->new();          my $q = SQLSession::Model::Query->new();
45          $q->load( $1 ) or next_rule;          $q->load( $1 ) or next_rule;
46    
47          warn "q = ",dump( $q );  #       warn "q = ",dump( $q );
48    
49          set sql_query => $q->sql_query;          set q => $q;
         set name => $q->name;  
         set database => $q->on_database->id;  
50    
51          show '/sql';          show '/sql';
52    
# Line 67  on '/' => run { Line 69  on '/' => run {
69          redirect '/list';          redirect '/list';
70  };  };
71    
72    on qr{^/feed/(atom|rss|rss2)}, run {
73            my $type = 'RSS';
74            $type = 'Atom' if ($1 eq 'atom');
75            set type => $type;
76            show('/feed');
77    };
78    
79  1;  1;

Legend:
Removed from v.57  
changed lines
  Added in v.79

  ViewVC Help
Powered by ViewVC 1.1.26