diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-03-24 18:35:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-24 18:35:38 +0800 |
commit | 8d5fbeb7a290791dda8e8e8a1a0fd6824b76494f (patch) | |
tree | 4f7651105a8ad92d99de5a44daa943b70d79c38c /templates/repo/header.tmpl | |
parent | 87f0f7e670c6c0e6aeab8c4458bfdb9d954eacec (diff) | |
download | gitea-8d5fbeb7a290791dda8e8e8a1a0fd6824b76494f.tar.gz gitea-8d5fbeb7a290791dda8e8e8a1a0fd6824b76494f.zip |
Use data-tooltip-content for tippy tooltip (#23649)
Follow:
* #23574
* Remove all ".tooltip[data-content=...]"
Major changes:
* Remove "tooltip" class, use "[data-tooltip-content=...]" instead of
".tooltip[data-content=...]"
* Remove legacy `data-position`, it's dead code since last Fomantic
Tooltip -> Tippy Tooltip refactoring
* Rename reaction attribute from `data-content` to
`data-reaction-content`
* Add comments for some `data-content`: `{{/* used by the form */}}`
* Remove empty "ui" class
* Use "text color" for SVG icons (a few)
Diffstat (limited to 'templates/repo/header.tmpl')
-rw-r--r-- | templates/repo/header.tmpl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index beea89399e..ef2549eb7c 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -14,7 +14,7 @@ <div class="gt-mx-2">/</div> <a href="{{$.RepoLink}}">{{.Name}}</a> {{if $.EnableFeed}} - <a href="{{$.RepoLink}}.rss"><i class="ui grey icon tooltip gt-ml-3" data-content="{{$.locale.Tr "rss_feed"}}" data-position="top center">{{svg "octicon-rss" 18}}</i></a> + <a href="{{$.RepoLink}}.rss"><i class="ui grey icon gt-ml-3" data-tooltip-content="{{$.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a> {{end}} <div class="labels gt-df gt-ac gt-fw"> {{if .IsTemplate}} @@ -51,7 +51,7 @@ {{if $.RepoTransfer}} <form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}"> {{$.CsrfTokenHtml}} - <div class="ui tooltip" data-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}" data-position="bottom center"> + <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}}> {{$.locale.Tr "repo.transfer.accept"}} </button> @@ -59,7 +59,7 @@ </form> <form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}"> {{$.CsrfTokenHtml}} - <div class="ui tooltip" data-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}" data-position="bottom center"> + <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}}> {{$.locale.Tr "repo.transfer.reject"}} </button> @@ -68,7 +68,7 @@ {{end}} <form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button{{if not $.IsSigned}} tooltip{{end}}"{{if not $.IsSigned}} data-content="{{$.locale.Tr "repo.watch_guest_user"}}" data-position="top center"{{end}}> + <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{$.locale.Tr "repo.watch_guest_user"}}"{{end}}> <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}> {{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{$.locale.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye"}}{{$.locale.Tr "repo.watch"}}{{end}} </button> @@ -80,7 +80,7 @@ {{if not $.DisableStars}} <form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}"> {{$.CsrfTokenHtml}} - <div class="ui labeled button{{if not $.IsSigned}} tooltip{{end}}"{{if not $.IsSigned}} data-content="{{$.locale.Tr "repo.star_guest_user"}}" data-position="top center"{{end}}> + <div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{$.locale.Tr "repo.star_guest_user"}}"{{end}}> <button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}> {{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{$.locale.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{$.locale.Tr "repo.star"}}{{end}} </button> @@ -93,14 +93,14 @@ {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}} <div class="ui labeled button {{if or (not $.IsSigned) (and (not $.CanSignedUserFork) (eq (len $.UserAndOrgForks) 0))}} - tooltip disabled + disabled {{end}}" {{if not $.IsSigned}} - data-content="{{$.locale.Tr "repo.fork_guest_user"}}" + data-tooltip-content="{{$.locale.Tr "repo.fork_guest_user"}}" {{else if and (not $.CanSignedUserFork) (eq (len $.UserAndOrgForks) 0)}} - data-content="{{$.locale.Tr "repo.fork_from_self"}}" + data-tooltip-content="{{$.locale.Tr "repo.fork_from_self"}}" {{end}} - data-position="top center"> + > <a class="ui compact{{if $.ShowForkModal}} show-modal{{end}} small basic button" {{if not $.CanSignedUserFork}} {{if gt (len $.UserAndOrgForks) 1}} |