Skip to content

Commit 6ef8d28

Browse files
committed
fix user profile readme, check time tracking
1 parent 0155ad1 commit 6ef8d28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

routers/web/shared/user/header.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ func RenderUserOrgHeader(ctx *context.Context) (result *PrepareOwnerHeaderResult
149149
if err := loadHeaderCount(ctx); err != nil {
150150
return nil, err
151151
}
152-
_, profileReadmeBlob := FindOwnerProfileReadme(ctx, ctx.Doer)
153-
ctx.Data["HasUserProfileReadme"] = profileReadmeBlob != nil
154152

155153
result = &PrepareOwnerHeaderResult{}
156154
if ctx.ContextUser.IsOrganization() {
@@ -159,6 +157,8 @@ func RenderUserOrgHeader(ctx *context.Context) (result *PrepareOwnerHeaderResult
159157
result.HasOrgProfileReadme = result.ProfilePublicReadmeBlob != nil || result.ProfilePrivateReadmeBlob != nil
160158
ctx.Data["HasOrgProfileReadme"] = result.HasOrgProfileReadme // many pages need it to show the "overview" tab
161159
} else {
160+
_, profileReadmeBlob := FindOwnerProfileReadme(ctx, ctx.Doer)
161+
ctx.Data["HasUserProfileReadme"] = profileReadmeBlob != nil
162162
prepareContextForProfileBigAvatar(ctx)
163163
}
164164
return result, nil

templates/org/menu.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
{{end}}
4545
</a>
4646
{{end}}
47-
{{if .IsOrganizationOwner}}
47+
{{if and EnableTimetracking .IsOrganizationOwner}}
4848
<a class="{{if $.PageIsOrgTimes}}active{{end}} item" href="{{$.OrgLink}}/worktime">
4949
{{svg "octicon-clock"}} {{ctx.Locale.Tr "org.worktime"}}
5050
</a>

0 commit comments

Comments
 (0)