24 |
while ( my $code = $coll->next ) { |
while ( my $code = $coll->next ) { |
25 |
li { |
li { |
26 |
a { |
a { |
27 |
attr { href => '/edit?id=' . $code->id, }, |
attr { href => '/edit/id=' . $code->id, }, |
28 |
$code->name, |
$code->name, |
29 |
}, |
}, |
30 |
small { length( $code->source ), ' bytes ', $code->created_on }, |
small { length( $code->source ), ' bytes ', $code->created_on }, |
31 |
a { |
a { |
32 |
attr { href => '/run?code=' . $code->id, }, 'run' |
attr { href => '/run/code=' . $code->id, }, 'run' |
33 |
}, |
}, |
34 |
pre { $code->source }, |
pre { $code->source }, |
35 |
} |
} |
56 |
{ beforeclick => "CodePress.beforeSubmit();" }, |
{ beforeclick => "CodePress.beforeSubmit();" }, |
57 |
], |
], |
58 |
); |
); |
59 |
|
form_next_page( url => '/run/code=' . $action->argument_value('id') ); |
60 |
} |
} |
61 |
}; |
}; |
62 |
|
|
72 |
}; |
}; |
73 |
|
|
74 |
template '/run' => page { |
template '/run' => page { |
75 |
my $action = new_action( class => 'Run', arguments => { input => get('input'), code => get('code') } ); |
my $action = new_action( class => 'Run', arguments => { |
76 |
|
input => get('input'), |
77 |
|
code => get('code'), |
78 |
|
} ); |
79 |
|
warn "code = ",get('code'), " input = ", get('input'), dump( $action ); |
80 |
h1 { _("Run code on some input") }, |
h1 { _("Run code on some input") }, |
81 |
form { |
form { |
82 |
render_action( $action => [ 'input', 'code' ] ); |
render_action( $action => [ 'input', 'code' ] ); |