/[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 17 by dpavlin, Tue Jun 5 23:45:02 2007 UTC revision 20 by dpavlin, Wed Jun 6 00:05:20 2007 UTC
# Line 35  private template 'code_list' => sub { Line 35  private template 'code_list' => sub {
35  };  };
36    
37  private template 'code_editor' => sub {  private template 'code_editor' => sub {
         my $content;  
38          my $op = 'Create';          my $op = 'Create';
39          my $id;          my $code = Perly::Model::Code->new();
40          if ( $id = get 'id' ) {          if ( my $id = get 'id' ) {
                 my $code = Perly::Model::Code->new();  
41                  $code->load( $id ) or die "can't load $id";                  $code->load( $id ) or die "can't load $id";
42                  $content = $code->source;                  warn "loaded ", length( $code->source ), " bytes";
                 warn "loaded ", length( $content ), " bytes";  
43                  $op = 'Update';                  $op = 'Update';
44          }          }
45          form {          form {
46                  my $action = new_action( class => $op . 'Code', arguments => { id => $id, source => $content }, );                  my $action = new_action( class => $op . 'Code', arguments => { $code ? $code->as_hash : undef } );
47                    render_param( $action => 'name' );
48                  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' );
49                  #render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] );                  #render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] );
50                  form_submit(                  form_submit(

Legend:
Removed from v.17  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26