137 |
title is _('Site navigation'); |
title is _('Site navigation'); |
138 |
|
|
139 |
render_region( |
render_region( |
140 |
|
name => 'selected-instances', |
141 |
|
path => '/strix/selected-instances' |
142 |
|
); |
143 |
|
|
144 |
|
render_region( |
145 |
name => 'select-strix-site', |
name => 'select-strix-site', |
146 |
path => '/strix/select-site' |
path => '/strix/select-site' |
147 |
); |
); |
313 |
if ( $selected->count > 0 ) { |
if ( $selected->count > 0 ) { |
314 |
|
|
315 |
my $instance = get('instance'); |
my $instance = get('instance'); |
316 |
|
warn "# selected-instances -- selected: $instance\n"; |
317 |
|
|
318 |
div { _('%1 instances selected', $selected->count ) }; |
div { _('%1 instances selected', $selected->count ) }; |
319 |
table { |
table { |
381 |
moniker => 'strix-select-site', |
moniker => 'strix-select-site', |
382 |
); |
); |
383 |
|
|
384 |
#warn "action = ", dump( $action ); |
warn "# action = ", dump( $action ); |
385 |
|
|
386 |
|
warn "# argument_values = ", dump( $action->argument_values ); |
387 |
|
|
388 |
|
if ( ! $action->argument_value('instance') ) { |
389 |
|
$action->argument_value( 'instance', get('instance') ); |
390 |
|
warn "# run action with instance\n"; |
391 |
|
$action->run; |
392 |
|
} |
393 |
|
|
394 |
|
my $magic = [ |
395 |
|
{ submit => $action, refresh_self => 1 }, |
396 |
|
# this is basically a closure |
397 |
|
{ refresh => 'selected-instances', path => '/strix/selected-instances', args => { |
398 |
|
instance => { result_of => $action, name => 'instance' } |
399 |
|
} } |
400 |
|
]; |
401 |
|
|
402 |
form { |
form { |
403 |
render_param( $action, 'instance', onchange => { submit => $action, refresh_self => 1 }, default => get('instance') ); |
render_param( $action, 'instance', onchange => $magic ); |
404 |
render_param( $action, 'site_id', onchange => { submit => $action, refresh_self => 1 } ); |
render_param( $action, 'site_id', onchange => $magic ); |
405 |
|
form_submit( label => _('Show navigation'), onclick => $magic ); |
406 |
}; |
}; |
407 |
|
|
408 |
warn "## select-site action ",dump( $action->result ); |
warn "## select-site action ",dump( $action->result ); |