/[A3C]/lib/A3C/View/Strix.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/View/Strix.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 199 by dpavlin, Tue Jun 17 21:32:12 2008 UTC revision 200 by dpavlin, Tue Jun 17 23:06:31 2008 UTC
# Line 137  template 'site-navigation' => page { Line 137  template 'site-navigation' => page {
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          );          );
# Line 308  template 'selected-instances' => sub { Line 313  template 'selected-instances' => sub {
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 {
# Line 375  template 'select-site' => sub { Line 381  template 'select-site' => sub {
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 );

Legend:
Removed from v.199  
changed lines
  Added in v.200

  ViewVC Help
Powered by ViewVC 1.1.26