Revert "Merge remote branch 't0m/json' into json"
[catagits/Gitalist.git] / lib / Gitalist / Controller / Root.pm
index a846a77..14ef8ee 100644 (file)
@@ -18,6 +18,14 @@ sub index : Chained('base') PathPart('') Args(0) {
     $c->stash( search_text => $c->req->param('s') || '' ) # FIXME - XSS?
 }
 
+# XXX Fragile much?
+sub css : Chained('/root') PathPart('core.css') Args(0) {
+    my ( $self, $c ) = @_;
+
+    $c->response->content_type('text/css');
+    $c->stash(template => 'static/css/core.css');
+}
+
 sub base : Chained('/root') PathPart('') CaptureArgs(0) {
   my($self, $c) = @_;
 
@@ -34,7 +42,7 @@ sub base : Chained('/root') PathPart('') CaptureArgs(0) {
     short_cmt => sub {
       my $cmt = shift;
       my($line) = split /\n/, $cmt;
-      $line =~ s/^(.{70,80}\b).*/$1 \x{2026}/;
+      $line =~ s/^(.{70,80}\b).*/$1 \x{2026}/ if defined $line;
       return $line;
     },
     abridged_description => sub {
@@ -50,6 +58,8 @@ sub base : Chained('/root') PathPart('') CaptureArgs(0) {
   );
 }
 
+sub search : Chained('base') Args(0) {}
+
 =head2 search_help
 
 Provides some help for the search form.