mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Display head branch more comfortable on pull request view (#32000)
This PR do some minor improvements for head branch display on pull request view UI. - [x] Remove the link if the head branch has been deleted with a tooltip, so that users will not result in a 404 page - [x] Display a label if this pull request is an agit based one. 
This commit is contained in:
@ -50,9 +50,14 @@
|
||||
{{if .Issue.IsPull}}
|
||||
{{$headHref := .HeadTarget}}
|
||||
{{if .HeadBranchLink}}
|
||||
{{$headHref = HTMLFormat `<a href="%s">%s</a>` .HeadBranchLink $headHref}}
|
||||
{{$headHref = HTMLFormat `<a href="%s">%s</a> <button class="btn interact-fg" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` .HeadBranchLink $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}}
|
||||
{{else}}
|
||||
{{if .Issue.PullRequest.IsAgitFlow}}
|
||||
{{$headHref = HTMLFormat `%s <a href="%s" target="_blank"><span class="ui label basic tiny" data-tooltip-content="%s">AGit</span></a>` $headHref "https://docs.gitea.com/usage/agit" (ctx.Locale.Tr "repo.pull.agit_documentation")}}
|
||||
{{else}}
|
||||
{{$headHref = HTMLFormat `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr "form.target_branch_not_exist") $headHref}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{$headHref = HTMLFormat `%s <button class="btn interact-fg" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}}
|
||||
{{$baseHref := .BaseTarget}}
|
||||
{{if .BaseBranchLink}}
|
||||
{{$baseHref = HTMLFormat `<a href="%s">%s</a>` .BaseBranchLink $baseHref}}
|
||||
|
Reference in New Issue
Block a user