1 |
package A3C::View::Organization; |
package A3C::View::Organization; |
2 |
|
|
3 |
|
=head1 NAME |
4 |
|
|
5 |
|
A3C::View::Organization |
6 |
|
|
7 |
|
=head1 DESCRIPTION |
8 |
|
|
9 |
|
Provide search and display form using table |
10 |
|
|
11 |
|
=cut |
12 |
|
|
13 |
use strict; |
use strict; |
14 |
use warnings; |
use warnings; |
15 |
|
|
119 |
|
|
120 |
sub per_page { 10 } |
sub per_page { 10 } |
121 |
|
|
|
# in Jifty's template, it's included on bottom of list |
|
122 |
template 'new' => page { |
template 'new' => page { |
123 |
my $self = shift; |
my $self = shift; |
|
|
|
124 |
title is $self->object_type; |
title is $self->object_type; |
|
|
|
|
my $record_class = $self->record_class; |
|
|
my $action = $record_class->as_create_action; |
|
|
|
|
|
#warn "action = ",dump( $action ); |
|
|
|
|
125 |
form { |
form { |
126 |
{ class is 'crud create item' }; |
render_region( |
127 |
foreach my $field ($self->create_columns($action)) { |
name => $self->object_type.'-list', |
128 |
render_param($action, $field) ; |
path => $self->fragment_base_path.'/new-list' |
129 |
} |
); |
|
form_submit( label => _('Create') ); |
|
130 |
} |
} |
131 |
|
}; |
132 |
|
|
133 |
|
# in Jifty's template, it's included on bottom of list |
134 |
|
template 'new-list' => sub { |
135 |
|
div { |
136 |
|
{ class is 'list' }; |
137 |
|
} |
138 |
|
show( './new_item_region'); |
139 |
}; |
}; |
140 |
|
|
141 |
1; |
1; |