X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FController%2FFragment%2FRef.pm;h=914eed9341fbdedb54301d1c26110a756d80e87e;hb=0fb64eae10cb9b1a908108a0a1ae32904d50e0fe;hp=42ed0ae60ee6a7c0438e335feba7e31bc910b357;hpb=be63265e2f21fc0b1bf24aac09ffa8706b7fd5f0;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Controller/Fragment/Ref.pm b/lib/Gitalist/Controller/Fragment/Ref.pm index 42ed0ae..914eed9 100644 --- a/lib/Gitalist/Controller/Fragment/Ref.pm +++ b/lib/Gitalist/Controller/Fragment/Ref.pm @@ -28,14 +28,14 @@ sub _diff { diff => $patch, # XXX Hack hack hack, see View::SyntaxHighlight blobs => [map $_->{diff}, @$patch], - language => 'Diff', + %filename, ); } after diff_fancy => sub { my ($self, $c) = @_; $self->_diff($c); - $c->forward('View::SyntaxHighlight'); + $c->forward('Model::ContentMangler'); }; after diff_plain => sub { @@ -65,12 +65,10 @@ after blame => sub { my $blame = $c->stash->{Commit}->blame($c->stash->{filename}, $c->stash->{Commit}->sha1); $c->stash( blame => $blame, - # XXX Hack hack hack, see View::SyntaxHighlight - language => ($c->stash->{filename} =~ /\.p[lm]$/i ? 'Perl' : ''), blob => join("\n", map $_->{line}, @$blame), ); - $c->forward('View::SyntaxHighlight') + $c->forward('Model::ContentMangler') unless $c->stash->{no_wrapper}; }; @@ -83,13 +81,11 @@ The blob action i.e the contents of a file. after blob => sub { my ( $self, $c ) = @_; $c->stash( - # XXX Hack hack hack, see View::SyntaxHighlight - language => ($c->stash->{filename} =~ /\.p[lm]$/i ? 'Perl' : ''), is_image => File::Type::WebImages::mime_type($c->stash->{blob}), is_binary => Gitalist::Utils::is_binary($c->stash->{blob}), ); - $c->forward('View::SyntaxHighlight') + $c->forward('Model::ContentMangler') unless $c->stash->{no_wrapper}; };