Fix color for transfer related buttons when having no permission to act (#24510)

Before:

<img width="1410" alt="Screen Shot 2023-05-04 at 09 28 23"
src="https://user-images.githubusercontent.com/17645053/236100146-2b64d274-2d79-4b4c-827c-3906a2a9dbb7.png">
<img width="1413" alt="Screen Shot 2023-05-04 at 09 28 30"
src="https://user-images.githubusercontent.com/17645053/236100157-15c12e83-a4f5-4b4e-b26b-73a8ce8bc0db.png">

After:

With no permission:

<img width="1409" alt="Screen Shot 2023-05-04 at 12 17 12"
src="https://user-images.githubusercontent.com/17645053/236144666-c2bb6ca2-59e1-45ae-93cd-d43545500d06.png">
<img width="1402" alt="Screen Shot 2023-05-04 at 12 17 17"
src="https://user-images.githubusercontent.com/17645053/236144677-c51a65cf-8aef-4566-b265-14b2ebb46d0b.png">


With permission:

<img width="1412" alt="Screen Shot 2023-05-04 at 12 16 45"
src="https://user-images.githubusercontent.com/17645053/236144565-9c5aa9a6-1424-49e3-a2b2-a129fecb856c.png">
<img width="1420" alt="Screen Shot 2023-05-04 at 12 16 51"
src="https://user-images.githubusercontent.com/17645053/236144573-a4064136-80d9-4c41-8f98-f51b4352bdf7.png">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Hester Gong 2023-05-04 21:21:30 +08:00 committed by GitHub
parent 03fab6a8bb
commit 7abe958f5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,7 @@
<form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}"> <form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}"> <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}">
<button type="submit" class="ui button {{if $.CanUserAcceptTransfer}}green {{end}} ok inverted small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> <button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}green {{end}} ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}>
{{$.locale.Tr "repo.transfer.accept"}} {{$.locale.Tr "repo.transfer.accept"}}
</button> </button>
</div> </div>
@ -60,7 +60,7 @@
<form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}"> <form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}">
{{$.CsrfTokenHtml}} {{$.CsrfTokenHtml}}
<div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}"> <div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}">
<button type="submit" class="ui button {{if $.CanUserAcceptTransfer}}red {{end}}ok inverted small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}> <button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}>
{{$.locale.Tr "repo.transfer.reject"}} {{$.locale.Tr "repo.transfer.reject"}}
</button> </button>
</div> </div>