summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-03-09 21:21:12 -0500
committerGitHub <noreply@github.com>2023-03-09 21:21:12 -0500
commit975785dd42206e0ec22d515f83198f23a10ac445 (patch)
tree82b43e721b31f8c05fd69a6b16a13e5cc392f5ff /routers
parente269e8901f243b6d95920a9883d5f8b0ece908a5 (diff)
downloadgitea-975785dd42206e0ec22d515f83198f23a10ac445.tar.gz
gitea-975785dd42206e0ec22d515f83198f23a10ac445.zip
Rename `canWriteUnit` to `canWriteProjects` (#23386) (#23399)
Backport #23386 A part of https://github.com/go-gitea/gitea/pull/22865 Co-authored-by: yp05327 <576951401@qq.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/org/projects.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go
index 2401005eb7..30a58081f0 100644
--- a/routers/web/org/projects.go
+++ b/routers/web/org/projects.go
@@ -103,7 +103,7 @@ func Projects(ctx *context.Context) {
pager.AddParam(ctx, "state", "State")
ctx.Data["Page"] = pager
- ctx.Data["CanWriteProjects"] = canWriteUnit(ctx)
+ ctx.Data["CanWriteProjects"] = canWriteProjects(ctx)
ctx.Data["IsShowClosed"] = isShowClosed
ctx.Data["PageIsViewProjects"] = true
ctx.Data["SortType"] = sortType
@@ -111,7 +111,7 @@ func Projects(ctx *context.Context) {
ctx.HTML(http.StatusOK, tplProjects)
}
-func canWriteUnit(ctx *context.Context) bool {
+func canWriteProjects(ctx *context.Context) bool {
if ctx.ContextUser.IsOrganization() {
return ctx.Org.CanWriteUnit(ctx, unit.TypeProjects)
}
@@ -122,7 +122,7 @@ func canWriteUnit(ctx *context.Context) bool {
func NewProject(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.projects.new")
ctx.Data["BoardTypes"] = project_model.GetBoardConfig()
- ctx.Data["CanWriteProjects"] = canWriteUnit(ctx)
+ ctx.Data["CanWriteProjects"] = canWriteProjects(ctx)
ctx.Data["HomeLink"] = ctx.ContextUser.HomeLink()
shared_user.RenderUserHeader(ctx)
ctx.HTML(http.StatusOK, tplProjectsNew)
@@ -135,7 +135,7 @@ func NewProjectPost(ctx *context.Context) {
shared_user.RenderUserHeader(ctx)
if ctx.HasError() {
- ctx.Data["CanWriteProjects"] = canWriteUnit(ctx)
+ ctx.Data["CanWriteProjects"] = canWriteProjects(ctx)
ctx.Data["PageIsViewProjects"] = true
ctx.Data["BoardTypes"] = project_model.GetBoardConfig()
ctx.HTML(http.StatusOK, tplProjectsNew)
@@ -214,7 +214,7 @@ func EditProject(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.projects.edit")
ctx.Data["PageIsEditProjects"] = true
ctx.Data["PageIsViewProjects"] = true
- ctx.Data["CanWriteProjects"] = canWriteUnit(ctx)
+ ctx.Data["CanWriteProjects"] = canWriteProjects(ctx)
shared_user.RenderUserHeader(ctx)
p, err := project_model.GetProjectByID(ctx, ctx.ParamsInt64(":id"))
@@ -243,7 +243,7 @@ func EditProjectPost(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.projects.edit")
ctx.Data["PageIsEditProjects"] = true
ctx.Data["PageIsViewProjects"] = true
- ctx.Data["CanWriteProjects"] = canWriteUnit(ctx)
+ ctx.Data["CanWriteProjects"] = canWriteProjects(ctx)
shared_user.RenderUserHeader(ctx)
if ctx.HasError() {
@@ -332,7 +332,7 @@ func ViewProject(ctx *context.Context) {
project.RenderedContent = project.Description
ctx.Data["LinkedPRs"] = linkedPrsMap
ctx.Data["PageIsViewProjects"] = true
- ctx.Data["CanWriteProjects"] = canWriteUnit(ctx)
+ ctx.Data["CanWriteProjects"] = canWriteProjects(ctx)
ctx.Data["Project"] = project
ctx.Data["IssuesMap"] = issuesMap
ctx.Data["Boards"] = boards