Fix up the long log, add more gravatars, fix up links and time stamps and other bits
[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
ecb0ebe7 8sub find : Chained('base') PathPart('') CaptureArgs(1) {
12a0f9d3 9 my ($self, $c, $repos_name) = @_;
16dcb884 10 # XXX FIXME - This should be in the repository fragment controller, and the repository
11 # controller should just check has_repository
ecb0ebe7 12 try {
12a0f9d3 13 my $repos = $c->model()->get_repository($repos_name);
14 $c->stash(
15 Repository => $repos,
16 HEAD => $repos->head_hash,
17 );
ecb0ebe7 18 }
19 catch {
20 $c->detach('/error_404');
21 };
22}
23
24sub summary : Chained('find') PathPart('') Args(0) {}
25
ecb0ebe7 26sub heads : Chained('find') Args(0) {}
27
5cb2f569 28sub tags : Chained('find') Args(0) {}
29
b9c202e2 30sub log : Chained('find') PathPart('') CaptureArgs(0) {}
31
32sub shortlog : Chained('log') Args(0) {}
33
34sub longlog : Chained('log') PathPart('log') Args(0) {}
35
ecb0ebe7 361;