Start using the subinclude plugin and splitting things up.
[catagits/Gitalist.git] / lib / Gitalist / Controller / Repository.pm
CommitLineData
28d48c6e 1package Gitalist::Controller::Repository;
2
3use Moose;
4use Moose::Autobox;
5use Try::Tiny qw/try catch/;
6use namespace::autoclean;
7
8BEGIN { extends 'Catalyst::Controller' }
9
16bdb8df 10sub base : Chained('/root') PathPart('') CaptureArgs(0) {
11 my ($self, $c) = @_;
12 $c->stash(_do_not_mangle_uri_for => 1);
13}
28d48c6e 14
15sub find : Chained('base') PathPart('') CaptureArgs(1) {
16 my ($self, $c, $repository) = @_;
17 try {
18 $c->stash(Repository => $c->model()->get_repository($repository));
19 }
20 catch {
21 $c->detach('/error_404');
22 };
23}
24
16bdb8df 25sub summary : Chained('find') PathPart('') Args(0) {}
28d48c6e 26
27sub shortlog : Chained('find') Args(0) {
28 my ($self, $c) = @_;
16bdb8df 29 $c->stash(no_wrapper => 1);
28d48c6e 30 $c->forward('/shortlog');
31}
32
f6a72048 33sub log : Chained('find') Args(0) {
34 my ($self, $c) = @_;
35 $c->stash(template => 'log.tt2');
36 $c->forward('/log');
37}
38
28d48c6e 39__PACKAGE__->meta->make_immutable;