Index page fixes.
Zachary Stevens [Thu, 5 Nov 2009 22:38:42 +0000 (22:38 +0000)]
lib/Gitalist/Controller/Root.pm
lib/Gitalist/Model/Git.pm
root/index.tt2
t/model_Git.t

index af8cfb6..3af2efd 100644 (file)
@@ -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
index 0a1f518..63a03b7 100644 (file)
@@ -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) );
 
index 93ec59e..23a78e2 100644 (file)
         <td><a class="list" title="[% p.description %]" href="[% c.uri_for('/summary', { 'p' => p.name } ) %]">[% p.description.substr(0, 20) %]</a></td>
         <td>[% p.owner %]</td>
         <td class="age2">[% p.last_change %]</td>
-        <td class="link"><a href="[% c.uri_for("summary") %]">summary</a>
-            | <a href="[% c.uri_for("shortlog") %]">shortlog</a>
-            | <a href="[% c.uri_for("log") %]">log</a>
-            | <a href="[% c.uri_for("tree") %]">tree</a></td>
+        <td class="link"><a href="[% c.uri_for("summary", {'p' => p.name}) %]">summary</a>
+            | <a href="[% c.uri_for("shortlog", {'p' => p.name}) %]">shortlog</a>
+            | <a href="[% c.uri_for("log", {'p' => p.name}) %]">log</a>
+            | <a href="[% c.uri_for("tree", {'p' => p.name}) %]">tree</a></td>
     </tr>
   [% END %]
 </tbody>
index c87d833..4598bc4 100644 (file)
@@ -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;