some more look and feel tweaks
[scpubgit/stemmatology.git] / TreeOfTexts / lib / TreeOfTexts / Controller / Root.pm
CommitLineData
dbcf12a6 1package TreeOfTexts::Controller::Root;
2use Moose;
3use namespace::autoclean;
4use TreeOfTexts::Model::Analysis qw/ run_analysis /;
5
6BEGIN { extends 'Catalyst::Controller' }
7
8#
9# Sets the actions in this controller to be registered with no prefix
10# so they function identically to actions created in MyApp.pm
11#
12__PACKAGE__->config(namespace => '');
13
14=head1 NAME
15
16TreeOfTexts::Controller::Root - Root Controller for TreeOfTexts
17
18=head1 DESCRIPTION
19
20[enter your description here]
21
22=head1 METHODS
23
24=head2 index
25
26The root page (/)
27
28=cut
29
30sub index :Path :Args(0) {
31 my ( $self, $c ) = @_;
32
eb20780f 33 my $m = $c->model('Analysis');
34 $c->stash->{svg} = $m->{'svg'};
35 $c->stash->{variants} = $m->{'variants'};
0a8f09a9 36 $c->stash->{text_title} = $m->{'title'};
dbcf12a6 37 $c->stash->{template} = 'index.tt';
38}
39
40=head2 default
41
42Standard 404 error page
43
44=cut
45
46sub default :Path {
47 my ( $self, $c ) = @_;
48 $c->response->body( 'Page not found' );
49 $c->response->status(404);
50}
51
52=head2 end
53
54Attempt to render a view, if needed.
55
56=cut
57
58sub end : ActionClass('RenderView') {}
59
60=head1 AUTHOR
61
62Tara L Andrews
63
64=head1 LICENSE
65
66This library is free software. You can redistribute it and/or modify
67it under the same terms as Perl itself.
68
69=cut
70
71__PACKAGE__->meta->make_immutable;
72
731;