Added /project_index action.
Dan Brook [Sat, 21 Nov 2009 00:11:52 +0000 (00:11 +0000)]
Fixed /index link in header.

lib/Gitalist/Controller/Root.pm
root/default.tt2
root/nav/actions.tt2
root/nav/search.tt2

index d6e6092..a14935a 100644 (file)
@@ -76,6 +76,20 @@ sub index :Path :Args(0) {
   );
 }
 
+sub project_index : Local {
+  my ( $self, $c ) = @_;
+
+  my @list = @{ $c->model()->projects };
+  die 'No projects found in '. $c->model->repo_dir
+    unless @list;
+
+  $c->response->content_type('text/plain');
+  $c->response->body(
+    join "\n", map $_->name, @list
+  );
+  $c->response->status(200);
+}
+
 =head2 summary
 
 A summary of what's happening in the repo.
@@ -585,10 +599,6 @@ sub auto : Private {
   );
 }
 
-sub project_index : Local {
-    # FIXME - implement snapshot
-    Carp::croak "Not implemented.";
-}
 sub opml : Local {
     # FIXME - implement snapshot
     Carp::croak "Not implemented.";
index af0ed15..7ab9716 100644 (file)
@@ -5,8 +5,8 @@
   <!-- git web interface version [% version %], (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
   <!-- git core binaries version [% git_version %] -->
   <meta charset="utf-8">
-  <meta name="generator" content="gitweb/[% version %] git/[% git_version %][% mod_perl_version %]"/>
-  <meta name="robots" content="index, nofollow"/>
+  <meta name="generator" content="gitweb/[% version %] git/[% git_version %][% mod_perl_version %]">
+  <meta name="robots" content="index, nofollow">
   <title>[%-
     title = BLOCK;
       c.config.sitename;
@@ -35,7 +35,7 @@
   <a title="git homepage" href="http://git-scm.org">
    <img src="[% c.uri_for('/logo.png') %]" alt="git" class="logo">
   </a>
-  <a href="[% c.uri_for('/') %]">A Gitalist</a>
+  <a href="[% c.uri_for('/', {p=''}) %]">A Gitalist</a>
   [%- IF Project %]
   / <a href="[% c.uri_for('summary') %]">[% Project.name %]</a>
   [% IF action;  " / " _ action; END;
index 700a5a8..81db1fb 100644 (file)
@@ -8,7 +8,7 @@
     <a href="[% c.uri_for('tree', {h=object.tree_sha1, hb=object.sha1}) %]">tree</a>
     [% END %]
     [% IF filename %]
-    ยง
+    &sect;
     <a href="[% c.uri_for('blob', {h=object.sha1,f=filename}) %]">blob</a> &bull;
     <a href="[% c.uri_for('blame', {h=object.sha1,f=filename}) %]">blame</a> &bull;
     <a href="[% c.uri_for('shortlog', {h=object.sha1,f=filename}) %]">history</a> &bull;
index 42aeaea..330a17a 100644 (file)
@@ -1,10 +1,10 @@
 <div id="page-search">
   <form method="get" action="[% c.uri_for('search') %]" enctype="application/x-www-form-urlencoded">
-  <input name="p" type="hidden" value="[% Project.name %]" />
-  <input name="a" type="hidden" value="search" />
-  <input name="h" type="hidden" value="[% commit.sha1 %]" />
-  <input name="f" type="hidden" value="[% c.req.param('f') %]" />
-  <select name="type" >
+  <input name="p" type="hidden" value="[% Project.name %]">
+  <input name="a" type="hidden" value="search">
+  <input name="h" type="hidden" value="[% commit.sha1 %]">
+  <input name="f" type="hidden" value="[% c.req.param('f') %]">
+  <select name="type">
       <option value="commit">commit</option>
       <option value="author">author</option>
       <option value="committer">committer</option>
@@ -13,7 +13,7 @@
       <option value="pickaxe">pickaxe</option>
       -->
   </select><sup><a href="[% c.uri_for('search_help') %]">?</a></sup> search:
-  <input type="text" name="text" value="[% c.req.param('s') %]"/>
-  <span title="Extended regular expression"><label><input type="checkbox" name="regexp" value="1" />re</label></span>
+  <input type="text" name="text" value="[% c.req.param('s') %]">
+  <span title="Extended regular expression"><label><input type="checkbox" name="regexp" value="1">re</label></span>
   </form>
 </div>