author | Lars Hjemli <hjemli@gmail.com> | 2008-04-14 20:23:48 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-04-14 20:23:48 (UTC) |
commit | e9a7042b5b44c6af2c7dc91eabed732d92278218 (patch) (side-by-side diff) | |
tree | ca0de7f4de19156b144ada5e9f3a2b46101fee90 | |
parent | 5764fe95469f65fdee285467f0f87d188fc1a780 (diff) | |
download | cgit-e9a7042b5b44c6af2c7dc91eabed732d92278218.zip cgit-e9a7042b5b44c6af2c7dc91eabed732d92278218.tar.gz cgit-e9a7042b5b44c6af2c7dc91eabed732d92278218.tar.bz2 |
Make a few more columns in repolist and log view clickable
Less mouse movement is nice.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-log.c | 5 | ||||
-rw-r--r-- | ui-repolist.c | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -13,52 +13,57 @@ int files, add_lines, rem_lines; void count_lines(char *line, int size) { if (size <= 0) return; if (line[0] == '+') add_lines++; else if (line[0] == '-') rem_lines++; } void inspect_files(struct diff_filepair *pair) { files++; if (ctx.repo->enable_log_linecount) cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); } void print_commit(struct commit *commit) { struct commitinfo *info; + char *tmp; info = cgit_parse_commit(commit); html("<tr><td>"); + tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); + tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); + html_link_open(tmp, NULL, NULL); cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); + html_link_close(); html("</td><td>"); cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, sha1_to_hex(commit->object.sha1)); html("</td><td>"); html_txt(info->author); if (ctx.repo->enable_log_filecount) { files = 0; add_lines = 0; rem_lines = 0; cgit_diff_commit(commit, inspect_files); html("</td><td>"); htmlf("%d", files); if (ctx.repo->enable_log_linecount) { html("</td><td>"); htmlf("-%d/+%d", rem_lines, add_lines); } } html("</td></tr>\n"); cgit_free_commitinfo(info); } void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, char *path, int pager) diff --git a/ui-repolist.c b/ui-repolist.c index 7a7e95a..98009c0 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -93,47 +93,49 @@ void cgit_print_repolist() html("<table summary='repository list' class='list nowrap'>"); for (i=0; i<cgit_repolist.count; i++) { ctx.repo = &cgit_repolist.repos[i]; if (!is_match(ctx.repo)) continue; if (!header++) print_header(columns); hits++; if ((last_group == NULL && ctx.repo->group != NULL) || (last_group != NULL && ctx.repo->group == NULL) || (last_group != NULL && ctx.repo->group != NULL && strcmp(ctx.repo->group, last_group))) { htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>", columns); html_txt(ctx.repo->group); html("</td></tr>"); last_group = ctx.repo->group; } htmlf("<tr><td class='%s'>", ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); html_txt(ctx.repo->name); html_link_close(); html("</td><td>"); + html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc); + html_link_close(); html("</td><td>"); html_txt(ctx.repo->owner); html("</td><td>"); print_modtime(ctx.repo); html("</td>"); if (ctx.cfg.enable_index_links) { html("<td>"); html_link_open(cgit_repourl(ctx.repo->url), NULL, "button"); html("summary</a>"); cgit_log_link("log", NULL, "button", NULL, NULL, NULL, 0, NULL, NULL); cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); html("</td>"); } html("</tr>\n"); } html("</table>"); if (!hits) cgit_print_error("No repositories found"); cgit_print_docend(); } |