Kill warnings
Tomas Doran [Sat, 7 Nov 2009 18:40:23 +0000 (18:40 +0000)]
lib/Gitalist/Controller/Root.pm
root/index.tt2

index 38f792c..9d951d4 100644 (file)
@@ -385,6 +385,9 @@ sub auto : Private {
       $line =~ s/^(.{70,80}\b).*/$1 …/;
       return $line;
     },
+    abridged_description => sub {
+        join(' ', grep { defined } (split / /, shift)[0..10]);
+    },
   );
 
   # Yes, this is hideous.
index 1304e7f..2cdd1ea 100644 (file)
@@ -38,7 +38,7 @@
     FOR p IN projects %]
     <tr class="[% Cycle.next %]">
         <td><a class="list" href="[% c.uri_for('/summary', {p=p.name}) %]">[% p.name %]</a></td>
-        <td><a class="list" title="[% p.description %]" href="[% c.uri_for('/summary', {p=p.name} ) %]">[% p.description.split(' ').slice(0, 10).join(' ') %]</a></td>
+        <td><a class="list" title="[% p.description %]" href="[% c.uri_for('/summary', {p=p.name} ) %]">[% abridged_description(p.description)  %]</a></td>
         <td>[% p.owner %]</td>
         <td class="time-since">[% time_since(p.last_change) %]</td>
         <td class="link"><a href="[% c.uri_for("summary", {p=p.name}) %]">summary</a>