Split subincludes out into their own /fragment controllers.
[catagits/Gitalist.git] / lib / Gitalist / URIStructure / Repository.pm
1 package Gitalist::URIStructure::Repository;
2 use MooseX::MethodAttributes::Role;
3 use Try::Tiny qw/try catch/;
4 use namespace::autoclean;
5
6 requires 'base';
7
8 after 'base' => sub {
9     my ($self, $c) = @_;
10     $c->stash(_do_not_mangle_uri_for => 1);
11 };
12
13 sub find : Chained('base') PathPart('') CaptureArgs(1) {
14     my ($self, $c, $repository) = @_;
15     try {
16         $c->stash(Repository => $c->model()->get_repository($repository));
17     }
18     catch {
19         $c->detach('/error_404');
20     };
21 }
22
23 sub summary : Chained('find') PathPart('') Args(0) {}
24
25 sub shortlog : Chained('find') Args(0) {}
26
27 sub heads : Chained('find') Args(0) {}
28
29 sub log : Chained('find') Args(0) {}
30
31 1;