summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore 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
@@ -158,2 +158,4 @@ static void querystring_cb(const char *name, const char *value)
ctx.qry.sort = xstrdup(value);
+ } else if (!strcmp(name, "showmsg")) {
+ ctx.qry.showmsg = atoi(value);
}
diff --git a/cgit.css b/cgit.css
index a37d218..7928c2f 100644
--- a/cgit.css
+++ b/cgit.css
@@ -122,2 +122,6 @@ table.list tr {
+table.list tr.logheader {
+ background: #eee;
+}
+
table.list tr:hover {
@@ -145,2 +149,13 @@ table.list td {
+table.list td.logsubject {
+ font-family: monospace;
+ font-weight: bold;
+}
+
+table.list td.logmsg {
+ font-family: monospace;
+ white-space: pre;
+ padding: 1em 0em 2em 0em;
+}
+
table.list td a {
diff --git a/cgit.h b/cgit.h
index f1fbeca..cb2f176 100644
--- a/cgit.h
+++ b/cgit.h
@@ -125,2 +125,3 @@ struct cgit_query {
char *sort;
+ int showmsg;
};
diff --git a/ui-log.c b/ui-log.c
index d212984..2f90778 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -37,5 +37,7 @@ void print_commit(struct commit *commit)
char *tmp;
+ int cols = 2;
info = cgit_parse_commit(commit);
- html("<tr><td>");
+ htmlf("<tr%s><td>",
+ ctx.qry.showmsg ? " class='logheader'" : "");
tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
@@ -45,3 +47,4 @@ void print_commit(struct commit *commit)
html_link_close();
- html("</td><td>");
+ htmlf("</td><td%s>",
+ ctx.qry.showmsg ? " class='logsubject'" : "");
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
@@ -63,2 +66,13 @@ void print_commit(struct commit *commit)
html("</td></tr>\n");
+ if (ctx.qry.showmsg) {
+ if (ctx.repo->enable_log_filecount) {
+ cols++;
+ if (ctx.repo->enable_log_linecount)
+ cols++;
+ }
+ htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>",
+ cols);
+ html_txt(info->msg);
+ html("</td></tr>\n");
+ }
cgit_free_commitinfo(info);
@@ -115,4 +129,11 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
html("<tr class='nohover'><th class='left'>Age</th>"
- "<th class='left'>Commit message</th>"
- "<th class='left'>Author</th>");
+ "<th class='left'>Commit message");
+ if (pager) {
+ html(" (");
+ cgit_log_link("toggle", NULL, NULL, ctx.qry.head, ctx.qry.sha1,
+ ctx.qry.path, ctx.qry.ofs, ctx.qry.grep,
+ ctx.qry.search, ctx.qry.showmsg ? 0 : 1);
+ html(")");
+ }
+ html("</th><th class='left'>Author</th>");
if (ctx.repo->enable_log_filecount) {
@@ -151,3 +172,3 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
ofs - cnt, ctx.qry.grep,
- ctx.qry.search);
+ ctx.qry.search, ctx.qry.showmsg);
html("&nbsp;");
@@ -158,3 +179,3 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
ofs + cnt, ctx.qry.grep,
- ctx.qry.search);
+ ctx.qry.search, ctx.qry.showmsg);
}
@@ -164,3 +185,3 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0,
- NULL, NULL);
+ NULL, NULL, ctx.qry.showmsg);
html("</td></tr>\n");
diff --git a/ui-refs.c b/ui-refs.c
index 0805fc8..d61ee7c 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -60,3 +60,4 @@ static int print_branch(struct refinfo *ref)
html("<tr><td>");
- cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL);
+ cgit_log_link(name, NULL, NULL, name, NULL, NULL, 0, NULL, NULL,
+ ctx.qry.showmsg);
html("</td><td>");
diff --git a/ui-repolist.c b/ui-repolist.c
index 87196f0..2c13d50 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -259,3 +259,3 @@ void cgit_print_repolist()
cgit_log_link("log", NULL, "button", NULL, NULL, NULL,
- 0, NULL, NULL);
+ 0, NULL, NULL, ctx.qry.showmsg);
cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL);
diff --git a/ui-shared.c b/ui-shared.c
index 9319881..95dfeb4 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -283,3 +283,4 @@ void cgit_plain_link(char *name, char *title, char *class, char *head,
void cgit_log_link(char *name, char *title, char *class, char *head,
- char *rev, char *path, int ofs, char *grep, char *pattern)
+ char *rev, char *path, int ofs, char *grep, char *pattern,
+ int showmsg)
{
@@ -307,2 +308,7 @@ void cgit_log_link(char *name, char *title, char *class, char *head,
htmlf("%d", ofs);
+ delim = "&";
+ }
+ if (showmsg) {
+ html(delim);
+ html("showmsg=1");
}
@@ -572,2 +578,4 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
html_hidden("id2", ctx.qry.sha2);
+ if (ctx.qry.showmsg)
+ html_hidden("showmsg", "1");
@@ -638,3 +646,3 @@ void cgit_print_pageheader(struct cgit_context *ctx)
cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head,
- NULL, NULL, 0, NULL, NULL);
+ NULL, NULL, 0, NULL, NULL, ctx->qry.showmsg);
cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head,
diff --git a/ui-shared.h b/ui-shared.h
index 3c8a6d0..2ab53ae 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -21,3 +21,3 @@ extern void cgit_log_link(char *name, char *title, char *class, char *head,
char *rev, char *path, int ofs, char *grep,
- char *pattern);
+ char *pattern, int showmsg);
extern void cgit_commit_link(char *name, char *title, char *class, char *head,
diff --git a/ui-tree.c b/ui-tree.c
index 79332fc..051db7c 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -108,3 +108,3 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev,
- fullpath, 0, NULL, NULL);
+ fullpath, 0, NULL, NULL, ctx.qry.showmsg);
html("</td></tr>\n");