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

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

revision 77 by dpavlin, Fri Apr 18 16:17:31 2008 UTC revision 78 by dpavlin, Sat Apr 19 21:36:07 2008 UTC
# Line 104  template 'list' => sub { Line 104  template 'list' => sub {
104    
105  =cut  =cut
106    
107    =head2 single
108    
109    display singe unit on page, using C<id>
110    
111    =cut
112    
113    template 'single' => page {
114            my $self = shift;
115    
116            my $id = get('id') || die "no id?";
117    
118            my $item = Arh::Model::Unit->new;
119            $item->load( $id );
120            die _("Can't find item %1", $id) unless $item->id;
121    
122            title is $item->name;
123    
124            render_region(
125                    name => 'item-' . $item->id,
126                    path => $self->fragment_for('view'),
127                    defaults => { id => $item->id, object_type => $self->object_type }
128            );
129    
130    };
131    
132  private template 'paging_top' => sub {  private template 'paging_top' => sub {
133          my $self           = shift;          my $self           = shift;
134          my $collection = shift;          my $collection = shift;

Legend:
Removed from v.77  
changed lines
  Added in v.78

  ViewVC Help
Powered by ViewVC 1.1.26