summaryrefslogtreecommitdiffabout
path: root/ui-log.c
authorLars Hjemli <hjemli@gmail.com>2008-11-29 17:39:41 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-11-29 17:39:41 (UTC)
commit0274b57d55a12ed38259757dbfae96b79cfa2e0b (patch) (unidiff)
tree34c7204f88168f791ef48f603bb8ab66e9df523c /ui-log.c
parent7b5cee65fd9cf31e4f19ce4ff613778cb95512a9 (diff)
downloadcgit-0274b57d55a12ed38259757dbfae96b79cfa2e0b.zip
cgit-0274b57d55a12ed38259757dbfae96b79cfa2e0b.tar.gz
cgit-0274b57d55a12ed38259757dbfae96b79cfa2e0b.tar.bz2
ui-log: add support for showing the full commit message
Some users prefer to see the full message, so to make these users happy the new querystring parameter "showmsg" can be used to print the full commit message per log entry. A link is provided in the log heading to make this function accessible, and all links and forms tries to preserve the users preference. Note: the new link is not displayed on the summary page since the point of the summary page is to be a summary, but it is still obeyed if specified manually. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-log.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-log.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/ui-log.c b/ui-log.c
index 8dd8b89..631e46d 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -44,8 +44,12 @@ void print_commit(struct commit *commit)
44 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); 44 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
45 html_link_close(); 45 html_link_close();
46 html("</td><td>"); 46 html("</td><td>");
47 if (ctx.qry.showmsg)
48 html("<u>");
47 cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, 49 cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
48 sha1_to_hex(commit->object.sha1)); 50 sha1_to_hex(commit->object.sha1));
51 if (ctx.qry.showmsg)
52 html("</u>");
49 html("</td><td>"); 53 html("</td><td>");
50 html_txt(info->author); 54 html_txt(info->author);
51 if (ctx.repo->enable_log_filecount) { 55 if (ctx.repo->enable_log_filecount) {
@@ -61,6 +65,17 @@ void print_commit(struct commit *commit)
61 } 65 }
62 } 66 }
63 html("</td></tr>\n"); 67 html("</td></tr>\n");
68 if (ctx.qry.showmsg) {
69 html("<tr class='nohover'><td></td><td><div class='commit-msg'>");
70 html_txt(info->msg);
71 html("</div><br/></td><td></td>");
72 if (ctx.repo->enable_log_filecount) {
73 html("<td></td>");
74 if (ctx.repo->enable_log_linecount)
75 html("<td></td>");
76 }
77 html("</tr>\n");
78 }
64 cgit_free_commitinfo(info); 79 cgit_free_commitinfo(info);
65} 80}
66 81
@@ -100,8 +115,15 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
100 html("<table class='list nowrap'>"); 115 html("<table class='list nowrap'>");
101 116
102 html("<tr class='nohover'><th class='left'>Age</th>" 117 html("<tr class='nohover'><th class='left'>Age</th>"
103 "<th class='left'>Commit message</th>" 118 "<th class='left'>Commit message");
104 "<th class='left'>Author</th>"); 119 if (pager) {
120 html(" (");
121 cgit_log_link("toggle", NULL, NULL, ctx.qry.head, ctx.qry.sha1,
122 ctx.qry.path, ctx.qry.ofs, ctx.qry.grep,
123 ctx.qry.search, ctx.qry.showmsg ? 0 : 1);
124 html(")");
125 }
126 html("</th><th class='left'>Author</th>");
105 if (ctx.repo->enable_log_filecount) { 127 if (ctx.repo->enable_log_filecount) {
106 html("<th class='left'>Files</th>"); 128 html("<th class='left'>Files</th>");
107 columns++; 129 columns++;
@@ -136,20 +158,20 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
136 cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, 158 cgit_log_link("[prev]", NULL, NULL, ctx.qry.head,
137 ctx.qry.sha1, ctx.qry.path, 159 ctx.qry.sha1, ctx.qry.path,
138 ofs - cnt, ctx.qry.grep, 160 ofs - cnt, ctx.qry.grep,
139 ctx.qry.search); 161 ctx.qry.search, ctx.qry.showmsg);
140 html("&nbsp;"); 162 html("&nbsp;");
141 } 163 }
142 if ((commit = get_revision(&rev)) != NULL) { 164 if ((commit = get_revision(&rev)) != NULL) {
143 cgit_log_link("[next]", NULL, NULL, ctx.qry.head, 165 cgit_log_link("[next]", NULL, NULL, ctx.qry.head,
144 ctx.qry.sha1, ctx.qry.path, 166 ctx.qry.sha1, ctx.qry.path,
145 ofs + cnt, ctx.qry.grep, 167 ofs + cnt, ctx.qry.grep,
146 ctx.qry.search); 168 ctx.qry.search, ctx.qry.showmsg);
147 } 169 }
148 html("</div>"); 170 html("</div>");
149 } else if ((commit = get_revision(&rev)) != NULL) { 171 } else if ((commit = get_revision(&rev)) != NULL) {
150 html("<tr class='nohover'><td colspan='3'>"); 172 html("<tr class='nohover'><td colspan='3'>");
151 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0, 173 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0,
152 NULL, NULL); 174 NULL, NULL, ctx.qry.showmsg);
153 html("</td></tr>\n"); 175 html("</td></tr>\n");
154 } 176 }
155} 177}