6 |
use base 'Jifty::View::Declare::CRUD'; |
use base 'Jifty::View::Declare::CRUD'; |
7 |
use Jifty::View::Declare -base; |
use Jifty::View::Declare -base; |
8 |
|
|
9 |
|
use Data::Dump qw/dump/; |
10 |
|
|
11 |
sub object_type { 'Unit' }; |
sub object_type { 'Unit' }; |
12 |
|
|
13 |
sub display_columns { |
sub display_columns { |
14 |
my $self = shift; |
my $self = shift; |
15 |
return ( qw/name inv_id campaign material dimensions discovered_at description chronology location/ ); |
return ( qw/ |
16 |
|
unit_id |
17 |
|
name |
18 |
|
subcategory |
19 |
|
category |
20 |
|
site |
21 |
|
gps |
22 |
|
placement |
23 |
|
context |
24 |
|
discovery |
25 |
|
function |
26 |
|
reusage |
27 |
|
ownership |
28 |
|
presevation_place |
29 |
|
inventory_nr |
30 |
|
dimensions |
31 |
|
condition |
32 |
|
toplogy |
33 |
|
technique |
34 |
|
description |
35 |
|
construction |
36 |
|
iconography |
37 |
|
decoration |
38 |
|
motifs |
39 |
|
inscription |
40 |
|
language |
41 |
|
font |
42 |
|
author |
43 |
|
chronology |
44 |
|
chronostyle |
45 |
|
explored |
46 |
|
conservations |
47 |
|
restorations |
48 |
|
legal |
49 |
|
links |
50 |
|
sources |
51 |
|
bibliography |
52 |
|
copyright |
53 |
|
/ ); |
54 |
} |
} |
55 |
|
|
56 |
#private template search_region => sub {}; |
#private template search_region => sub {}; |
106 |
); |
); |
107 |
} else { |
} else { |
108 |
my %opt; |
my %opt; |
109 |
$opt{render_mode} = 'read' if ! $editing; |
if ( ! $editing ) { |
110 |
|
$opt{render_mode} = 'read'; |
111 |
|
# skip fields without values |
112 |
|
$opt{render_as} = 'hidden' if ! defined( $update->record->$f ); |
113 |
|
} |
114 |
render_param( $update => $f, %opt ); |
render_param( $update => $f, %opt ); |
115 |
} |
} |
116 |
}; |
}; |
148 |
form { |
form { |
149 |
|
|
150 |
foreach my $f ( $self->display_columns ) { |
foreach my $f ( $self->display_columns ) { |
151 |
last if $f eq 'material' && ! $id; |
# last if $f eq 'material' && ! $id; |
152 |
render_param( $create => $f ); # unless $f eq 'material'; |
render_param( $create => $f ); # unless $f eq 'material'; |
153 |
|
#warn "## $f"; |
154 |
} |
} |
155 |
|
|
156 |
div { |
div { |
160 |
onclick => [ |
onclick => [ |
161 |
{ |
{ |
162 |
submit => $create, |
submit => $create, |
163 |
# args => { |
# args => { |
164 |
# }, |
# }, |
165 |
}, |
}, |
166 |
{ refresh_self => 1 }, |
{ refresh_self => 1 }, |
167 |
{ |
{ |