mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1008 B
48 lines
1008 B
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package org
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"code.gitea.io/gitea/modules/base"
|
|
"code.gitea.io/gitea/modules/context"
|
|
shared "code.gitea.io/gitea/routers/web/shared/secrets"
|
|
)
|
|
|
|
const (
|
|
tplSettingsSecrets base.TplName = "org/settings/secrets"
|
|
)
|
|
|
|
// Secrets render organization secrets page
|
|
func Secrets(ctx *context.Context) {
|
|
ctx.Data["Title"] = ctx.Tr("secrets.secrets")
|
|
ctx.Data["PageIsOrgSettings"] = true
|
|
ctx.Data["PageIsOrgSettingsSecrets"] = true
|
|
|
|
shared.SetSecretsContext(ctx, ctx.ContextUser.ID, 0)
|
|
if ctx.Written() {
|
|
return
|
|
}
|
|
|
|
ctx.HTML(http.StatusOK, tplSettingsSecrets)
|
|
}
|
|
|
|
// SecretsPost add secrets
|
|
func SecretsPost(ctx *context.Context) {
|
|
shared.PerformSecretsPost(
|
|
ctx,
|
|
ctx.ContextUser.ID,
|
|
0,
|
|
ctx.Org.OrgLink+"/settings/secrets",
|
|
)
|
|
}
|
|
|
|
// SecretsDelete delete secrets
|
|
func SecretsDelete(ctx *context.Context) {
|
|
shared.PerformSecretsDelete(
|
|
ctx,
|
|
ctx.Org.OrgLink+"/settings/secrets",
|
|
)
|
|
}
|
|
|