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

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

revision 28 by dpavlin, Mon Dec 10 14:56:12 2007 UTC revision 36 by dpavlin, Fri Dec 14 14:44:42 2007 UTC
# Line 65  template 'view' => sub :CRUDView { Line 65  template 'view' => sub :CRUDView {
65    
66          form {          form {
67                  if ( $record->current_user_can('delete') && $self->current_user->editing ) {                  if ( $record->current_user_can('delete') && $self->current_user->editing ) {
68                          hyperlink(                          outs_raw( $delete->button(
69                                  label   => _("Delete picture"),                                  label   => _("Delete picture"),
70                                  class   => "float-crud-button button-delete",                                  class   => "float-crud-button button-delete",
71                                  onclick => {                                  onclick => {
# Line 75  template 'view' => sub :CRUDView { Line 75  template 'view' => sub :CRUDView {
75                                          refresh_self => 1,                                          refresh_self => 1,
76                                          args => { id => $id },                                          args => { id => $id },
77                                  },                                  },
78                                  as_button => 1,                          ));
                         );  
79                  };                  };
80                  img { attr { src => "/static/pics/" . $record->picture->filename } }                  img { attr { src => "/static/pics/" . $record->picture->filename } }
81                  tt{ $record->picture->filename }                  tt{ $record->picture->filename }
# Line 131  template 'new_picture' => sub { Line 130  template 'new_picture' => sub {
130  template 'fragment' => sub {  template 'fragment' => sub {
131          my ( $self, $unit ) = @_;          my ( $self, $unit ) = @_;
132    
133          warn "## unit = ", dump( $unit );          #warn "## unit = ", dump( $unit );
134    
135          my $unitpictures = Arh::Model::UnitPictureCollection->new;          my $unitpictures = Arh::Model::UnitPictureCollection->new;
136          $unitpictures->limit( column => 'unit', value => $unit->id );          $unitpictures->limit( column => 'unit', value => $unit->id );
# Line 139  template 'fragment' => sub { Line 138  template 'fragment' => sub {
138    
139          div {          div {
140                  { class is 'pictures-by-unit' };                  { class is 'pictures-by-unit' };
141            
142                  em { 'pictures for unit ', $unit->name };                  if ( $unitpictures->count ) {
143                            em { _('Pictures for unit'), ' ', $unit->name };
144                    } else {
145                            em { _('No pictures for unit'), ' ', $unit->name };
146                    }
147    
148                  set( search_collection => $unitpictures );                  set( search_collection => $unitpictures );
149                  render_region(                  render_region(
# Line 151  template 'fragment' => sub { Line 154  template 'fragment' => sub {
154                                  unit => $unit->id,                                  unit => $unit->id,
155                          }                          }
156                  );                  );
157    
158          }          }
159  };  };
160    

Legend:
Removed from v.28  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.26