/[Perly]/lib/Perly/View.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/Perly/View.pm

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

revision 9 by dpavlin, Tue Jun 5 11:54:18 2007 UTC revision 10 by dpavlin, Tue Jun 5 12:52:40 2007 UTC
# Line 11  template '/' => page { Line 11  template '/' => page {
11  };  };
12    
13  private template 'code_editor' => sub {  private template 'code_editor' => sub {
14            my $content;
15            my $op = 'Create';
16            my $id;
17            if ( $id = get 'id' ) {
18                    my $code = Perly::Model::Code->new();
19                    $code->load( $id ) or die "can't load $id";
20                    $content = $code->source;
21                    warn "loaded ", length( $content ), " bytes";
22                    $op = 'Update';
23            }
24          form {          form {
25                  my $action = new_action( class => 'CreateCode' );                  my $action = new_action( class => $op . 'Code', arguments => { id => $id, source => $content }, );
26                  render_param( $action => 'source', cols => 80, rows => 25, language => 'perl', render_as => 'Jifty::Plugin::CodePress::Textarea' );                  render_param( $action => 'source', cols => 80, rows => 25, language => 'perl', render_as => 'Jifty::Plugin::CodePress::Textarea' );
27                  #render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] );                  #render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] );
28                  form_submit(                  form_submit(
29                          label => _("Save my code"),                          label => _($op),
30                          onclick => [                          onclick => [
31                                  { beforeclick => "CodePress.beforeSubmit();" },                                  { beforeclick => "CodePress.beforeSubmit();" },
32                          ],                          ],

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26