15 |
|
|
16 |
=cut |
=cut |
17 |
|
|
18 |
under '/transports/create/' => [ |
under '/transports/create' => [ |
19 |
|
|
|
on '' => redirect('/transports/create/landscape'), |
|
20 |
on 'landscape' => run { |
on 'landscape' => run { |
21 |
|
|
22 |
my $landscapes = Transports::Model::UserOnLandscapeCollection->new(); |
my $landscapes = Transports::Model::UserOnLandscapeCollection->new(); |
32 |
} elsif ($landscapes->count == 1) { |
} elsif ($landscapes->count == 1) { |
33 |
$landscape_id = $landscapes->first->id; |
$landscape_id = $landscapes->first->id; |
34 |
set 'landscape_id' => $landscape_id; |
set 'landscape_id' => $landscape_id; |
35 |
dispatch('/transports/create/new'); |
dispatch('/transports/create/'); |
36 |
} else { |
} else { |
37 |
set landscapes => $landscapes; |
set landscapes => $landscapes; |
38 |
show '/transports/create/landscape'; |
show '/transports/create/landscape'; |
39 |
}; |
}; |
40 |
|
|
41 |
}, |
}, |
42 |
on 'new' => run { |
on '' => run { |
43 |
|
|
44 |
my $landscape_id = get('landscape_id'); |
my $landscape_id = get('landscape_id'); |
45 |
Jifty->web->tangent('/transports/create/landscape') unless ($landscape_id); |
redirect('/transports/create/landscape') unless ($landscape_id); |
46 |
|
|
47 |
my $transport = get('transport') || Jifty->web->new_action( |
my $transport = Jifty->web->new_action( |
48 |
class => 'CreateTransport', |
class => 'CreateTransport', |
49 |
monkier => 'create', |
moniker => 'transports_create', |
50 |
); |
); |
51 |
|
|
52 |
my $l = Transports::Model::Landscape->new(); |
my $l = Transports::Model::Landscape->new(); |
110 |
|
|
111 |
my $url = Jifty->web->request->path; |
my $url = Jifty->web->request->path; |
112 |
|
|
113 |
warn "before url: $url"; |
#warn "before url: $url"; |
114 |
|
|
115 |
next_rule if ($url eq '/' || $url =~ m#^/(?:login|logout|__jifty)/*#); |
next_rule if ($url eq '/' || $url =~ m#^/(?:login|logout|__jifty)/*#); |
116 |
|
|