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

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

revision 28 by dpavlin, Mon Dec 10 14:56:12 2007 UTC revision 58 by dpavlin, Mon Apr 7 09:11:56 2008 UTC
# Line 6  use warnings; Line 6  use warnings;
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 {};
# Line 66  template 'view' => sub :CRUDView { Line 106  template 'view' => sub :CRUDView {
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                  };                  };
# Line 104  template 'new_item' => sub { Line 148  template 'new_item' => sub {
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 {
# Line 115  template 'new_item' => sub { Line 160  template 'new_item' => sub {
160                                  onclick => [                                  onclick => [
161                                          {                                          {
162                                                  submit => $create,                                                  submit => $create,
163          #                                       args => {  #                                               args => {
164          #                                       },  #                                               },
165                                          },                                          },
166                                          {       refresh_self => 1       },                                          {       refresh_self => 1       },
167                                          {                                          {

Legend:
Removed from v.28  
changed lines
  Added in v.58

  ViewVC Help
Powered by ViewVC 1.1.26