From a26ee40d808d6a669c6f5902e54a624cccadd1ba Mon Sep 17 00:00:00 2001 From: BrookJeynes Date: Tue, 13 May 2025 17:28:57 +1000 Subject: [PATCH] appview: templates/repo: add `sync` fork button to ui --- appview/pages/templates/repo/index.html | 42 +++++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html index b418a4f..8f4f047 100644 --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -32,7 +32,7 @@ {{ end }} {{ define "branchSelector" }} -
+
- + {{ if .ForkInfo.IsFork }} + {{ $disabled := "" }} + {{ $title := "" }} + {{ if eq .ForkInfo.Status 0 }} + {{ $disabled = "disabled" }} + {{ $title = "This branch is not behind the upstream" }} + {{ else if eq .ForkInfo.Status 2 }} + {{ $disabled = "disabled" }} + {{ $title = "This branch has conflicts that must be resolved" }} + {{ else if eq .ForkInfo.Status 3 }} + {{ $disabled = "disabled" }} + {{ $title = "This branch does not exist on the upstream" }} + {{ end }} + + + {{ end }}
{{ end }} -- 2.51.2