summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Side-by-side diff
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 71c899a..15d8254 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -171,16 +171,38 @@ void cgit_commit_link(char *name, char *title, char *class, char *head,
name[cgit_max_msg_len] = '\0';
name[cgit_max_msg_len - 1] = '.';
name[cgit_max_msg_len - 2] = '.';
name[cgit_max_msg_len - 3] = '.';
}
reporevlink("commit", name, title, class, head, rev, NULL);
}
+void cgit_diff_link(char *name, char *title, char *class, char *head,
+ char *new_rev, char *old_rev, char *path)
+{
+ char *delim;
+
+ delim = repolink(title, class, "diff", head, path);
+ if (new_rev && strcmp(new_rev, cgit_query_head)) {
+ html(delim);
+ html("id=");
+ html_attr(new_rev);
+ delim = "&";
+ }
+ if (old_rev) {
+ html(delim);
+ html("id2=");
+ html_attr(old_rev);
+ }
+ html("'>");
+ html_txt(name);
+ html("</a>");
+}
+
void cgit_print_date(time_t secs, char *format)
{
char buf[64];
struct tm *time;
time = gmtime(&secs);
strftime(buf, sizeof(buf)-1, format, time);
html_txt(buf);