/[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 67 by dpavlin, Tue Apr 8 23:22:22 2008 UTC revision 78 by dpavlin, Sat Apr 19 21:36:07 2008 UTC
# Line 70  template 'raw_pic' => sub { Line 70  template 'raw_pic' => sub {
70          }          }
71  };  };
72    
73    template '/index.html' => page {
74            my $units = Arh::Model::UnitCollection->new;
75            $units->unlimit;
76            $units->order_by( column => 'id', order => 'DESC' );
77    
78            my $last = get('last') || 15;
79    
80            h1 { _("Last %1 units entered", $last) };
81    
82            ol {
83                    class is 'units';
84                    for ( 1 .. $last ) {
85                            my $unit = $units->next || last;
86                            li {
87                                    outs( $unit->name, ' ' );
88                                    hyperlink(
89                                            label => $unit->unit_id,
90                                            url => '/units/single?id=' . $unit->id,
91                                    );
92                                    span { class is 'unit details';
93                                            outs join(', ', grep(defined($_),
94                                                    $unit->subcategory,
95                                                    $unit->category->name,
96                                                    $unit->location->name,
97                                                    $unit->site->name,
98                                            ));
99                                    }
100                            }
101                    }
102            }
103    
104    };
105    
106  1;  1;

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

  ViewVC Help
Powered by ViewVC 1.1.26