stagit

custom fork of stagit
Index Commits Files Refs README LICENSE
commit 46a92a538d0f2b4921e47380f05c6a05ec9d00d3
parent 831ce925cb747016007e8091ff2fbe213934391f
Author: mjkloeckner <martin.cachari@gmail.com>
Date:   Wed,  4 Jan 2023 01:37:20 -0300

add anchor tags to all members of tables to make entire rows clickable

Diffstat:
Mstagit-index.c | 30++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/stagit-index.c b/stagit-index.c
@@ -153,21 +153,35 @@ writelog(FILE *fp)
         if (!strcmp(p, ".git"))
             *p = '\0';
 
-    fputs("<tr style=\"cursor: pointer; cursor: hand;\" onclick=\"\
-            window.location='/",fp);
-    percentencode(fp, stripped_name, strlen(stripped_name));
-    fputs("';\"><td id=\"name\"><a href=\"", fp);
+    /* fputs("<tr style=\"cursor: pointer; cursor: hand;\" onclick=\"\ window.location='/",fp); */
+    /* percentencode(fp, stripped_name, strlen(stripped_name)); */
+    /* fputs("';\"><td id=\"name\"><a href=\"", fp); */
+
+    fputs("<tr><td id=\"name\"><a href=\"",fp);
     percentencode(fp, stripped_name, strlen(stripped_name));
     fputs("/files.html\">", fp);
     xmlencode(fp, stripped_name, strlen(stripped_name));
-    fputs("</a></td><td id=\"description\">", fp);
+    fputs("</a></td>", fp);
+
+    fputs("<td id=\"description\"><a href=\"", fp);
+    percentencode(fp, stripped_name, strlen(stripped_name));
+    fputs("/files.html\">", fp);
     xmlencode(fp, description, strlen(description));
-    fputs("</td><td id=\"owner\">", fp);
+    fputs("</a></td>", fp);
+
+    fputs("<td id=\"owner\"><a href=\"", fp);
+    percentencode(fp, stripped_name, strlen(stripped_name));
+    fputs("/files.html\">", fp);
     xmlencode(fp, owner, strlen(owner));
-    fputs("</td><td id=\"last-commit\">", fp);
+    fputs("</a></td>", fp);
+
+    fputs("<td id=\"last-commit\"><a href=\"", fp);
+    percentencode(fp, stripped_name, strlen(stripped_name));
+    fputs("/files.html\">", fp);
+
     if (author)
         printtimeshort(fp, &(author->when));
-    fputs("</td></tr>", fp);
+    fputs("</a></td></tr>", fp);
 
     git_commit_free(commit);
 err: