ctucx.git: nimstagit

[nimlang] incomplete reimplementation of stagit

commit 9ce44b9ea5999508e56bff23e0181b7c1bfd93ca
parent 7dec032033ad84bb126ecf14f66af7a22ec2b250
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 9 May 2021 00:25:07 +0200

design improvements
7 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/src/assets/style.css b/src/assets/style.css
@@ -87,6 +87,12 @@ footer {
 	color: #ccc;
 }
 
+.breadcrumb {
+	background-color: #ccc;
+	padding: 2px 1em;
+}
+
+
 
 
 /***

@@ -108,8 +114,6 @@ footer {
 }
 
 .event pre {
-	text-overflow: ellipsis;
-    overflow: none;
     padding-left: 0;
     padding-right: 0;
     background: 0 0;

@@ -118,6 +122,10 @@ footer {
 	color: #212529;
 }
 
+.event .commit pre {
+	text-overflow: ellipsis;
+    overflow: none;
+}
 
 
 /***
diff --git a/src/templates/index.nimf b/src/templates/index.nimf
@@ -28,20 +28,20 @@
                     <tr>
                         <td>Name</td>
                         <td>Description</td>
-                        <td>Idle</td>
+                        <td>Idle since</td>
                     </tr>
                 </thead>
                 #for category in items(categories):
                 #if category.name != "":
                 <tr>
-                    <td colspan="4" class="reposection">$category.name</td>
+                    <td colspan="3" class="reposection">$category.name</td>
                 </tr>
                 # end if
                 # for repo in items(category.repos):
                 <tr>
                     <td class="sublevel-repo"><a href="$repo.url/">$repo.name</a></td>
                     <td><a href="$repo.url/">$repo.description</a></td>
-                    <td><span class="age-hours"><a href="/$repo.url/log/{$repo.objId}.html">$repo.lastActivity</a></span></td>
+                    <td width="15%"><a href="/$repo.url/log/{$repo.objId}.html">$repo.lastActivity</a></span></td>
                 </tr>
                 #end for
                 #end for
diff --git a/src/templates/repoBlob.nimf b/src/templates/repoBlob.nimf
@@ -25,20 +25,26 @@
             <a href="/$templateContext.repoUrl/refs">refs</a>
         </nav>
         <main>
+            <div class="breadcrumb">
             #for path in paths:
             <a href="$path.url">$path.name</a> /
             #end for
-            $blob.filename (<a href="$blob.filenameUrl">plain</a>)<br>
-            blob: $blob.id $blob.filesize
+            $blob.filename
+
+            <span class="right">$blob.filesize | $blob.lines.len lines | <a href="$blob.filenameUrl">plain</a></span>
+            </div>
             #if not blob.isBinary:
             <div class="code">
-                <pre class="lines">
-                #for l in blob.lines:
+
+<pre class="lines">
+#for l in blob.lines:
 <a id="L$l" href="#L$l">$l</a>
 #end for
 </pre>
                 <pre class="highlight">$blob.content</pre>
             </div>
+            #else:
+            <br><br>This is a binary file.
             #end if
         </main>
         <footer><p>Generated on $templateContext.generated</p></footer>
diff --git a/src/templates/repoCommit.nimf b/src/templates/repoCommit.nimf
@@ -27,17 +27,17 @@
         <main>
         <div class="event-list">
             <div class="event">
-                <a class="right" href="/$templateContext.repoUrl/log/{$commit.id}.html">$commit.when ago</a>
+                <a class="right" href="/$templateContext.repoUrl/log/{$commit.id}.html">$commit.when</a>
                 commit: $commit.id<br>
                 #for parent in parents:
-                parent: <a href="/$templateContext.repoUrl/log/{$parent}.html">$parent</a><br>
+                parent: <a href="/$templateContext.repoUrl/log/${parent}.html">$parent</a><br>
                 #end for
                 author: $commit.authorName<br>
                 committer: $commit.committerName<br><br>
                 <pre>$commit.message</pre>
             </div>
             <div class="event">
-                <pre>$diffStats.filesChanged files changed, $diffStats.insertions insertions, $diffStats.deletions deletions
+<pre>$diffStats.filesChanged files changed, <span class="insertion">$diffStats.insertions</span> insertions, <span class="deletion">$diffStats.deletions</span> deletions
 
 #for patch in patches:
 $patch.status <a href="/$templateContext.repoUrl/tree/${patch.oldFileUrl}.html">$patch.oldFile</a>
diff --git a/src/templates/repoLog.nimf b/src/templates/repoLog.nimf
@@ -27,9 +27,9 @@
         <main>
             <div class="events">
                 #for commit in items(commits):
-                <div class="event">
+                <div class="event commit">
                     <a href="${commit.id}.html">$commit.shortId</a> — $commit.authorName
-                    <small class="right">$commit.when ago</small>
+                    <small class="right">$commit.when</small>
                     <pre>$commit.message</pre>
                 </div>
                 #end for
diff --git a/src/templates/repoSummary.nimf b/src/templates/repoSummary.nimf
@@ -31,9 +31,9 @@
                         <h3>last commits</h3>
                         <div class="events">
                             #for commit in items(lastCommits):
-                            <div class="event">
+                            <div class="event commit">
                                 <a href="/$templateContext.repoUrl/log/${commit.id}.html">$commit.shortId</a> — $commit.authorName
-                                <small class="right">$commit.when ago</small>
+                                <small class="right">$commit.when</small>
                                 <pre>$commit.summary</pre>
                             </div>
                             #end for
diff --git a/src/templates/repoTree.nimf b/src/templates/repoTree.nimf
@@ -26,10 +26,12 @@
         </nav>
         <main>
             #if isSubdir:
-            #for path in paths:
-            <a href="$path.url">$path.name</a>
-            #end for
-             / $dirName
+            <div class="breadcrumb">
+                #for path in paths:
+                <a href="$path.url">$path.name</a> /
+                #end for
+                $dirName
+            </div>
             #end if
             <table>
                 <thead>