14 |
my $present; |
my $present; |
15 |
form { |
form { |
16 |
table { |
table { |
|
row { |
|
|
cell { _('Part of campaign') } |
|
|
cell { _('Picture filename') } |
|
|
cell { _('Type of picture') } |
|
|
cell {} |
|
|
}; |
|
17 |
while ( my $f = $fc->next ) { |
while ( my $f = $fc->next ) { |
18 |
$present->{ $f->filename }++; |
$present->{ $f->filename }++; |
19 |
my $delete = new_action( class => 'DeletePicture' ); |
my $delete = new_action( class => 'DeletePicture' ); |
20 |
row { |
row { |
|
cell { $f->campaign->name } |
|
21 |
cell { |
cell { |
22 |
img { attr { src => "static/pics/" . $f->filename } } |
img { attr { src => "static/pics/" . $f->filename } } |
23 |
div { tt{ $f->filename } } |
div { tt{ $f->filename } } |
24 |
} |
} |
|
cell { $f->type->name } |
|
25 |
cell { |
cell { |
26 |
$delete->button( |
ul { |
27 |
submit => $delete, |
li { _("Part of campaign"), ': ', $f->campaign->name; } |
28 |
label => _('Delete'), |
li { _("Type of picture"), ': ', $f->type->name } |
29 |
arguments => { |
div { $delete->button( |
30 |
id => $f->id, |
submit => $delete, |
31 |
|
label => _('Delete'), |
32 |
|
arguments => { |
33 |
|
id => $f->id, |
34 |
|
} |
35 |
|
) |
36 |
} |
} |
37 |
) |
} |
38 |
} |
} |
39 |
} |
} |
40 |
} |
} |
46 |
next if $present->{$f}; |
next if $present->{$f}; |
47 |
my $create = new_action( class => 'CreatePicture' ); |
my $create = new_action( class => 'CreatePicture' ); |
48 |
row { |
row { |
|
cell { render_param( $create => 'campaign' ) } |
|
49 |
cell { |
cell { |
50 |
img { attr { src => "static/pics/$f" } } |
img { attr { src => "static/pics/$f" } } |
51 |
div { tt{ $f } } |
div { tt{ $f } } |
52 |
} |
} |
|
cell { render_param( $create => 'type' ) } |
|
53 |
cell { |
cell { |
54 |
|
render_param( $create => 'campaign' ); |
55 |
|
render_param( $create => 'type' ); |
56 |
$create->button( |
$create->button( |
57 |
submit => $create, |
submit => $create, |
58 |
label => _('Add'), |
label => _('Add'), |
59 |
arguments => { |
arguments => { |
60 |
filename => $f, |
filename => $f, |
61 |
} |
} |
62 |
) |
); |
63 |
} |
} |
64 |
} |
} |
65 |
} |
} |