From: broquaint Date: Tue, 3 Nov 2009 10:34:23 +0000 (+0000) Subject: Fixed links on the /index action and broken times in the shortlog. X-Git-Tag: 0.000000_01~85^2~2^2~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c1f608c8cae343e4a0f953bab31246c1a446bd2e;p=catagits%2FGitalist.git Fixed links on the /index action and broken times in the shortlog. --- diff --git a/lib/Gitalist.pm b/lib/Gitalist.pm index 8b0cee5..afad99f 100644 --- a/lib/Gitalist.pm +++ b/lib/Gitalist.pm @@ -27,9 +27,10 @@ __PACKAGE__->setup(); around uri_for => sub { my ($orig, $c) = (shift, shift); + my $hash = ref($_[-1]) eq 'HASH' ? pop @_ : {}; my $params = Catalyst::Utils::merge_hashes( - { p => $c->model('Git')->project }, - ref($_[-1]) eq 'HASH' ? pop @_ : {} + { p => $hash->{p} || $c->model()->project }, + $hash, ); (my $uri = $c->$orig(@_, $params)) =~ tr[&][;]; diff --git a/lib/Gitalist/Controller/Root.pm b/lib/Gitalist/Controller/Root.pm index af0f86b..f576ca7 100644 --- a/lib/Gitalist/Controller/Root.pm +++ b/lib/Gitalist/Controller/Root.pm @@ -61,7 +61,7 @@ sub run_gitweb { sub _get_commit { my($self, $c, $haveh) = @_; - my $h = $haveh || $c->req->param('h'); + my $h = $haveh || $c->req->param('h') || ''; my $f = $c->req->param('f'); my $m = $c->model(); @@ -564,9 +564,8 @@ sub end : ActionClass('RenderView') { my($age) = $dt < (DateTime->now - DateTime::Duration->new(days=>12)) ? $dt->ymd : DateTime::Format::Human::Duration->new->format_duration($now - $dt) - =~ /^(?:.*?weeks?, )?(\d+ [^\d]+)(?:,|$) /; + =~ /^(?:.*?weeks?, )?(\d+ [^\d]+)(?:,| and|$)/; - return $age; }; } diff --git a/root/index.tt2 b/root/index.tt2 index 93ec59e..227dcf6 100644 --- a/root/index.tt2 +++ b/root/index.tt2 @@ -27,14 +27,14 @@ USE Cycle('dark', 'light'); FOR p IN projects %] - [% p.name %] - [% p.description.substr(0, 20) %] + [% p.name %] + [% p.description.substr(0, 20) %] [% p.owner %] [% p.last_change %] - summary - | shortlog - | log - | tree + summary + | shortlog + | log + | tree [% END %]