Merge pull request #23 from hggh/mainifest_fix
[catagits/Gitalist.git] / lib / Gitalist / Controller / Fragment / Repository.pm
index db1557e..4f64c5c 100644 (file)
@@ -2,16 +2,14 @@ package Gitalist::Controller::Fragment::Repository;
 use Moose;
 use namespace::autoclean;
 
-BEGIN { extends 'Catalyst::Controller' }
-with 'Gitalist::URIStructure::Repository';
+BEGIN { extends 'Gitalist::Controller' }
+with qw/
+    Gitalist::URIStructure::Repository
+    Gitalist::URIStructure::Fragment::WithLog
+/;
 
 sub base : Chained('/fragment/base') PathPart('') CaptureArgs(0) {}
 
-after shortlog => sub {
-    my ($self, $c) = @_;
-    $c->forward('/shortlog');
-};
-
 after heads => sub {
     my ($self, $c) = @_;
     $c->stash(
@@ -19,12 +17,23 @@ after heads => sub {
     );
 };
 
-after log => sub {
-    my ($self, $c) = @_;
-    $c->stash(
-        template => 'log.tt2',
-    );
-    $c->forward('/log');
+=encoding UTF-8
+
+=head1 NAME
+
+Gitalist::Controller::Fragment::Repository - Fragment::Repository module for Gitalist::Controller
+
+=head2 tags
+
+The current list of tags in the repo.
+
+=cut
+
+after tags => sub {
+  my ( $self, $c ) = @_;
+  $c->stash(
+    tags   => $c->stash->{Repository}->tags,
+  );
 };
 
 __PACKAGE__->meta->make_immutable;