UI: bug fix, replace html tags <a> with <div> in button: delete branch

reason:

- unified code style
- Edge Browser Warning: `Links must have discernible text: Element has no title attribute`
- Using an empty anchor as an HTML tag will point to the current page, which cause the page jump before the execution of JavaScript

Signed-off-by: baronbunny <its@baronbunny.cn>
This commit is contained in:
baronbunny 2022-10-23 19:01:07 +08:00
parent 88a03a6133
commit 41354392d1
No known key found for this signature in database
GPG key ID: 13CA66BA865EC4B6

View file

@ -123,11 +123,15 @@
{{end}} {{end}}
{{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}}
{{if .IsDeleted}} {{if .IsDeleted}}
<a class="ui basic jump button icon tooltip undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID}}&name={{.DeletedBranch.Name}}" data-content="{{$.locale.Tr "repo.branch.restore" (.Name)}}" data-position="top right"><span class="text blue">{{svg "octicon-reply"}}</span></a> <div class="ui basic jump button icon tooltip undo-button" data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID}}&name={{.DeletedBranch.Name}}" data-content="{{$.locale.Tr "repo.branch.restore" (.Name)}}" data-position="top right">
<span class="text blue">
{{svg "octicon-reply"}}
</span>
</div>
{{else}} {{else}}
<a class="ui basic jump button icon tooltip delete-button delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name}}" data-content="{{$.locale.Tr "repo.branch.delete" (.Name)}}" data-position="top right" data-name="{{.Name}}"> <div class="ui basic jump button icon tooltip delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.Name}}" data-content="{{$.locale.Tr "repo.branch.delete" (.Name)}}" data-position="top right" data-name="{{.Name}}">
{{svg "octicon-trash"}} {{svg "octicon-trash"}}
</a> </div>
{{end}} {{end}}
{{end}} {{end}}
</td> </td>