1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-22 08:42:32 -05:00
yp05327 2023-09-06 15:38:14 +09:00 committed by GitHub
parent 31c92d9695
commit 0850be6750
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 3 additions and 7 deletions

View file

@ -250,6 +250,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
return return
} }
} }
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["CanReadProjects"] = ctx.Org.CanReadUnit(ctx, unit.TypeProjects) ctx.Data["CanReadProjects"] = ctx.Org.CanReadUnit(ctx, unit.TypeProjects)
ctx.Data["CanReadPackages"] = ctx.Org.CanReadUnit(ctx, unit.TypePackages) ctx.Data["CanReadPackages"] = ctx.Org.CanReadUnit(ctx, unit.TypePackages)

View file

@ -471,6 +471,7 @@ func RepoAssignment(ctx *Context) context.CancelFunc {
} }
ctx.Repo.Owner = owner ctx.Repo.Owner = owner
ctx.ContextUser = owner ctx.ContextUser = owner
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["Username"] = ctx.Repo.Owner.Name ctx.Data["Username"] = ctx.Repo.Owner.Name
// redirect link to wiki // redirect link to wiki

View file

@ -152,7 +152,6 @@ func Home(ctx *context.Context) {
pager.SetDefaultParams(ctx) pager.SetDefaultParams(ctx)
pager.AddParam(ctx, "language", "Language") pager.AddParam(ctx, "language", "Language")
ctx.Data["Page"] = pager ctx.Data["Page"] = pager
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0 ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0

View file

@ -62,7 +62,6 @@ func Members(ctx *context.Context) {
} }
ctx.Data["Page"] = pager ctx.Data["Page"] = pager
ctx.Data["Members"] = members ctx.Data["Members"] = members
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["MembersIsPublicMember"] = membersIsPublic ctx.Data["MembersIsPublicMember"] = membersIsPublic
ctx.Data["MembersIsUserOrgOwner"] = organization.IsUserOrgOwner(members, org.ID) ctx.Data["MembersIsUserOrgOwner"] = organization.IsUserOrgOwner(members, org.ID)
ctx.Data["MembersTwoFaStatus"] = members.GetTwoFaStatus() ctx.Data["MembersTwoFaStatus"] = members.GetTwoFaStatus()

View file

@ -45,7 +45,6 @@ func Settings(ctx *context.Context) {
ctx.Data["PageIsSettingsOptions"] = true ctx.Data["PageIsSettingsOptions"] = true
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
ctx.Data["RepoAdminChangeTeamAccess"] = ctx.Org.Organization.RepoAdminChangeTeamAccess ctx.Data["RepoAdminChangeTeamAccess"] = ctx.Org.Organization.RepoAdminChangeTeamAccess
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.HTML(http.StatusOK, tplSettingsOptions) ctx.HTML(http.StatusOK, tplSettingsOptions)
} }

View file

@ -56,7 +56,6 @@ func Teams(ctx *context.Context) {
} }
} }
ctx.Data["Teams"] = ctx.Org.Teams ctx.Data["Teams"] = ctx.Org.Teams
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.HTML(http.StatusOK, tplTeams) ctx.HTML(http.StatusOK, tplTeams)
} }

View file

@ -58,7 +58,6 @@ func Packages(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("packages.title") ctx.Data["Title"] = ctx.Tr("packages.title")
ctx.Data["IsPackagesPage"] = true ctx.Data["IsPackagesPage"] = true
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["Query"] = query ctx.Data["Query"] = query
ctx.Data["PackageType"] = packageType ctx.Data["PackageType"] = packageType
ctx.Data["AvailableTypes"] = packages.TypeList ctx.Data["AvailableTypes"] = packages.TypeList

View file

@ -22,7 +22,6 @@ import (
func prepareContextForCommonProfile(ctx *context.Context) { func prepareContextForCommonProfile(ctx *context.Context) {
ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["ContextUser"] = ctx.ContextUser
ctx.Data["EnableFeed"] = setting.Other.EnableFeed ctx.Data["EnableFeed"] = setting.Other.EnableFeed
ctx.Data["FeedURL"] = ctx.ContextUser.HomeLink() ctx.Data["FeedURL"] = ctx.ContextUser.HomeLink()
} }

View file

@ -30,7 +30,6 @@ func CodeSearch(ctx *context.Context) {
ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled ctx.Data["IsPackageEnabled"] = setting.Packages.Enabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["Title"] = ctx.Tr("explore.code") ctx.Data["Title"] = ctx.Tr("explore.code")
ctx.Data["ContextUser"] = ctx.ContextUser
language := ctx.FormTrim("l") language := ctx.FormTrim("l")
keyword := ctx.FormTrim("q") keyword := ctx.FormTrim("q")

View file

@ -27,6 +27,7 @@ func UserAssignmentWeb() func(ctx *context.Context) {
} }
} }
ctx.ContextUser = userAssignment(ctx.Base, ctx.Doer, errorFn) ctx.ContextUser = userAssignment(ctx.Base, ctx.Doer, errorFn)
ctx.Data["ContextUser"] = ctx.ContextUser
} }
} }