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
@@ -178,2 +178,24 @@ void cgit_commit_link(char *name, char *title, char *class, char *head,
+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)