-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Fix inconsistent disabled styling on logged-out repo header buttons #37406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wxiaoguang
merged 10 commits into
go-gitea:main
from
silverwind:repo-header-disabled-consistency
Apr 27, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
53810c1
Make logged-out repo header buttons visually consistent
silverwind 89469fe
fix
wxiaoguang 7dd0453
fix comment
wxiaoguang d2b183b
Restore faded look and apply pattern to fork button
silverwind e7cba5c
Move repo header button templates into a dedicated folder
silverwind 23bcbbd
Lead logged-out users to login instead of disabling the buttons
silverwind 5a8d771
fix
wxiaoguang 9679e20
fix layout
wxiaoguang c0899b3
Merge branch 'main' into repo-header-disabled-consistency
silverwind c3f6acf
Merge branch 'main' into repo-header-disabled-consistency
wxiaoguang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| {{$canNotForkOwn := and $.IsSigned (not $.CanSignedUserFork) (not $.UserAndOrgForks)}} | ||
| <div class="ui labeled button" | ||
| {{if not $.IsSigned}} | ||
| data-tooltip-content="{{ctx.Locale.Tr "repo.fork_guest_user"}}" | ||
| {{else if $canNotForkOwn}} | ||
| data-tooltip-content="{{ctx.Locale.Tr "repo.fork_from_self"}}" | ||
| {{end}} | ||
| > | ||
| <a role="button" class="ui compact small basic button {{if $.ShowForkModal}}show-modal{{end}}" | ||
| {{if not $.IsSigned}} | ||
| href="{{AppSubUrl}}/user/login" | ||
| {{else if $.ShowForkModal}}{{/* see backend comment for this logic */}} | ||
| href="#" data-modal="#fork-repo-modal" | ||
| {{else if eq (len $.UserAndOrgForks) 1}} | ||
| href="{{AppSubUrl}}/{{(index $.UserAndOrgForks 0).FullName}}" | ||
| {{else if $canNotForkOwn}} | ||
| href="#" | ||
| {{else}} | ||
| href="{{$.RepoLink}}/fork" | ||
|
wxiaoguang marked this conversation as resolved.
|
||
| {{end}} | ||
| > | ||
| {{svg "octicon-repo-forked"}}<span class="text not-mobile">{{ctx.Locale.Tr "repo.fork"}}</span> | ||
| </a> | ||
| <a class="ui basic label" href="{{$.Repository.Link}}/forks"> | ||
| {{CountFmt $.Repository.NumForks}} | ||
| </a> | ||
| </div> | ||
| {{if $.ShowForkModal}} | ||
| <div class="ui small modal" id="fork-repo-modal"> | ||
| <div class="header"> | ||
| {{ctx.Locale.Tr "repo.already_forked" $.Repository.Name}} | ||
| </div> | ||
| <div class="content"> | ||
| <div class="ui relaxed list"> | ||
| {{range $.UserAndOrgForks}} | ||
| <div class="item"> | ||
| <a class="flex-text-block" href="{{.Link}}">{{svg "octicon-repo-forked"}}{{.FullName}}</a> | ||
| </div> | ||
| {{end}} | ||
| </div> | ||
| {{if $.CanSignedUserFork}} | ||
| <div class="divider"></div> | ||
| <a href="{{$.RepoLink}}/fork">{{ctx.Locale.Tr "repo.fork_to_different_account"}}</a> | ||
| {{end}} | ||
| </div> | ||
| </div> | ||
| {{end}} | ||
6 changes: 3 additions & 3 deletions
6
templates/repo/star_unstar.tmpl → templates/repo/header/star.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
templates/repo/watch_unwatch.tmpl → templates/repo/header/watch.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}> | ||
| {{$buttonText := ctx.Locale.Tr "repo.watch"}} | ||
| {{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}} | ||
| <button type="button" class="ui compact small basic button" aria-label="{{$buttonText}}" | ||
| <a role="button" class="ui compact small basic button" aria-label="{{$buttonText}}" | ||
| {{if $.IsSigned}} | ||
| data-fetch-method="post" | ||
| data-fetch-url="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}unwatch{{else}}watch{{end}}" | ||
| data-fetch-sync="$closest(.ui.labeled.button)" | ||
| {{else}} | ||
| disabled | ||
| href="{{AppSubUrl}}/user/login" | ||
| {{end}} | ||
| > | ||
| {{svg "octicon-eye"}} | ||
| <span class="not-mobile" aria-hidden="true">{{$buttonText}}</span> | ||
| </button> | ||
| <a class="ui basic label" href="{{.RepoLink}}/watchers"> | ||
| </a> | ||
| <a class="ui basic label" href="{{$.RepoLink}}/watchers"> | ||
| {{CountFmt .Repository.NumWatches}} | ||
| </a> | ||
| </div> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.