[CGit RFC/PATCH 2/5] ui-log: Move 'Age' column to the right of 'Author', like in gitk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is in preparation for putting the commit graph to the left of the
commit message. IMHO, it looks better when the commit message is right
next to the graph, than if the age is wedged in between.

Signed-off-by: Johan Herland <johan@xxxxxxxxxxx>
---
 ui-log.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/ui-log.c b/ui-log.c
index 33ec8a9..390c38b 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -79,23 +79,22 @@ void print_commit(struct commit *commit)
 {
 	struct commitinfo *info;
 	char *tmp;
-	int cols = 2;
+	int cols = 3;
 
 	info = cgit_parse_commit(commit);
-	htmlf("<tr%s><td>",
-		ctx.qry.showmsg ? " class='logheader'" : "");
-	tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
-	tmp = cgit_fileurl(ctx.repo->url, "commit", ctx.qry.vpath, tmp);
-	html_link_open(tmp, NULL, NULL);
-	cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
-	html_link_close();
-	htmlf("</td><td%s>",
-		ctx.qry.showmsg ? " class='logsubject'" : "");
+	htmlf("<tr%s>", ctx.qry.showmsg ? " class='logheader'" : "");
+	htmlf("<td%s>", ctx.qry.showmsg ? " class='logsubject'" : "");
 	cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
 			 sha1_to_hex(commit->object.sha1), ctx.qry.vpath, 0);
 	show_commit_decorations(commit);
 	html("</td><td>");
 	html_txt(info->author);
+	html("</td><td>");
+	tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
+	tmp = cgit_fileurl(ctx.repo->url, "commit", ctx.qry.vpath, tmp);
+	html_link_open(tmp, NULL, NULL);
+	cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
+	html_link_close();
 	if (ctx.repo->enable_log_filecount) {
 		files = 0;
 		add_lines = 0;
@@ -115,7 +114,7 @@ void print_commit(struct commit *commit)
 			if (ctx.repo->enable_log_linecount)
 				cols++;
 		}
-		htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>",
+		htmlf("<tr class='nohover'><td colspan='%d' class='logmsg'>",
 			cols);
 		html_txt(info->msg);
 		html("</td></tr>\n");
@@ -176,8 +175,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
 	if (pager)
 		html("<table class='list nowrap'>");
 
-	html("<tr class='nohover'><th class='left'>Age</th>"
-	      "<th class='left'>Commit message");
+	html("<tr class='nohover'><th class='left'>Commit message");
 	if (pager) {
 		html(" (");
 		cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL,
@@ -186,7 +184,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
 			      ctx.qry.search, ctx.qry.showmsg ? 0 : 1);
 		html(")");
 	}
-	html("</th><th class='left'>Author</th>");
+	html("</th><th class='left'>Author</th><th class='left'>Age</th>");
 	if (ctx.repo->enable_log_filecount) {
 		html("<th class='left'>Files</th>");
 		columns++;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]