Move OPML code out of the root controller
[catagits/Gitalist.git] / lib / Gitalist / URIStructure / Repository.pm
CommitLineData
ecb0ebe7 1package Gitalist::URIStructure::Repository;
2use MooseX::MethodAttributes::Role;
3use Try::Tiny qw/try catch/;
4use namespace::autoclean;
5
6requires 'base';
7
8after 'base' => sub {
9 my ($self, $c) = @_;
10 $c->stash(_do_not_mangle_uri_for => 1);
11};
12
13sub find : Chained('base') PathPart('') CaptureArgs(1) {
12a0f9d3 14 my ($self, $c, $repos_name) = @_;
16dcb884 15 # XXX FIXME - This should be in the repository fragment controller, and the repository
16 # controller should just check has_repository
ecb0ebe7 17 try {
12a0f9d3 18 my $repos = $c->model()->get_repository($repos_name);
19 $c->stash(
20 Repository => $repos,
21 HEAD => $repos->head_hash,
22 );
ecb0ebe7 23 }
24 catch {
25 $c->detach('/error_404');
26 };
27}
28
29sub summary : Chained('find') PathPart('') Args(0) {}
30
31sub shortlog : Chained('find') Args(0) {}
32
33sub heads : Chained('find') Args(0) {}
34
35sub log : Chained('find') Args(0) {}
36
5cb2f569 37sub tags : Chained('find') Args(0) {}
38
ecb0ebe7 391;