From 91ce363f0ef2546076f0559f4dd477c454396a83 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Thu, 15 May 2025 14:57:44 +1000 Subject: [PATCH] Add compare button to branches page --- themed/refs.html | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/themed/refs.html b/themed/refs.html index 5da2bd9..0c5e714 100644 --- a/themed/refs.html +++ b/themed/refs.html @@ -29,14 +29,23 @@ {! struct commitinfo *info = ref->commit; !} {! char *name = (char *)ref->refname; !} {! if (!info) { continue; } !} -
-
{{ name }}
- {% if ref->object->type == OBJ_COMMIT %} -
- {{ info->subject }} · Updated {! cgit_print_age(info->committer_date, info->committer_tz, -1); !} ago - - {{ info->author }} +
+
+ {# Branch info #} + + {% if ref->object->type == OBJ_COMMIT %} +
+ {{ info->subject }} · Updated {! cgit_print_age(info->committer_date, info->committer_tz, -1); !} ago + + {{ info->author }} +
+ {% endif %}
+ {% if strcmp(name, ctx.qry.head) %}{# Only show compare button if not equal to current branch #} +
+ + Compare + {% endif %}
{% endfor %}