From 53810c121ac852b0169f44a29d50addb82b0d550 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 24 Apr 2026 13:48:25 +0200 Subject: [PATCH 1/8] Make logged-out repo header buttons visually consistent Move the `disabled` class from the inner ` + {{if $.IsSigned}} + + {{else}} + + {{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}} + + + {{end}} {{CountFmt .Repository.NumStars}} diff --git a/templates/repo/header/watch.tmpl b/templates/repo/header/watch.tmpl index 35a10a4ac0402..5501fd2cacb98 100644 --- a/templates/repo/header/watch.tmpl +++ b/templates/repo/header/watch.tmpl @@ -1,17 +1,22 @@ -{{/* not using "disabled": need to show the tooltip and keep the link clickable, let the sub buttons decide their cursor */}} -
+
{{$buttonText := ctx.Locale.Tr "repo.watch"}} {{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}} - {{/* not using "disabled": make this button have the the same style as the clickable link alongside */}} - - + {{if $.IsSigned}} + + {{else}} + + {{svg "octicon-eye"}} + + + {{end}} + {{CountFmt .Repository.NumWatches}}
From 5a8d7713a8dc784ca1b817f65358539fbe3e1657 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 25 Apr 2026 01:36:40 +0800 Subject: [PATCH 7/8] fix --- templates/repo/header/fork.tmpl | 27 +++++++++++++-------------- templates/repo/header/star.tmpl | 21 +++++++++------------ templates/repo/header/watch.tmpl | 21 +++++++++------------ 3 files changed, 31 insertions(+), 38 deletions(-) diff --git a/templates/repo/header/fork.tmpl b/templates/repo/header/fork.tmpl index 3ac76b2d2d0e5..cf99681f23dc0 100644 --- a/templates/repo/header/fork.tmpl +++ b/templates/repo/header/fork.tmpl @@ -1,25 +1,22 @@ -{{$cantForkOwn := and $.IsSigned (not $.CanSignedUserFork) (not $.UserAndOrgForks)}} +{{$canNotForkOwn := and $.IsSigned (not $.CanSignedUserFork) (not $.UserAndOrgForks)}} +{{if $.ShowForkModal}} +{{end}} diff --git a/templates/repo/header/star.tmpl b/templates/repo/header/star.tmpl index 56fdcda77a69a..d1762bc004e00 100644 --- a/templates/repo/header/star.tmpl +++ b/templates/repo/header/star.tmpl @@ -1,21 +1,18 @@
{{$buttonText := ctx.Locale.Tr "repo.star"}} {{if $.IsStaringRepo}}{{$buttonText = ctx.Locale.Tr "repo.unstar"}}{{end}} - {{if $.IsSigned}} - - {{else}} - - {{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}} - - - {{end}} + {{else}} + href="{{AppSubUrl}}/user/login" + {{end}} + > + {{svg (Iif $.IsStaringRepo "octicon-star-fill" "octicon-star")}} + + {{CountFmt .Repository.NumStars}} diff --git a/templates/repo/header/watch.tmpl b/templates/repo/header/watch.tmpl index 5501fd2cacb98..a00fd01c804da 100644 --- a/templates/repo/header/watch.tmpl +++ b/templates/repo/header/watch.tmpl @@ -1,21 +1,18 @@
{{$buttonText := ctx.Locale.Tr "repo.watch"}} {{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}} - {{if $.IsSigned}} - - {{else}} - - {{svg "octicon-eye"}} - - - {{end}} + {{else}} + href="{{AppSubUrl}}/user/login" + {{end}} + > + {{svg "octicon-eye"}} + + {{CountFmt .Repository.NumWatches}} From 9679e209e4e634d64b2a0d45355b77f34b38b9e1 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 25 Apr 2026 01:40:56 +0800 Subject: [PATCH 8/8] fix layout --- templates/repo/header/fork.tmpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/repo/header/fork.tmpl b/templates/repo/header/fork.tmpl index cf99681f23dc0..e14851f0684ae 100644 --- a/templates/repo/header/fork.tmpl +++ b/templates/repo/header/fork.tmpl @@ -16,7 +16,7 @@ {{else if $canNotForkOwn}} href="#" {{else}} - href="{{$.RepoLink}}/fork" + href="{{$.RepoLink}}/fork" {{end}} > {{svg "octicon-repo-forked"}}{{ctx.Locale.Tr "repo.fork"}} @@ -30,11 +30,11 @@
{{ctx.Locale.Tr "repo.already_forked" $.Repository.Name}}
-