Merge pull request #5230 from solgenomics/topic/open_pollinated
[sgn.git] / lib / SGN / Controller / Static.pm
blobf98010a6f94129d7da24774b94c6a955b9fa1591
3 =head1 NAME
5 SGN::Controller::Static - a controller for dispatching to static pages
7 =head1 DESCRIPTION
9 SGN has some static pages that don't merit their own controller. The purpose of this one is to have one common controller for all the static pages that don't fit anywhere else.
11 Please feel free to add your own pages. The actions should essentially just link to a mason component for display.
13 =head1 AUTHOR
15 Lukas Mueller <lam87@cornell.edu>
17 =cut
20 package SGN::Controller::Static;
22 use Moose;
24 BEGIN { extends 'Catalyst::Controller'; }
27 sub mason_forward :Path('/pages') Args(1) {
28 my $self = shift;
29 my $c = shift;
30 my $page = shift;
32 print STDERR "Forwarding to $page...\n";
34 my $sp_person_id = $c->user() ? $c->user->get_object()->get_sp_person_id() : undef;
35 $c->stash->{schema} = $c->dbic_schema("Bio::Chado::Schema", undef, $sp_person_id);
36 $c->stash->{template} = '/pages/'.$page.".mas";
39 sub mason_forward_with_subfolder :Path('/pages/') Args(2) {
40 my $self = shift;
41 my $c = shift;
42 my $subfolder = shift;
43 my $page = shift;
45 print STDERR "Forwarding to $subfolder, $page...\n";
46 my $sp_person_id = $c->user() ? $c->user->get_object()->get_sp_person_id() : undef;
47 $c->stash->{schema} = $c->dbic_schema("Bio::Chado::Schema", undef, $sp_person_id);
48 $c->stash->{template} = '/pages/'.$subfolder."/".$page.".mas";
51 sub list_all_uploads :Path('/breeders/list_all_uploads') Args(0) {
52 my $self = shift;
53 my $c = shift;
54 $c->stash->{template} = '/breeders_toolbox/complete_upload_list.mas';
57 sub ethz_cass_sync :Path('/ethz_cass/sync/') :Args(0) {
58 my $self = shift;
59 my $c = shift;
60 #This mason component is in cassbase git repo.
61 $c->stash->{template} = '/stock/ethz_cass_sync.mas';
64 sub projects_forward :Path('/projects') Args(1) {
65 my $self = shift;
66 my $c = shift;
67 my $page = shift;
69 print STDERR "Forwarding to $page...\n";
70 $c->stash->{template} = '/projects/'.$page.".mas";
73 sub test_authentication :Path('/test_authentication/') :Args(0) {
74 my $self = shift;
75 my $c = shift;
76 $c->stash->{template} = '/test/test_authenticate.mas';
79 sub progress :Path('/progress') Args(0) {
80 my $self = shift;
81 my $c = shift;
82 $c->stash->{template} = '/breeders_toolbox/progress.mas';
86 sub solanaceae_project_afri :Path('/solanaceae-project/afri-sol/') {
87 my ($self, $c) = @_;
88 $c->stash->{template} = '/links/afri_sol.mas';
92 sub sgn_events :Path('/sgn-events/') {
93 my ($self, $c) = @_;
94 $c->stash->{template} = '/homepage/sgn_events.mas';
98 sub phenotype_select : Path('/phenome/select') {
99 my ($self, $c) = @_;
101 $c->stash->{template} = '/phenome/select.mas';
106 sub list_test : Path('/list/test') {
107 my ($self, $c) = @_;
109 $c->stash->{template}= '/list/index.mas';
110 $c->stash->{user_id} = $c->user();
113 sub usage_policy : Path('/usage_policy') {
114 my ($self, $c) = @_;
115 $c->stash->{template} = '/usage_policy.mas';
118 sub radargraph : Path('/radargraph') {
119 my $self = shift;
120 my $c = shift;
122 $c->stash->{template}='/breeders_toolbox/radargraph.mas';
125 sub ted : Path('/ted') Args(0) {
126 my ($self, $c) = @_;
127 my $uri = $c->request->uri->as_string();
129 my ($protocol, $empty, $server, $ted, @rest) = split "/", $uri;
131 $c->stash->{page_title} = "Tomato Expression Database";
132 $c->stash->{param_string} = join "/", @rest;
133 $c->stash->{server} = 'ted.sgn.cornell.edu';
134 $c->stash->{port} = "80"; # get this from conf...
135 $c->stash->{template} = '/site/iframe.mas';