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

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

revision 7 by dpavlin, Thu Nov 29 15:13:10 2007 UTC revision 8 by dpavlin, Thu Nov 29 16:08:13 2007 UTC
# Line 17  template '/pictures' => page { Line 17  template '/pictures' => page {
17                          while ( my $f = $fc->next ) {                          while ( my $f = $fc->next ) {
18                                  $present->{ $f->filename }++;                                  $present->{ $f->filename }++;
19                                  my $delete = new_action( class => 'DeletePicture' );                                  my $delete = new_action( class => 'DeletePicture' );
20                                    my $update = new_action( class => 'UpdatePicture', record => $f );
21                                  row {                                  row {
22                                          cell {                                          cell {
23                                                  img { attr { src => "static/pics/" . $f->filename } }                                                  img { attr { src => "static/pics/" . $f->filename } }
24                                                  div { tt{ $f->filename } }                                                  div { tt{ $f->filename } }
25                                          }                                          }
26                                          cell {                                          cell {
27                                                  ul {                                                  render_param( $update => 'campaign', render_mode => 'read' );
28                                                          li { _("Part of campaign"), ': ',  $f->campaign->name; }                                                  render_param( $update => 'type', render_mode => 'read' );
29                                                          li { _("Type of picture"), ': ', $f->type->name }                                                  div {
30                                                          div { $delete->button(                                                          $delete->button(
31                                                                          submit => $delete,                                                                  submit => $delete,
32                                                                          label => _('Delete'),                                                                  label => _('Delete'),
33                                                                          arguments => {                                                                  arguments => {
34                                                                                  id => $f->id,                                                                          id => $f->id,
35                                                                          }                                                                  }
36                                                                  )                                                          )
                                                         }  
37                                                  }                                                  }
38                                          }                                          }
39                                  }                                  }
# Line 68  template '/pictures' => page { Line 68  template '/pictures' => page {
68    
69  };  };
70    
71    template '/units' => page {
72            h1 { _("Units available in system") };
73    
74            my $units = Arh::Model::UnitCollection->new;
75            $units->unlimit;
76    
77            while ( my $u = $units->next ) {
78                    unit( $u );
79            }
80    };
81    
82    sub unit {
83            my $unit = shift || die "no unit?";
84            my $a = new_action( class => 'UpdateUnit', record => $unit );
85            form {
86                    foreach my $f ( qw/name number material dimensions position description chronology/ ) {
87                            if ( $f eq 'material' ) {
88                                    my $material = $unit->material;
89                                    while ( my $um = $material->next ) {
90                                            my $m = new_action( class => 'UpdateMaterial', record => $um->material );
91                                            render_param( $m => 'name', label => _("Material"), render_mode => 'read' );
92                                    }
93                            } else {
94                                    render_param( $a => $f, render_mode => 'read' );
95                            }
96                    }
97            }
98    }
99    
100  1;  1;

Legend:
Removed from v.7  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26