]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
ui-diff: add "stat only" diff type
[ps-cgit] / ui-shared.c
index 497dfd011b19e91d628092b42fbb992522cc3a8d..6243d1b1abb357c285c1665e55aef63541a91f1e 100644 (file)
@@ -346,9 +346,9 @@ void cgit_commit_link(char *name, const char *title, const char *class,
                html_url_arg(rev);
                delim = "&";
        }
                html_url_arg(rev);
                delim = "&";
        }
-       if (ctx.qry.ssdiff) {
+       if (ctx.qry.difftype) {
                html(delim);
                html(delim);
-               html("ss=1");
+               htmlf("dt=%d", ctx.qry.difftype);
                delim = "&";
        }
        if (ctx.qry.context > 0 && ctx.qry.context != 3) {
                delim = "&";
        }
        if (ctx.qry.context > 0 && ctx.qry.context != 3) {
@@ -385,7 +385,7 @@ void cgit_snapshot_link(const char *name, const char *title, const char *class,
 
 void cgit_diff_link(const char *name, const char *title, const char *class,
                    const char *head, const char *new_rev, const char *old_rev,
 
 void cgit_diff_link(const char *name, const char *title, const char *class,
                    const char *head, const char *new_rev, const char *old_rev,
-                   const char *path, int toggle_ssdiff)
+                   const char *path)
 {
        char *delim;
 
 {
        char *delim;
 
@@ -402,9 +402,9 @@ void cgit_diff_link(const char *name, const char *title, const char *class,
                html_url_arg(old_rev);
                delim = "&";
        }
                html_url_arg(old_rev);
                delim = "&";
        }
-       if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
+       if (ctx.qry.difftype) {
                html(delim);
                html(delim);
-               html("ss=1");
+               htmlf("dt=%d", ctx.qry.difftype);
                delim = "&";
        }
        if (ctx.qry.context > 0 && ctx.qry.context != 3) {
                delim = "&";
        }
        if (ctx.qry.context > 0 && ctx.qry.context != 3) {
@@ -478,7 +478,7 @@ static void cgit_self_link(char *name, const char *title, const char *class)
        else if (!strcmp(ctx.qry.page, "diff"))
                cgit_diff_link(name, title, class, ctx.qry.head,
                               ctx.qry.sha1, ctx.qry.sha2,
        else if (!strcmp(ctx.qry.page, "diff"))
                cgit_diff_link(name, title, class, ctx.qry.head,
                               ctx.qry.sha1, ctx.qry.sha2,
-                              ctx.qry.path, 0);
+                              ctx.qry.path);
        else if (!strcmp(ctx.qry.page, "stats"))
                cgit_stats_link(name, title, class, ctx.qry.head,
                                ctx.qry.path);
        else if (!strcmp(ctx.qry.page, "stats"))
                cgit_stats_link(name, title, class, ctx.qry.head,
                                ctx.qry.path);
@@ -876,7 +876,7 @@ void cgit_print_pageheader(void)
                cgit_commit_link("commit", NULL, hc("commit"),
                                 ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath);
                cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head,
                cgit_commit_link("commit", NULL, hc("commit"),
                                 ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath);
                cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head,
-                              ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0);
+                              ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath);
                if (ctx.repo->max_stats)
                        cgit_stats_link("stats", NULL, hc("stats"),
                                        ctx.qry.head, ctx.qry.vpath);
                if (ctx.repo->max_stats)
                        cgit_stats_link("stats", NULL, hc("stats"),
                                        ctx.qry.head, ctx.qry.vpath);