--- lib/A3C/View/Organization.pm 2008/05/22 20:51:31 126 +++ lib/A3C/View/Organization.pm 2008/05/25 16:43:36 127 @@ -13,12 +13,19 @@ 'o', 'cn', 'hrEduOrgUniqueNumber', - 'hrEduOrgType', +# 'hrEduOrgType', 'postalAddress', 'l', ); } +sub create_columns { + my $self = shift; + my $action = shift; + return $action->argument_names; + #return grep { !( m/_confirm/ || $action->arguments->{$_}{unreadable} ) } $action->argument_names; +} + template 'search' => sub { my $self = shift; my ($object_type) = ( $self->object_type ); @@ -85,7 +92,7 @@ } $o->columns; #warn "# name2label = ",dump( $name2label ); - div { _('Found %1 results', $collection->pager->total_entries ) } + div { class is 'note message'; _('Found %1 results', $collection->pager->total_entries ) } table { { class is 'list' }; row { @@ -102,4 +109,25 @@ sub per_page { 10 } +# in Jifty's template, it's included on bottom of list +template 'new' => page { + my $self = shift; + + title is $self->object_type; + + my $record_class = $self->record_class; + my $action = $record_class->as_create_action; + + warn "action = ",dump( $action ); + + form { + { class is 'crud create item' }; + foreach my $field ($self->create_columns($action)) { + render_param($action, $field) ; + } + form_submit( label => _('Create') ); + } + +}; + 1;