commit: 49dd34b538ab0c6791fbeaee3a05f4782a4748a3
parent 1d72b22c47f34762f10d62fe5f33fc3491edab38
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 6 Jun 2024 06:13:18 +0200
stagit.c: Use sorttable for files and refs lists
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -516,6 +516,7 @@ writeheader(FILE *fp, const char *title)
fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%s\" />\n", faviconurl);
}
fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", assetpath);
+ fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%ssorttable.css\" />\n", assetpath);
fputs("</head>\n<body>\n<header>", fp);
fprintf(fp, "<a href=\"..\"><img src=\"%slogo.png\" alt=\"logo\" width=\"32\" height=\"32\" /></a>",
assetpath);
@@ -561,6 +562,7 @@ void
writefooter(FILE *fp)
{
fputs("</main>\n", fp);
+ fprintf(fp, "<script src=\"%ssorttable.js\"></script>\n", assetpath);
fputs("\t<footer>Here's my <a href=\"https://hacktivis.me/about\">contacts</a> for <a href=\"https://git-send-email.io/\">patches</a>, issues (tracker will maybe be added oneday), …\n", fp);
fputs("</body>\n</html>\n", fp);
}
@@ -1116,7 +1118,7 @@ writefiles(FILE *fp, const git_oid *id)
git_commit *commit = NULL;
int ret = -1;
- fputs("<table id=\"files\"><thead>\n<tr>"
+ fputs("<table class=\"sortable\" id=\"files\"><thead>\n<tr>"
"<td>Mode</td><td>Name</td>"
"<td class=\"num\" align=\"right\">Size</td>"
"</tr>\n</thead><tbody>\n", fp);
@@ -1156,7 +1158,7 @@ writerefs(FILE *fp)
/* print header if it has an entry (first). */
if (++count == 1) {
- fprintf(fp, "<h2>%s</h2><table id=\"%s\">"
+ fprintf(fp, "<h2>%s</h2><table class=\"sortable\" id=\"%s\">"
"<thead>\n<tr><td>Name</td>"
"<td>Last commit date</td>"
"<td>Author</td>\n</tr>\n"