line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wishlist::Controller::List; |
2
|
1
|
|
|
1
|
|
13479
|
use Mojo::Base 'Mojolicious::Controller'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
sub show_add { |
5
|
1
|
|
|
1
|
0
|
224
|
my $c = shift; |
6
|
1
|
|
|
|
|
5
|
my $link = $c->link($c->param('url')); |
7
|
1
|
|
|
|
|
332
|
$c->render('add', link => $link); |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub do_add { |
11
|
0
|
|
|
0
|
0
|
|
my $c = shift; |
12
|
0
|
|
|
|
|
|
my %item = ( |
13
|
|
|
|
|
|
|
title => $c->param('title'), |
14
|
|
|
|
|
|
|
url => $c->param('url'), |
15
|
|
|
|
|
|
|
purchased => 0, |
16
|
|
|
|
|
|
|
); |
17
|
0
|
|
|
|
|
|
$c->model->add_item($c->user, \%item); |
18
|
0
|
|
|
|
|
|
$c->redirect_to('/'); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub update { |
22
|
0
|
|
|
0
|
0
|
|
my $c = shift; |
23
|
0
|
|
|
|
|
|
$c->model->update_item( |
24
|
|
|
|
|
|
|
{id => $c->param('id')}, |
25
|
|
|
|
|
|
|
$c->param('purchased') |
26
|
|
|
|
|
|
|
); |
27
|
0
|
0
|
|
|
|
|
if (my $url = $c->param('next_url')) { |
28
|
0
|
|
|
|
|
|
return $c->redirect_to($url); |
29
|
|
|
|
|
|
|
} |
30
|
0
|
|
|
|
|
|
return $c->redirect_to('/'); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub remove { |
34
|
0
|
|
|
0
|
0
|
|
my $c = shift; |
35
|
0
|
|
|
|
|
|
$c->model->remove_item( |
36
|
|
|
|
|
|
|
{id => $c->param('id')}, |
37
|
|
|
|
|
|
|
); |
38
|
0
|
|
|
|
|
|
$c->redirect_to('/'); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|