login

<     >

2022-02-27 00:12:11 (UTC-03:00)

Marcel Rodrigues <marcelgmr@gmail.com>

improve navigation

diff --git a/view/commit.html b/view/commit.html
index 456b8ec..4be34f6 100644
--- a/view/commit.html
+++ b/view/commit.html
@@ -5,22 +5,17 @@
   <title>cogit - {{$gname}} - {{$rname}} - {{$cid}}</title>
 </head>
 <body>
-  <a href="/">home</a>
-  &gt;
-  <a href="/group/{{$gname}}">{{$gname}}</a>
-  &gt;
-  <a href="/group/{{$gname}}/repo/{{$rname}}">{{$rname}}</a>
-  &gt;
-  <a href="/group/{{$gname}}/repo/{{$rname}}/history/{{$cid}}">history</a>
-  &gt;
-  {{$cid}}
-  <br>
-  <p>{{$time_str}}</p>
-  <p>{{$sig.name}} &lt;{{$sig.email}}&gt;</p>
-  <pre>{{$commit:message()}}</pre>
-  <hr>
-  <pre>{{$diff}}</pre>
-  <br>
+  <p>
+    <a href="/">home</a>
+    &gt;
+    <a href="/group/{{$gname}}">{{$gname}}</a>
+    &gt;
+    <a href="/group/{{$gname}}/repo/{{$rname}}">{{$rname}}</a>
+    &gt;
+    <a href="/group/{{$gname}}/repo/{{$rname}}/history/{{$cid}}">history</a>
+    &gt;
+    {{$cid}}
+  </p>
   % if $prev then
   <a href="/group/{{$gname}}/repo/{{$rname}}/commit/{{$prev:id()}}">&lt</a>
   % else
@@ -32,5 +27,11 @@
   % else
   &gt
   % end
+  <br>
+  <p>{{$time_str}}</p>
+  <p>{{$sig.name}} &lt;{{$sig.email}}&gt;</p>
+  <pre>{{$commit:message()}}</pre>
+  <hr>
+  <pre>{{$diff}}</pre>
 </body>
 </html>

diff --git a/view/group.html b/view/group.html
index 325377e..b3a911f 100644
--- a/view/group.html
+++ b/view/group.html
@@ -5,9 +5,12 @@
   <title>cogit - {{$gname}}</title>
 </head>
 <body>
-  <a href="/">home</a>
-  &gt;
-  {{$gname}}
+  <p>
+    <a href="/">home</a>
+    &gt;
+    {{$gname}}
+  </p>
+  <p>Repos</p>
   <ul>
     % for rname in $rnames do
     <li><a href="/group/{{$gname}}/repo/{{$rname}}">{{$rname}}</a></li>

diff --git a/view/history.html b/view/history.html
index 2f3f08c..4d6860c 100644
--- a/view/history.html
+++ b/view/history.html
@@ -5,33 +5,40 @@
   <title>cogit - {{$gname}} - {{$rname}} - history</title>
 </head>
 <body>
-  <a href="/">home</a>
-  &gt;
-  <a href="/group/{{$gname}}">{{$gname}}</a>
-  &gt;
-  <a href="/group/{{$gname}}/repo/{{$rname}}">{{$rname}}</a>
-  &gt;
-  history
-  <p>Commits:</p>
-  <ul>
-    % set i = 0
-    % while $commit and $i < $limit do
-    <li><a href="/group/{{$gname}}/repo/{{$rname}}/commit/{{$commit:id()}}">{{$commit:summary()}}</a></li>
-      % set commit = $commit:parent()
-      % set i = $i + 1
-    % end
-  </ul>
-  <br>
+  <p>
+    <a href="/">home</a>
+    &gt;
+    <a href="/group/{{$gname}}">{{$gname}}</a>
+    &gt;
+    <a href="/group/{{$gname}}/repo/{{$rname}}">{{$rname}}</a>
+    &gt;
+    history
+  <p>
   % if $prev then
   <a href="/group/{{$gname}}/repo/{{$rname}}/history/{{$prev:id()}}">&lt</a>
   % else
   &lt
   % end
   &nbsp;&nbsp;&nbsp;
-  % if $commit then
-  <a href="/group/{{$gname}}/repo/{{$rname}}/history/{{$commit:id()}}">&gt</a>
+  % set i = 0
+  % set next = $commit
+  % while $next and $i < $limit do
+    % set next = $next:parent()
+    % set i = $i + 1
+  % end
+  % if $next then
+  <a href="/group/{{$gname}}/repo/{{$rname}}/history/{{$next:id()}}">&gt</a>
   % else
   &gt
   % end
+  <p>Commits:</p>
+  <ul>
+    % set i = 0
+    % while $commit and $i < $limit do
+    <li><a href="/group/{{$gname}}/repo/{{$rname}}/commit/{{$commit:id()}}">{{$commit:summary()}}</a></li>
+      % set commit = $commit:parent()
+      % set i = $i + 1
+    % end
+  </ul>
 </body>
 </html>

diff --git a/view/home.html b/view/home.html
index 22a09b4..be3f067 100644
--- a/view/home.html
+++ b/view/home.html
@@ -5,6 +5,8 @@
   <title>cogit</title>
 </head>
 <body>
+  <p>home</p>
+  <p>Groups:</p>
   <ul>
     % for gname in $gnames do
     <li><a href="/group/{{$gname}}">{{$gname}}</a></li>

diff --git a/view/repo.html b/view/repo.html
index a39c8ce..926994d 100644
--- a/view/repo.html
+++ b/view/repo.html
@@ -5,11 +5,13 @@
   <title>cogit - {{$gname}} - {{$rname}}</title>
 </head>
 <body>
-  <a href="/">home</a>
-  &gt;
-  <a href="/group/{{$gname}}">{{$gname}}</a>
-  &gt;
-  {{$rname}}
+  <p>
+    <a href="/">home</a>
+    &gt;
+    <a href="/group/{{$gname}}">{{$gname}}</a>
+    &gt;
+    {{$rname}}
+  </p>
   <p>Branches:</p>
   <ul>
     % for bname in $bnames do