line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Articulate::Routes::TransparentForms; |
2
|
5
|
|
|
5
|
|
2506
|
use strict; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
149
|
|
3
|
5
|
|
|
5
|
|
18
|
use warnings; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
138
|
|
4
|
|
|
|
|
|
|
|
5
|
5
|
|
|
5
|
|
22
|
use Moo; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
25
|
|
6
|
|
|
|
|
|
|
with 'Articulate::Role::Routes'; |
7
|
5
|
|
|
5
|
|
1368
|
use Articulate::Syntax::Routes; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
71
|
|
8
|
5
|
|
|
5
|
|
3774
|
use Articulate::Service; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
23
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
get '/zone/:zone_id/create' => sub { |
11
|
|
|
|
|
|
|
my ( $self, $request ) = @_; |
12
|
|
|
|
|
|
|
my $zone_id = $request->params->{'zone_id'}; |
13
|
|
|
|
|
|
|
$self->service->process_request( |
14
|
|
|
|
|
|
|
create_form => { |
15
|
|
|
|
|
|
|
location => "zone/$zone_id", |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
post '/zone/:zone_id/create' => sub { |
21
|
|
|
|
|
|
|
my ( $self, $request ) = @_; |
22
|
|
|
|
|
|
|
my $zone_id = $request->params->{'zone_id'}; |
23
|
|
|
|
|
|
|
my $article_id = $request->params->{'article_id'}; |
24
|
|
|
|
|
|
|
return $self->process_request( |
25
|
|
|
|
|
|
|
error => { |
26
|
|
|
|
|
|
|
simple_message => 'Parameter article_id is required' |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
) unless defined $article_id and $article_id ne ''; |
29
|
|
|
|
|
|
|
my $content = $request->params->{'content'}; |
30
|
|
|
|
|
|
|
$self->service->process_request( |
31
|
|
|
|
|
|
|
create => { |
32
|
|
|
|
|
|
|
location => "zone/$zone_id/article/$article_id", |
33
|
|
|
|
|
|
|
content => $content, |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
get '/zone/:zone_id/article/:article_id/edit' => sub { |
39
|
|
|
|
|
|
|
my ( $self, $request ) = @_; |
40
|
|
|
|
|
|
|
my $zone_id = $request->params->{'zone_id'}; |
41
|
|
|
|
|
|
|
my $article_id = $request->params->{'article_id'}; |
42
|
|
|
|
|
|
|
$self->service->process_request( |
43
|
|
|
|
|
|
|
edit_form => { |
44
|
|
|
|
|
|
|
location => "zone/$zone_id/article/$article_id", |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |