Fixed bug in /summary where repos with < 10 branches display empty branches.
Dan Brook [Wed, 11 Nov 2009 16:35:18 +0000 (16:35 +0000)]
Reinstated project summary on /summary. Still needs tightening up though.

lib/Gitalist/Controller/Root.pm
root/summary.tt2

index 289c9e6..de67ad3 100644 (file)
@@ -123,7 +123,7 @@ sub summary : Local {
         count => $maxitems,
     )],
     refs      => $project->references,
-    heads     => [ @heads[0 .. $maxitems] ],
+    heads     => [ @heads[0 .. ($#heads < $maxitems ? $#heads : $maxitems)] ],
     action    => 'summary',
   );
 }
index a792220..fc9118d 100644 (file)
@@ -1,7 +1,15 @@
 [% PROCESS 'nav/actions.tt2' object = head %]
 
+<div class='summary'>
+<dl>
+<dt>description</dt><dd>[% info.description %]</dd>
+<dt>owner</dt><dd>[% info.owner %]</dd>
+<dt>last change</dt><dd>[% info.last_change %]</dd>
+</dl>
+</div>
+
 <h2><a href='[% c.uri_for("shortlog") %]'>shortlog</a></h2>
 [% INCLUDE '_shortlog.tt2' %]
 
-<h2><a href='[% c.uri_for("heads") %]'>heads</a></h2>
+<h2><a href='[% c.uri_for("heads") %]'>branches</a></h2>
 [% INCLUDE '_heads.tt2' %]