88 |
return unless $self->current_user->editing; |
return unless $self->current_user->editing; |
89 |
|
|
90 |
my ( $id, $unit ) = get(qw(id unit)); |
my ( $id, $unit ) = get(qw(id unit)); |
91 |
my $record_class = $self->record_class; |
warn "## unit $id $unit"; |
92 |
my $create = $record_class->as_create_action( |
|
93 |
|
# my $record_class = $self->record_class; |
94 |
|
# warn "## new_picture record_class: $record_class\n"; |
95 |
|
# my $create = $record_class->as_create_action( |
96 |
|
|
97 |
|
my $create = new_action( |
98 |
|
class => 'UploadPicture', |
99 |
moniker => "create-" . Jifty->web->serial, |
moniker => "create-" . Jifty->web->serial, |
100 |
); |
); |
|
warn "## unit $unit"; |
|
101 |
|
|
102 |
my $attach_to = |
my $attach_to = |
103 |
Jifty->web->current_region->parent ? |
Jifty->web->current_region->parent ? |
107 |
warn "## attach_to = $attach_to"; |
warn "## attach_to = $attach_to"; |
108 |
|
|
109 |
form { |
form { |
110 |
render_param($create => 'picture'); |
{ class is 'create-picture' }; |
111 |
|
render_action( $create => [ 'campaign', 'content', 'type' ] ); |
112 |
outs_raw( $create->hidden( unit => $unit ) ); |
outs_raw( $create->hidden( unit => $unit ) ); |
113 |
hyperlink( |
hyperlink( |
114 |
label => _("Add picture"), |
label => _("Add picture"), |
144 |
|
|
145 |
div { |
div { |
146 |
{ class is 'pictures-by-unit' }; |
{ class is 'pictures-by-unit' }; |
147 |
|
|
148 |
em { 'pictures for unit ', $unit->name }; |
if ( $unitpictures->count ) { |
149 |
|
em { _('Pictures for unit'), ' ', $unit->name }; |
150 |
|
} else { |
151 |
|
em { _('No pictures for unit'), ' ', $unit->name }; |
152 |
|
} |
153 |
|
|
154 |
set( search_collection => $unitpictures ); |
set( search_collection => $unitpictures ); |
155 |
render_region( |
render_region( |
160 |
unit => $unit->id, |
unit => $unit->id, |
161 |
} |
} |
162 |
); |
); |
163 |
|
|
164 |
} |
} |
165 |
}; |
}; |
166 |
|
|