Added site.css and started work on the commit-related navigation.
broquaint [Thu, 22 Oct 2009 16:42:18 +0000 (17:42 +0100)]
TODO
lib/Gitalist/View/Default.pm
root/static/css/site.css [new file with mode: 0644]
templates/blob.tt2
templates/commit-nav.tt2
templates/default.tt2

diff --git a/TODO b/TODO
index 852b6e1..2071fd0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,4 @@
 * Fix git_blob_plain i.e don't use the wrapper.
 * An action to find what branches have been merged, either as a list or through a search mechanism.
 * An action to find which branches a given commit is on.
+* Fix any not text/html bits e.g the patch action.
index e418acf..2c65caa 100644 (file)
@@ -34,10 +34,4 @@ __PACKAGE__->config(
        WRAPPER            => 'default.tt2',
 );
 
-# before end => sub {
-#     my ( $self, $c ) = @_;
-#     return unless $c->stash->{syntax_highlight};
-#     $c->forward( 'View::SyntaxHighlight', $c->stash->{syntax_highlight} );
-# };
-
 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
diff --git a/root/static/css/site.css b/root/static/css/site.css
new file mode 100644 (file)
index 0000000..1f46b5d
--- /dev/null
@@ -0,0 +1,6 @@
+#commit-nav {
+    margin: 10px;
+    padding-bottom: 4px;
+    border-bottom: solid 1px #ccc;
+    font-style: italic;
+}
index 44c03ed..b860c91 100644 (file)
@@ -1,3 +1,4 @@
+[% INCLUDE 'commit-nav.tt2' %]
 <link rel="stylesheet" type="text/css" href="/static/css/syntax-dark.css"/>
 <div>
 <pre class='blob'>
index 5a73ebd..34106e7 100644 (file)
@@ -1,7 +1,21 @@
-[% FOR act IN ['summary', 'shortlog', 'log', 'commit', 'commitdiff', 'tree'];
-  ' | ' UNLESS loop.first;
-  IF act == action;
-    act;
-  ELSE; -%]
-  <a href="/[% act %]">[% act %]</a>
-[% END %]
+<div id='commit-nav'>
+    [%# XXX For the record these params are wrong (i.e sha1 will probably be wrong) and the actions don't exist i.e this is a shim -%]
+    [% IF project %]
+    <a href="/summary?p=[% project %]">summary</a> |
+    [% END %]
+    [% IF c.req.param('hb') %]
+    <a href="/shortlog?h=[% c.req.param('hb') %]">shortlog</a> |
+    [% END %]
+    [% IF c.req.param('hb') %]
+    <a href="/log?h=[% c.req.param('hb') %]">log</a> |
+    [% END %]
+    [% IF c.req.param('h') %]
+    <a href="/commit?h=[% c.req.param('h') %]">commit</a> |
+    [% END %]
+    [% IF c.req.param('h') %]
+    <a href="/commitdiff?h=[% c.req.param('h') %]">commitdiff</a> |
+    [% END %]
+    [% IF t %]
+    <a href="/tree?h=[% t %]">tree</a>
+    [% END %]
+</div>
index 6d51427..c047ff5 100644 (file)
@@ -13,6 +13,7 @@
   [% IF baseurl %]
   <base href="[% baseurl %]" />
   [% END %]
+  <link rel="stylesheet" type="text/css" href="/static/css/site.css"/>
   <link rel="stylesheet" type="text/css" href="[% stylesheet %]"/>
   [% FOR link IN links %]
             <link rel="[% link.rel %]"