Skip to content

Commit 1d8f02b

Browse files
committed
show tooltip
1 parent 8172210 commit 1d8f02b

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

routers/web/repo/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ func createCommon(ctx *context.Context) {
154154
ctx.Data["Licenses"] = repo_module.Licenses
155155
ctx.Data["Readmes"] = repo_module.Readmes
156156
ctx.Data["IsForcedPrivate"] = setting.Repository.ForcePrivate
157-
ctx.Data["CanCreateRepo"] = ctx.Doer.CanCreateRepo()
158-
ctx.Data["MaxCreationLimit"] = ctx.Doer.MaxCreationLimit()
157+
ctx.Data["CanCreateRepoInDoer"] = ctx.Doer.CanCreateRepo()
158+
ctx.Data["MaxCreationLimitOfDoer"] = ctx.Doer.MaxCreationLimit()
159159
ctx.Data["SupportedObjectFormats"] = git.DefaultFeatures().SupportedObjectFormats
160160
ctx.Data["DefaultObjectFormat"] = git.Sha1ObjectFormat
161161
}

templates/repo/create.tmpl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
<div class="inline required field {{if .Err_Owner}}error{{end}}">
1313
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
1414
<div class="ui selection owner dropdown">
15-
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
16-
<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
17-
{{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
18-
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
19-
</span>
15+
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}">
16+
<span class="text truncated-item-name"></span>
2017
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
2118
<div class="menu">
22-
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
19+
{{/* it can't use "disabled", otherwise the tooltip won't show */}}
20+
<div class="item truncated-item-container {{if .CanCreateRepoInDoer}}tw-opacity-55{{end}}" data-value="{{.SignedUser.ID}}"
21+
{{if .CanCreateRepoInDoer}}
22+
data-tooltip-content="{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimitOfDoer}}"
23+
data-tooltip-placement="bottom-start"
24+
{{end}}
25+
>
2326
{{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
2427
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
2528
</div>

0 commit comments

Comments
 (0)