requires 'Catalyst::Plugin::Unicode::Encoding';
requires 'Catalyst::Action::RenderView';
requires 'Catalyst::Component::InstancePerContext';
+requires 'Catalyst::View::Component::SubInclude' => '0.07';
requires 'Catalyst::View::TT';
requires 'Template';
Unicode::Encoding
Static::Simple
StackTrace
+ SubRequest
/;
our $VERSION = '0.000005';
around uri_for => sub {
my ($orig, $c) = (shift, shift);
- my $repository_name = $c->stash->{'Repository'} && $c->stash->{'Repository'}->name;
my $hash = ref($_[-1]) eq 'HASH' ? pop @_ : {};
- my $params = Catalyst::Utils::merge_hashes(
- { p => $hash->{p} || $repository_name },
- $hash,
- );
- delete $params->{p} unless defined $params->{p} && length $params->{p};
- (my $uri = $c->$orig(@_, $params))
- =~ tr[&][;];
+ my $params;
+ if ($c->stash->{_do_not_mangle_uri_for}) {
+ $params = $hash;
+ }
+ else {
+ my $repository_name = $c->stash->{'Repository'} && $c->stash->{'Repository'}->name;
+ $params = Catalyst::Utils::merge_hashes(
+ { p => $hash->{p} || $repository_name },
+ $hash,
+ );
+ delete $params->{p} unless defined $params->{p} && length $params->{p};
+ }
+ my $uri = $c->$orig(@_, $params);
+ $$uri =~ tr[&][;];
return $uri;
};
BEGIN { extends 'Catalyst::Controller' }
-sub base : Chained('/root') PathPart('') CaptureArgs(0) {}
+sub base : Chained('/root') PathPart('') CaptureArgs(0) {
+ my ($self, $c) = @_;
+ $c->stash(_do_not_mangle_uri_for => 1);
+}
sub find : Chained('base') PathPart('') CaptureArgs(1) {
my ($self, $c, $repository) = @_;
};
}
-sub summary : Chained('find') PathPart('') Args(0) {
- my ($self, $c) = @_;
- $c->stash(template => 'summary.tt2');
- $c->forward('/summary');
-}
+sub summary : Chained('find') PathPart('') Args(0) {}
sub shortlog : Chained('find') Args(0) {
my ($self, $c) = @_;
- $c->stash(template => 'shortlog.tt2');
+ $c->stash(no_wrapper => 1);
$c->forward('/shortlog');
}
use namespace::autoclean;
extends 'Catalyst::View::TT';
+with 'Catalyst::View::Component::SubInclude';
use Template::Plugin::Cycle;
__PACKAGE__->config(
TEMPLATE_EXTENSION => '.tt2',
WRAPPER => 'default.tt2',
+ subinclude_plugin => 'SubRequest',
);
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
--- /dev/null
+<div class='content'>
+[%
+ INCLUDE '_log_pager.tt2';
+ INCLUDE '_shortlog.tt2';
+ INCLUDE '_log_pager.tt2';
+%]
+</div>
--- /dev/null
+[% PROCESS 'nav/actions.tt2' object = commit %]
+
+<div class='summary content'>
+ <dl>
+ <dt>description</dt><dd>[% Repository.description %]</dd>
+ <dt>owner</dt><dd>[% Repository.owner %]</dd>
+ <dt>last change</dt><dd>[% Repository.last_change %]</dd>
+ </dl>
+
+ <h2><a href='[% c.uri_for(c.controller.action_for('shortlog'), c.req.captures) %]'>shortlog</a></h2>
+ [% subinclude('/repository/shortlog', c.req.captures) %]
+
+ <h2><a href='[% c.uri_for(c.controller.action_for('heads'), c.req.captures) %]'>branches</a></h2>
+ [% subinclude('/repository/heads', c.req.captures) %]
+</div>