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

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

revision 15 by dpavlin, Fri Nov 30 16:46:39 2007 UTC revision 16 by dpavlin, Fri Nov 30 17:16:34 2007 UTC
# Line 20  sub edit_columns { Line 20  sub edit_columns {
20          return ('unit','material');          return ('unit','material');
21  }  }
22    
23    template 'list' => sub {
24        my $self = shift;
25    
26        my ( $page, $unit ) = get(qw(page unit));
27        my $item_path = get('item_path') || $self->fragment_for("view");
28            my $fragment_for_new_item = get('fragment_for_new_item') || $self->fragment_for('new_item');
29        my $collection =  $self->_current_collection();
30            # XXX show just materials from current unit
31            $collection->limit( column => 'unit', value => $unit ) if $unit;
32        div {
33                    { class is 'materials' };
34    
35                    show('./search_region');
36                    show( './paging_top',    $collection, $page );
37                    show( './list_items',    $collection, $item_path );
38                    show( './paging_bottom', $collection, $page );
39    
40                    render_region(
41                            name     => 'new_item',
42                            path     => $fragment_for_new_item,
43                            defaults => {
44                                    object_type => $self->object_type,
45                                    unit => $unit,
46                            },
47                    );
48            }
49    
50    };
51    
52  template 'view' => sub :CRUDView {  template 'view' => sub :CRUDView {
53          my $self   = shift;          my $self   = shift;
54          my $record = $self->_get_record( get('id') );          my $record = $self->_get_record( get('id') );
# Line 67  template 'new_item' => sub { Line 96  template 'new_item' => sub {
96                                  {                                  {
97                                          submit => $create,                                          submit => $create,
98                                          args => {                                          args => {
99  #                                               unit => $unit,                                                  unit => $unit,
100                                          },                                          },
101                                  },                                  },
102                                  {       refresh_self => 1       },                                  {       refresh_self => 1       },
# Line 77  template 'new_item' => sub { Line 106  template 'new_item' => sub {
106                                          args => {                                          args => {
107                                                  object_type => $object_type,                                                  object_type => $object_type,
108                                                  id => { result_of => $create, name => 'id' },                                                  id => { result_of => $create, name => 'id' },
 #                                               unit => $unit,  
109                                          },                                          },
110                                  },                                  },
111                          ],                          ],

Legend:
Removed from v.15  
changed lines
  Added in v.16

  ViewVC Help
Powered by ViewVC 1.1.26