130 |
template 'fragment' => sub { |
template 'fragment' => sub { |
131 |
my ( $self, $unit ) = @_; |
my ( $self, $unit ) = @_; |
132 |
|
|
133 |
warn "## unit = ", dump( $unit ); |
#warn "## unit = ", dump( $unit ); |
134 |
|
|
135 |
my $unitpictures = Arh::Model::UnitPictureCollection->new; |
my $unitpictures = Arh::Model::UnitPictureCollection->new; |
136 |
$unitpictures->limit( column => 'unit', value => $unit->id ); |
$unitpictures->limit( column => 'unit', value => $unit->id ); |
138 |
|
|
139 |
div { |
div { |
140 |
{ class is 'pictures-by-unit' }; |
{ class is 'pictures-by-unit' }; |
141 |
|
|
142 |
em { 'pictures for unit ', $unit->name }; |
if ( $unitpictures->count ) { |
143 |
|
em { _('Pictures for unit'), ' ', $unit->name }; |
144 |
|
} else { |
145 |
|
em { _('No pictures for unit'), ' ', $unit->name }; |
146 |
|
} |
147 |
|
|
148 |
set( search_collection => $unitpictures ); |
set( search_collection => $unitpictures ); |
149 |
render_region( |
render_region( |
154 |
unit => $unit->id, |
unit => $unit->id, |
155 |
} |
} |
156 |
); |
); |
157 |
|
|
158 |
} |
} |
159 |
}; |
}; |
160 |
|
|