b73c1a5d4f1d923b66b42e131dc92a0632d617bf
[catagits/Gitalist.git] / lib / Gitalist / Controller / Fragment / Repository.pm
1 package Gitalist::Controller::Fragment::Repository;
2 use Moose;
3 use namespace::autoclean;
4
5 BEGIN { extends 'Gitalist::Controller' }
6 with qw/
7     Gitalist::URIStructure::Repository
8     Gitalist::URIStructure::Fragment::WithLog
9 /;
10
11 sub base : Chained('/fragment/base') PathPart('') CaptureArgs(0) {}
12
13 after heads => sub {
14     my ($self, $c) = @_;
15     $c->stash(
16         heads => $c->stash->{Repository}->heads,
17     );
18 };
19
20 =head2 tags
21
22 The current list of tags in the repo.
23
24 =cut
25
26 after tags => sub {
27   my ( $self, $c ) = @_;
28   $c->stash(
29     tags   => $c->stash->{Repository}->tags,
30   );
31 };
32
33 __PACKAGE__->meta->make_immutable;