summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2008-12-06 10:37:37 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-12-06 10:37:37 (UTC)
commit3c32fe07717f27fc891b66ccd06057fb810d03ad (patch) (unidiff)
tree04897b3eac6432c43284e7da79161e47856d078b
parent9c8be943f72b6f1bda5a31ce401899c3dd734e98 (diff)
parentab67164d6217fcda5ef3e07aefa3dd6eee6b65a3 (diff)
downloadcgit-3c32fe07717f27fc891b66ccd06057fb810d03ad.zip
cgit-3c32fe07717f27fc891b66ccd06057fb810d03ad.tar.gz
cgit-3c32fe07717f27fc891b66ccd06057fb810d03ad.tar.bz2
Merge branch 'full-log'
Conflicts: cgit.c cgit.h
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.css15
-rw-r--r--cgit.h1
-rw-r--r--ui-log.c35
-rw-r--r--ui-refs.c3
-rw-r--r--ui-repolist.c2
-rw-r--r--ui-shared.c12
-rw-r--r--ui-shared.h2
-rw-r--r--ui-tree.c2
9 files changed, 61 insertions, 13 deletions
diff --git a/cgit.c b/cgit.c
index e09c86e..166fbc6 100644
--- a/cgit.c
+++ b/cgit.c
@@ -157,4 +157,6 @@ static void querystring_cb(const char *name, const char *value)
157 } else if (!strcmp(name, "s")){ 157 } else if (!strcmp(name, "s")){
158 ctx.qry.sort = xstrdup(value); 158 ctx.qry.sort = xstrdup(value);
159 } else if (!strcmp(name, "showmsg")) {
160 ctx.qry.showmsg = atoi(value);
159 } 161 }
160} 162}
diff --git a/cgit.css b/cgit.css
index a37d218..7928c2f 100644
--- a/cgit.css
+++ b/cgit.css
@@ -121,4 +121,8 @@ table.list tr {
121} 121}
122 122
123table.list tr.logheader {
124 background: #eee;
125}
126
123table.list tr:hover { 127table.list tr:hover {
124 background: #eee; 128 background: #eee;
@@ -144,4 +148,15 @@ table.list td {
144} 148}
145 149
150table.list td.logsubject {
151 font-family: monospace;
152 font-weight: bold;
153}
154
155table.list td.logmsg {
156 font-family: monospace;
157 white-space: pre;
158 padding: 1em 0em 2em 0em;
159}
160
146table.list td a { 161table.list td a {
147 color: black; 162 color: black;
diff --git a/cgit.h b/cgit.h
index f1fbeca..cb2f176 100644
--- a/cgit.h
+++ b/cgit.h
@@ -124,4 +124,5 @@ struct cgit_query {
124 int nohead; 124 int nohead;
125 char *sort; 125 char *sort;
126 int showmsg;
126}; 127};
127 128
diff --git a/ui-log.c b/ui-log.c
index d212984..2f90778 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -36,7 +36,9 @@ void print_commit(struct commit *commit)
36 struct commitinfo *info; 36 struct commitinfo *info;
37 char *tmp; 37 char *tmp;
38 int cols = 2;
38 39
39 info = cgit_parse_commit(commit); 40 info = cgit_parse_commit(commit);
40 html("<tr><td>"); 41 htmlf("<tr%s><td>",
42 ctx.qry.showmsg ? " class='logheader'" : "");
41 tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); 43 tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
42 tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); 44 tmp = cgit_pageurl(ctx.repo->url, "commit", tmp);
@@ -44,5 +46,6 @@ void print_commit(struct commit *commit)
44 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); 46 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
45 html_link_close(); 47 html_link_close();
46 html("</td><td>"); 48 htmlf("</td><td%s>",
49 ctx.qry.showmsg ? " class='logsubject'" : "");
47 cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, 50 cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
48 sha1_to_hex(commit->object.sha1)); 51 sha1_to_hex(commit->object.sha1));
@@ -62,4 +65,15 @@ void print_commit(struct commit *commit)
62 } 65 }
63 html("</td></tr>\n"); 66 html("</td></tr>\n");
67 if (ctx.qry.showmsg) {
68 if (ctx.repo->enable_log_filecount) {
69 cols++;
70 if (ctx.repo->enable_log_linecount)
71 cols++;
72 }
73 htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>",
74 cols);
75 html_txt(info->msg);
76 html("</td></tr>\n");
77 }
64 cgit_free_commitinfo(info); 78 cgit_free_commitinfo(info);
65} 79}
@@ -114,6 +128,13 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
114 128
115 html("<tr class='nohover'><th class='left'>Age</th>" 129 html("<tr class='nohover'><th class='left'>Age</th>"
116 "<th class='left'>Commit message</th>" 130 "<th class='left'>Commit message");
117 "<th class='left'>Author</th>"); 131 if (pager) {
132 html(" (");
133 cgit_log_link("toggle", NULL, NULL, ctx.qry.head, ctx.qry.sha1,
134 ctx.qry.path, ctx.qry.ofs, ctx.qry.grep,
135 ctx.qry.search, ctx.qry.showmsg ? 0 : 1);
136 html(")");
137 }
138 html("</th><th class='left'>Author</th>");
118 if (ctx.repo->enable_log_filecount) { 139 if (ctx.repo->enable_log_filecount) {
119 html("<th class='left'>Files</th>"); 140 html("<th class='left'>Files</th>");
@@ -150,5 +171,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
150 ctx.qry.sha1, ctx.qry.path, 171 ctx.qry.sha1, ctx.qry.path,
151 ofs - cnt, ctx.qry.grep, 172 ofs - cnt, ctx.qry.grep,
152 ctx.qry.search); 173 ctx.qry.search, ctx.qry.showmsg);
153 html("&nbsp;"); 174 html("&nbsp;");
154 } 175 }
@@ -157,5 +178,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
157 ctx.qry.sha1, ctx.qry.path, 178 ctx.qry.sha1, ctx.qry.path,
158 ofs + cnt, ctx.qry.grep, 179 ofs + cnt, ctx.qry.grep,
159 ctx.qry.search); 180 ctx.qry.search, ctx.qry.showmsg);
160 } 181 }
161 html("</div>"); 182 html("</div>");
@@ -163,5 +184,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
163 html("<tr class='nohover'><td colspan='3'>"); 184 html("<tr class='nohover'><td colspan='3'>");
164 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0, 185 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0,
165 NULL, NULL); 186 NULL, NULL, ctx.qry.showmsg);
166 html("</td></tr>\n"); 187 html("</td></tr>\n");
167 } 188 }
diff --git a/ui-refs.c b/ui-refs.c
index 0805fc8..d61ee7c 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -59,5 +59,6 @@ static int print_branch(struct refinfo *ref)
59 return 1; 59 return 1;
60 html("<tr><td>"); 60 html("<tr><td>");
61 cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL); 61 cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL,
62 ctx.qry.showmsg);
62 html("</td><td>"); 63 html("</td><td>");
63 64
diff --git a/ui-repolist.c b/ui-repolist.c
index 87196f0..2c13d50 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -258,5 +258,5 @@ void cgit_print_repolist()
258 cgit_summary_link("summary", NULL, "button", NULL); 258 cgit_summary_link("summary", NULL, "button", NULL);
259 cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 259 cgit_log_link("log", NULL, "button", NULL, NULL, NULL,
260 0, NULL, NULL); 260 0, NULL, NULL, ctx.qry.showmsg);
261 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); 261 cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL);
262 html("</td>"); 262 html("</td>");
diff --git a/ui-shared.c b/ui-shared.c
index 9319881..95dfeb4 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -282,5 +282,6 @@ void cgit_plain_link(char *name, char *title, char *class, char *head,
282 282
283void cgit_log_link(char *name, char *title, char *class, char *head, 283void cgit_log_link(char *name, char *title, char *class, char *head,
284 char *rev, char *path, int ofs, char *grep, char *pattern) 284 char *rev, char *path, int ofs, char *grep, char *pattern,
285 int showmsg)
285{ 286{
286 char *delim; 287 char *delim;
@@ -306,4 +307,9 @@ void cgit_log_link(char *name, char *title, char *class, char *head,
306 html("ofs="); 307 html("ofs=");
307 htmlf("%d", ofs); 308 htmlf("%d", ofs);
309 delim = "&";
310 }
311 if (showmsg) {
312 html(delim);
313 html("showmsg=1");
308 } 314 }
309 html("'>"); 315 html("'>");
@@ -571,4 +577,6 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
571 if (ctx.qry.sha2) 577 if (ctx.qry.sha2)
572 html_hidden("id2", ctx.qry.sha2); 578 html_hidden("id2", ctx.qry.sha2);
579 if (ctx.qry.showmsg)
580 html_hidden("showmsg", "1");
573 581
574 if (incl_search) { 582 if (incl_search) {
@@ -637,5 +645,5 @@ void cgit_print_pageheader(struct cgit_context *ctx)
637 ctx->qry.sha1, NULL); 645 ctx->qry.sha1, NULL);
638 cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head, 646 cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head,
639 NULL, NULL, 0, NULL, NULL); 647 NULL, NULL, 0, NULL, NULL, ctx->qry.showmsg);
640 cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head, 648 cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head,
641 ctx->qry.sha1, NULL); 649 ctx->qry.sha1, NULL);
diff --git a/ui-shared.h b/ui-shared.h
index 3c8a6d0..2ab53ae 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -20,5 +20,5 @@ extern void cgit_plain_link(char *name, char *title, char *class, char *head,
20extern void cgit_log_link(char *name, char *title, char *class, char *head, 20extern void cgit_log_link(char *name, char *title, char *class, char *head,
21 char *rev, char *path, int ofs, char *grep, 21 char *rev, char *path, int ofs, char *grep,
22 char *pattern); 22 char *pattern, int showmsg);
23extern void cgit_commit_link(char *name, char *title, char *class, char *head, 23extern void cgit_commit_link(char *name, char *title, char *class, char *head,
24 char *rev); 24 char *rev);
diff --git a/ui-tree.c b/ui-tree.c
index 79332fc..051db7c 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -107,5 +107,5 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
107 html("<td>"); 107 html("<td>");
108 cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev, 108 cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev,
109 fullpath, 0, NULL, NULL); 109 fullpath, 0, NULL, NULL, ctx.qry.showmsg);
110 html("</td></tr>\n"); 110 html("</td></tr>\n");
111 free(name); 111 free(name);