From: Zachary Stevens Date: Thu, 5 Nov 2009 22:38:42 +0000 (+0000) Subject: Index page fixes. X-Git-Tag: 0.000000_01~89 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e983a32efede8307c4a1416f2eb0460013830e9c;p=catagits%2FGitalist.git Index page fixes. --- diff --git a/lib/Gitalist/Controller/Root.pm b/lib/Gitalist/Controller/Root.pm index af8cfb6..3af2efd 100644 --- a/lib/Gitalist/Controller/Root.pm +++ b/lib/Gitalist/Controller/Root.pm @@ -563,7 +563,7 @@ sub end : ActionClass('RenderView') { # XXX Move this into a plugin! use DateTime::Format::Human::Duration; $c->stash->{time_since} = sub { - my($dt, $now) = ($self, DateTime->now); + my($dt, $now) = ($_[0], DateTime->now); my($age) = $dt < (DateTime->now - DateTime::Duration->new(days=>12)) ? $dt->ymd diff --git a/lib/Gitalist/Model/Git.pm b/lib/Gitalist/Model/Git.pm index 0a1f518..63a03b7 100644 --- a/lib/Gitalist/Model/Git.pm +++ b/lib/Gitalist/Model/Git.pm @@ -34,7 +34,7 @@ sub build_per_context_instance { ); # This is fugly as fuck. Move Git::PurePerl construction into attribute builders.. - my ($pd, $gd) = $model->project_dir( $model->project )->resolve =~ m{((.+?)(:?/\/\.git)?$)}; + my ($pd, $gd) = $model->project_dir( $model->project ) =~ m{((.+?)(:?/\/\.git)?$)}; $gd .= '/.git' if ($gd !~ /\.git$/ and -d "$gd/.git"); $model->gpp( Git::PurePerl->new(gitdir => $gd, directory => $pd) ); diff --git a/root/index.tt2 b/root/index.tt2 index 93ec59e..23a78e2 100644 --- a/root/index.tt2 +++ b/root/index.tt2 @@ -31,10 +31,10 @@ [% p.description.substr(0, 20) %] [% p.owner %] [% p.last_change %] - summary - | shortlog - | log - | tree + p.name}) %]">summary + | p.name}) %]">shortlog + | p.name}) %]">log + | p.name}) %]">tree [% END %] diff --git a/t/model_Git.t b/t/model_Git.t index c87d833..4598bc4 100644 --- a/t/model_Git.t +++ b/t/model_Git.t @@ -32,6 +32,7 @@ is( $projectList->[0]->{name}, 'bare.git', 'list_projects has correct name for " $m->project('repo1'); is($m->project, 'repo1', 'model project correct'); my $pd = $m->project_dir($m->project); +isa_ok($pd, 'Path::Class::Dir', 'model project_dir'); is($pd, $m->repo_dir . '/' . $m->project, 'model project_dir correct'); ok( $m->gpp(Git::PurePerl->new( gitdir => $pd, directory => $pd )), 'model gpp set ok' ); like($m->head_hash('HEAD'), qr/^([0-9a-fA-F]{40})$/, 'head_hash'); @@ -81,7 +82,6 @@ is($patch->{diff}, '--- a/file1 +bar ', 'patch->{diff} is correct'); is($patch->{dst}, '5716ca5987cbf97d6bb54920bea6adde242d87e6', 'patch->{dst} is correct'); -warn(Dumper($patch)); done_testing;