/[SVNBrowser]/trunk/lib/SVNBrowser/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

Contents of /trunk/lib/SVNBrowser/Dispatcher.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 76 - (show annotations)
Wed Feb 6 12:46:07 2008 UTC (16 years, 2 months ago) by dpavlin
File size: 1140 byte(s)
switch between mason and td output using mason variable
1 #
2 package SVNBrowser::Dispatcher;
3
4 use strict;
5 use warnings;
6
7 use Jifty::Dispatcher -base;
8
9 use Data::Dump qw/dump/;
10
11 under 'rev' => [
12
13 on qr{rev/(\d+)(/*.*)} => run {
14 set revision => $1;
15 set path => $2;
16 },
17
18 run {
19 show '/rev'
20 },
21 ];
22
23 under 'filter' => [
24
25 on qr{path(/.+)} => run {
26 set rel_path => $1;
27 },
28
29 on qr{author/([^/]+)} => run {
30 set author => $1;
31 },
32
33 on qr{actions} => run {
34 set show_actions => 1;
35 },
36
37 on qr{page/(\d+)} => run {
38 set per_page => $1;
39 },
40
41 on qr{from/([^/]+)} => run {
42 set from_date => $1;
43 },
44
45 on qr{to/([^/]+)} => run {
46 set to_date => $1;
47 },
48
49 on qr{search/([^/]+)} => run {
50 set search => $1;
51 },
52
53 run {
54 my $next = Jifty->web->request->continuation;
55
56 if (Jifty->web->response->results) {
57 $next = Jifty::Continuation->new(
58 request => Jifty->web->request,
59 response => Jifty->web->response,
60 );
61 # warn "created continuation: ", dump($next);
62 } elsif ($next) {
63 # warn "next = ", dump( $next );
64 $next->call;
65 }
66
67 set 'next' => $next;
68
69 if ( get 'mason' ) {
70 show '/list';
71 } else {
72 show '/x-list';
73 }
74 },
75
76 ];
77
78 on '' => run {
79 redirect '/filter';
80 };
81
82 1;

  ViewVC Help
Powered by ViewVC 1.1.26