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/user | |
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/user')
-rw-r--r-- | templates/user/dashboard/issues.tmpl | 4 | ||||
-rw-r--r-- | templates/user/profile.tmpl | 8 | ||||
-rw-r--r-- | templates/user/settings/applications.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/keys_gpg.tmpl | 4 | ||||
-rw-r--r-- | templates/user/settings/keys_principal.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/keys_ssh.tmpl | 4 | ||||
-rw-r--r-- | templates/user/settings/profile.tmpl | 10 |
7 files changed, 17 insertions, 17 deletions
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index c7065557bd..ef153c38ab 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -34,7 +34,7 @@ <div class="ui divider"></div> <a class="{{if not $.RepoIDs}}ui basic primary button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}"> <span class="text truncate">All</span> - <span class="ui">{{CountFmt .TotalIssueCount}}</span> + <span>{{CountFmt .TotalIssueCount}}</span> </a> {{range .Repos}} {{with $Repo := .}} @@ -53,7 +53,7 @@ {{- end -}} ]&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}" title="{{.FullName}}"> <span class="text truncate">{{$Repo.FullName}}</span> - <span class="ui">{{CountFmt (index $.Counts $Repo.ID)}}</span> + <span>{{CountFmt (index $.Counts $Repo.ID)}}</span> </a> {{end}} {{end}} diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 5b445bdb00..b26b934366 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -6,7 +6,7 @@ <div class="ui card"> <div id="profile-avatar" class="content gt-df"/> {{if eq .SignedUserName .Owner.Name}} - <a class="image tooltip" href="{{AppSubUrl}}/user/settings" data-content="{{.locale.Tr "user.change_avatar"}}" data-position="bottom center"> + <a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{.locale.Tr "user.change_avatar"}}"> {{avatar $.Context .Owner 290}} </a> {{else}} @@ -19,7 +19,7 @@ {{if .Owner.FullName}}<span class="header text center">{{.Owner.FullName}}</span>{{end}} <span class="username text center">{{.Owner.Name}}</span> {{if .EnableFeed}} - <a href="{{.Owner.HomeLink}}.rss"><i class="ui grey icon tooltip gt-ml-3" data-content="{{.locale.Tr "rss_feed"}}" data-position="bottom center">{{svg "octicon-rss" 18}}</i></a> + <a href="{{.Owner.HomeLink}}.rss"><i class="ui text grey gt-ml-3" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a> {{end}} <div class="gt-mt-3"> <a class="muted" href="{{.Owner.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.Owner.NumFollowers}} {{.locale.Tr "user.followers"}}</a> ยท <a class="muted" href="{{.Owner.HomeLink}}?tab=following">{{.Owner.NumFollowing}} {{.locale.Tr "user.following"}}</a> @@ -62,7 +62,7 @@ {{range .Orgs}} {{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}} <li> - <a class="tooltip" href="{{.HomeLink}}" data-content="{{.Name}}" data-position="top center"> + <a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}"> {{avatar $.Context .}} </a> </li> @@ -76,7 +76,7 @@ <ul class="user-badges"> {{range .Badges}} <li> - <img width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-content="{{.Description}}" class="tooltip"/> + <img width="64" height="64" src="{{.ImageURL}}" alt="{{.Description}}" data-tooltip-content="{{.Description}}"> </li> {{end}} </ul> diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 18132c4a75..23cd111229 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -19,7 +19,7 @@ {{$.locale.Tr "settings.delete_token"}} </button> </div> - <i class="icon tooltip{{if .HasRecentActivity}} green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.token_state_desc"}}"{{end}}>{{svg "fontawesome-send" 36}}</i> + <i class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.token_state_desc"}}"{{end}}>{{svg "fontawesome-send" 36}}</i> <div class="content"> <details><summary><strong>{{.Name}}</strong></summary> <p class="gt-my-2">{{$.locale.Tr "settings.scopes_list"}}</p> diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl index 7f1604bdca..772fc4613b 100644 --- a/templates/user/settings/keys_gpg.tmpl +++ b/templates/user/settings/keys_gpg.tmpl @@ -58,10 +58,10 @@ </div> <div class="content"> {{if .Verified}} - <span class="tooltip" data-content="{{$.locale.Tr "settings.gpg_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{$.locale.Tr "settings.gpg_key_verified"}}</strong></span> + <span data-tooltip-content="{{$.locale.Tr "settings.gpg_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{$.locale.Tr "settings.gpg_key_verified"}}</strong></span> {{end}} {{if gt (len .Emails) 0}} - <span class="tooltip" data-content="{{$.locale.Tr "settings.gpg_key_matched_identities_long"}}">{{svg "octicon-mail"}} {{$.locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}<strong>{{.Email}} </strong>{{end}}</span> + <span data-tooltip-content="{{$.locale.Tr "settings.gpg_key_matched_identities_long"}}">{{svg "octicon-mail"}} {{$.locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}<strong>{{.Email}} </strong>{{end}}</span> {{end}} <div class="print meta"> <b>{{$.locale.Tr "settings.key_id"}}:</b> {{.PaddedKeyID}} diff --git a/templates/user/settings/keys_principal.tmpl b/templates/user/settings/keys_principal.tmpl index 8012b874cd..a156306112 100644 --- a/templates/user/settings/keys_principal.tmpl +++ b/templates/user/settings/keys_principal.tmpl @@ -21,7 +21,7 @@ {{$.locale.Tr "settings.delete_key"}} </button> </div> - <i class="icon tooltip{{if .HasRecentActivity}} green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 36}}</i> + <i class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 36}}</i> <div class="content"> <strong>{{.Name}}</strong> <div class="activity meta"> diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl index 01b79a9e71..5d518f3bb0 100644 --- a/templates/user/settings/keys_ssh.tmpl +++ b/templates/user/settings/keys_ssh.tmpl @@ -47,11 +47,11 @@ </div> <div class="left floated content"> - <span class="tooltip text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span> + <span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span> </div> <div class="content"> {{if .Verified}} - <span class="tooltip" data-content="{{$.locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{$.locale.Tr "settings.ssh_key_verified"}}</strong></span> + <span data-tooltip-content="{{$.locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{$.locale.Tr "settings.ssh_key_verified"}}</strong></span> {{end}} <strong>{{.Name}}</strong> <div class="print meta"> diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index 240a579fb7..6cd330241a 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -30,7 +30,7 @@ </div> <div class="inline field"> <div class="ui checkbox" id="keep-email-private"> - <label class="tooltip" data-content="{{.locale.Tr "settings.keep_email_private_popup"}}"><strong>{{.locale.Tr "settings.keep_email_private"}}</strong></label> + <label data-tooltip-content="{{.locale.Tr "settings.keep_email_private_popup"}}"><strong>{{.locale.Tr "settings.keep_email_private"}}</strong></label> <input name="keep_email_private" type="checkbox" {{if .SignedUser.KeepEmailPrivate}}checked{{end}}> </div> </div> @@ -69,11 +69,11 @@ <div class="menu"> {{range $mode := .AllowedUserVisibilityModes}} {{if $mode.IsPublic}} - <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div> + <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div> {{else if $mode.IsLimited}} - <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div> + <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div> {{else if $mode.IsPrivate}} - <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div> + <div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div> {{end}} {{end}} </div> @@ -82,7 +82,7 @@ <div class="field"> <div class="ui checkbox" id="keep-activity-private"> - <label class="tooltip" data-content="{{.locale.Tr "settings.keep_activity_private_popup"}}"><strong>{{.locale.Tr "settings.keep_activity_private"}}</strong></label> + <label data-tooltip-content="{{.locale.Tr "settings.keep_activity_private_popup"}}"><strong>{{.locale.Tr "settings.keep_activity_private"}}</strong></label> <input name="keep_activity_private" type="checkbox" {{if .SignedUser.KeepActivityPrivate}}checked{{end}}> </div> </div> |