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) (unidiff) | |
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
@@ -21,36 +21,41 @@ void count_lines(char *line, int size) | |||
21 | add_lines++; | 21 | add_lines++; |
22 | 22 | ||
23 | else if (line[0] == '-') | 23 | else if (line[0] == '-') |
24 | rem_lines++; | 24 | rem_lines++; |
25 | } | 25 | } |
26 | 26 | ||
27 | void inspect_files(struct diff_filepair *pair) | 27 | void inspect_files(struct diff_filepair *pair) |
28 | { | 28 | { |
29 | files++; | 29 | files++; |
30 | if (ctx.repo->enable_log_linecount) | 30 | if (ctx.repo->enable_log_linecount) |
31 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); | 31 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
32 | } | 32 | } |
33 | 33 | ||
34 | void print_commit(struct commit *commit) | 34 | void print_commit(struct commit *commit) |
35 | { | 35 | { |
36 | struct commitinfo *info; | 36 | struct commitinfo *info; |
37 | char *tmp; | ||
37 | 38 | ||
38 | info = cgit_parse_commit(commit); | 39 | info = cgit_parse_commit(commit); |
39 | html("<tr><td>"); | 40 | html("<tr><td>"); |
41 | tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); | ||
42 | tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); | ||
43 | html_link_open(tmp, NULL, NULL); | ||
40 | 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(); | ||
41 | html("</td><td>"); | 46 | html("</td><td>"); |
42 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, | 47 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
43 | sha1_to_hex(commit->object.sha1)); | 48 | sha1_to_hex(commit->object.sha1)); |
44 | html("</td><td>"); | 49 | html("</td><td>"); |
45 | html_txt(info->author); | 50 | html_txt(info->author); |
46 | if (ctx.repo->enable_log_filecount) { | 51 | if (ctx.repo->enable_log_filecount) { |
47 | files = 0; | 52 | files = 0; |
48 | add_lines = 0; | 53 | add_lines = 0; |
49 | rem_lines = 0; | 54 | rem_lines = 0; |
50 | cgit_diff_commit(commit, inspect_files); | 55 | cgit_diff_commit(commit, inspect_files); |
51 | html("</td><td>"); | 56 | html("</td><td>"); |
52 | htmlf("%d", files); | 57 | htmlf("%d", files); |
53 | if (ctx.repo->enable_log_linecount) { | 58 | if (ctx.repo->enable_log_linecount) { |
54 | html("</td><td>"); | 59 | html("</td><td>"); |
55 | htmlf("-%d/+%d", rem_lines, add_lines); | 60 | htmlf("-%d/+%d", rem_lines, add_lines); |
56 | } | 61 | } |
diff --git a/ui-repolist.c b/ui-repolist.c index 7a7e95a..98009c0 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -101,33 +101,35 @@ void cgit_print_repolist() | |||
101 | if ((last_group == NULL && ctx.repo->group != NULL) || | 101 | if ((last_group == NULL && ctx.repo->group != NULL) || |
102 | (last_group != NULL && ctx.repo->group == NULL) || | 102 | (last_group != NULL && ctx.repo->group == NULL) || |
103 | (last_group != NULL && ctx.repo->group != NULL && | 103 | (last_group != NULL && ctx.repo->group != NULL && |
104 | strcmp(ctx.repo->group, last_group))) { | 104 | strcmp(ctx.repo->group, last_group))) { |
105 | htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>", | 105 | htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>", |
106 | columns); | 106 | columns); |
107 | html_txt(ctx.repo->group); | 107 | html_txt(ctx.repo->group); |
108 | html("</td></tr>"); | 108 | html("</td></tr>"); |
109 | last_group = ctx.repo->group; | 109 | last_group = ctx.repo->group; |
110 | } | 110 | } |
111 | htmlf("<tr><td class='%s'>", | 111 | htmlf("<tr><td class='%s'>", |
112 | ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); | 112 | ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); |
113 | html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); | 113 | html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); |
114 | html_txt(ctx.repo->name); | 114 | html_txt(ctx.repo->name); |
115 | html_link_close(); | 115 | html_link_close(); |
116 | html("</td><td>"); | 116 | html("</td><td>"); |
117 | html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); | ||
117 | html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc); | 118 | html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc); |
119 | html_link_close(); | ||
118 | html("</td><td>"); | 120 | html("</td><td>"); |
119 | html_txt(ctx.repo->owner); | 121 | html_txt(ctx.repo->owner); |
120 | html("</td><td>"); | 122 | html("</td><td>"); |
121 | print_modtime(ctx.repo); | 123 | print_modtime(ctx.repo); |
122 | html("</td>"); | 124 | html("</td>"); |
123 | if (ctx.cfg.enable_index_links) { | 125 | if (ctx.cfg.enable_index_links) { |
124 | html("<td>"); | 126 | html("<td>"); |
125 | html_link_open(cgit_repourl(ctx.repo->url), | 127 | html_link_open(cgit_repourl(ctx.repo->url), |
126 | NULL, "button"); | 128 | NULL, "button"); |
127 | html("summary</a>"); | 129 | html("summary</a>"); |
128 | cgit_log_link("log", NULL, "button", NULL, NULL, NULL, | 130 | cgit_log_link("log", NULL, "button", NULL, NULL, NULL, |
129 | 0, NULL, NULL); | 131 | 0, NULL, NULL); |
130 | cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); | 132 | cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); |
131 | html("</td>"); | 133 | html("</td>"); |
132 | } | 134 | } |
133 | html("</tr>\n"); | 135 | html("</tr>\n"); |