diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-09-24 12:14:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 04:14:57 +0000 |
commit | e2f365b55cca7cf986a1f04e4d9e43d7e7aef7ad (patch) | |
tree | 20b22703ed23aa26eb7ed08f861c218563f592f8 /templates/repo | |
parent | aadbe0488f454b9f7f5a56765f4530f9d1e2c6ec (diff) | |
download | gitea-e2f365b55cca7cf986a1f04e4d9e43d7e7aef7ad.tar.gz gitea-e2f365b55cca7cf986a1f04e4d9e43d7e7aef7ad.zip |
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.
![图片](https://github.com/user-attachments/assets/872f26b6-f1cf-4427-9e41-e3a5b176dfa4)
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/issue/view_title.tmpl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 1243681f3a..7fa77b3f1c 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -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}} |