summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--ui-log.c32
-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
8 files changed, 45 insertions, 11 deletions
diff --git a/cgit.c b/cgit.c
index c82587b..db5d342 100644
--- a/cgit.c
+++ b/cgit.c
@@ -153,8 +153,10 @@ static void querystring_cb(const char *name, const char *value)
} else if (!strcmp(name, "name")) {
ctx.qry.name = xstrdup(value);
} else if (!strcmp(name, "mimetype")) {
ctx.qry.mimetype = xstrdup(value);
+ } else if (!strcmp(name, "showmsg")) {
+ ctx.qry.showmsg = atoi(value);
}
}
static void prepare_context(struct cgit_context *ctx)
diff --git a/cgit.h b/cgit.h
index 91db98a..aab898b 100644
--- a/cgit.h
+++ b/cgit.h
@@ -120,8 +120,9 @@ struct cgit_query {
char *mimetype;
char *url;
int ofs;
int nohead;
+ int showmsg;
};
struct cgit_config {
char *agefile;
diff --git a/ui-log.c b/ui-log.c
index 8dd8b89..631e46d 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -43,10 +43,14 @@ void print_commit(struct commit *commit)
html_link_open(tmp, NULL, NULL);
cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
html_link_close();
html("</td><td>");
+ if (ctx.qry.showmsg)
+ html("<u>");
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
sha1_to_hex(commit->object.sha1));
+ if (ctx.qry.showmsg)
+ html("</u>");
html("</td><td>");
html_txt(info->author);
if (ctx.repo->enable_log_filecount) {
files = 0;
@@ -60,8 +64,19 @@ void print_commit(struct commit *commit)
htmlf("-%d/+%d", rem_lines, add_lines);
}
}
html("</td></tr>\n");
+ if (ctx.qry.showmsg) {
+ html("<tr class='nohover'><td></td><td><div class='commit-msg'>");
+ html_txt(info->msg);
+ html("</div><br/></td><td></td>");
+ if (ctx.repo->enable_log_filecount) {
+ html("<td></td>");
+ if (ctx.repo->enable_log_linecount)
+ html("<td></td>");
+ }
+ html("</tr>\n");
+ }
cgit_free_commitinfo(info);
}
@@ -99,10 +114,17 @@ 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</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) {
html("<th class='left'>Files</th>");
columns++;
if (ctx.repo->enable_log_linecount) {
@@ -135,21 +157,21 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
if (ofs > 0) {
cgit_log_link("[prev]", NULL, NULL, ctx.qry.head,
ctx.qry.sha1, ctx.qry.path,
ofs - cnt, ctx.qry.grep,
- ctx.qry.search);
+ ctx.qry.search, ctx.qry.showmsg);
html("&nbsp;");
}
if ((commit = get_revision(&rev)) != NULL) {
cgit_log_link("[next]", NULL, NULL, ctx.qry.head,
ctx.qry.sha1, ctx.qry.path,
ofs + cnt, ctx.qry.grep,
- ctx.qry.search);
+ ctx.qry.search, ctx.qry.showmsg);
}
html("</div>");
} else if ((commit = get_revision(&rev)) != NULL) {
html("<tr class='nohover'><td colspan='3'>");
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 32e0429..7eb16d5 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -57,9 +57,10 @@ static int print_branch(struct refinfo *ref)
if (!info)
return 1;
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>");
if (ref->object->type == OBJ_COMMIT) {
cgit_commit_link(info->subject, NULL, NULL, name, NULL);
diff --git a/ui-repolist.c b/ui-repolist.c
index c23232c..5833140 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -145,9 +145,9 @@ void cgit_print_repolist()
if (ctx.cfg.enable_index_links) {
html("<td>");
cgit_summary_link("summary", NULL, "button", NULL);
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);
html("</td>");
}
html("</tr>\n");
diff --git a/ui-shared.c b/ui-shared.c
index 224e5f3..dc39e64 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -280,9 +280,10 @@ void cgit_plain_link(char *name, char *title, char *class, char *head,
reporevlink("plain", name, title, class, head, rev, path);
}
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)
{
char *delim;
delim = repolink(title, class, "log", head, path);
@@ -304,8 +305,13 @@ void cgit_log_link(char *name, char *title, char *class, char *head,
if (ofs > 0) {
html(delim);
html("ofs=");
htmlf("%d", ofs);
+ delim = "&";
+ }
+ if (showmsg) {
+ html(delim);
+ html("showmsg=1");
}
html("'>");
html_txt(name);
html("</a>");
@@ -567,8 +573,10 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
if (ctx.qry.sha1)
html_hidden("id", ctx.qry.sha1);
if (ctx.qry.sha2)
html_hidden("id2", ctx.qry.sha2);
+ if (ctx.qry.showmsg)
+ html_hidden("showmsg", "1");
if (incl_search) {
if (ctx.qry.grep)
html_hidden("qt", ctx.qry.grep);
@@ -633,9 +641,9 @@ void cgit_print_pageheader(struct cgit_context *ctx)
ctx->qry.head);
cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head,
ctx->qry.sha1, NULL);
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,
ctx->qry.sha1, NULL);
cgit_commit_link("commit", NULL, hc(cmd, "commit"),
ctx->qry.head, ctx->qry.sha1);
diff --git a/ui-shared.h b/ui-shared.h
index 3c8a6d0..2ab53ae 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -18,9 +18,9 @@ extern void cgit_tree_link(char *name, char *title, char *class, char *head,
extern void cgit_plain_link(char *name, char *title, char *class, char *head,
char *rev, char *path);
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,
char *rev);
extern void cgit_patch_link(char *name, char *title, char *class, char *head,
char *rev);
diff --git a/ui-tree.c b/ui-tree.c
index 79332fc..051db7c 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -105,9 +105,9 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
htmlf("</td><td class='ls-size'>%li</td>", size);
html("<td>");
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");
free(name);
return 0;
}