1 package SGN
::Controller
::Folder
;
6 use SGN
::Model
::Cvterm
;
8 use CXGN
::Trial
::Folder
;
10 BEGIN { extends
'Catalyst::Controller'; }
14 isa
=> 'DBIx::Class::Schema',
18 shift->_app->dbic_schema( 'Bio::Chado::Schema', 'sgn_chado' )
21 sub folder_page
:Path
("/folder") Args
(1) {
24 my $folder_id = shift;
26 #print STDERR Dumper $folder_id;
28 my $folder_project = $self->schema->resultset("Project::Project")->find( { project_id
=> $folder_id } );
29 my $folder = CXGN
::Trial
::Folder
->new({ bcs_schema
=> $self->schema, folder_id
=> $folder_id });
31 $c->stash->{children
} = $folder->children();
32 $c->stash->{project_parent
} = $folder->project_parent();
33 $c->stash->{breeding_program
} = $folder->breeding_program();
34 $c->stash->{folder_id
} = $folder_id;
35 $c->stash->{folder_name
} = $folder_project->name();
36 $c->stash->{folder_description
} = $folder_project->description();
37 if (!$folder->breeding_program) {
38 $c->stash->{message
} = "The requested folder does not exist or has been deleted.";
39 $c->stash->{template
} = 'generic_message.mas';
42 $c->stash->{template
} = '/breeders_toolbox/folder/folder.mas';