add some final statistics; try to color anonymous nodes too
[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'};
732152b1 37 $c->stash->{total} = $m->{'variant_count'};
38 $c->stash->{genealogical} = $m->{'genealogical_count'};
39 $c->stash->{conflict} = $m->{'conflict_count'};
dbcf12a6 40 $c->stash->{template} = 'index.tt';
41}
42
43=head2 default
44
45Standard 404 error page
46
47=cut
48
49sub default :Path {
50 my ( $self, $c ) = @_;
51 $c->response->body( 'Page not found' );
52 $c->response->status(404);
53}
54
55=head2 end
56
57Attempt to render a view, if needed.
58
59=cut
60
61sub end : ActionClass('RenderView') {}
62
63=head1 AUTHOR
64
65Tara L Andrews
66
67=head1 LICENSE
68
69This library is free software. You can redistribute it and/or modify
70it under the same terms as Perl itself.
71
72=cut
73
74__PACKAGE__->meta->make_immutable;
75
761;