]> source.dussan.org Git - gitea.git/commitdiff
Move secrets and runners settings to actions settings (#24200)
authorHester Gong <hestergong@gmail.com>
Fri, 28 Apr 2023 00:08:47 +0000 (08:08 +0800)
committerGitHub <noreply@github.com>
Fri, 28 Apr 2023 00:08:47 +0000 (20:08 -0400)
This PR moves the secrets and runners settings to actions settings on
all settings(repo,org,user,admin) levels.

After this PR, if
[ENABLED](https://github.com/go-gitea/gitea/blob/5e7543fcf441afb30aba6188edac754ef32b9ac3/custom/conf/app.example.ini#L2604)
inside `app.ini` under `[actions]` is set to `false`, the "Actions" tab
(including runners management and secrets management) will not be shown.

After, the settings under actions settings for each level:

1. Admin Level
"Runners Management"
<img width="1437" alt="Screen Shot 2023-04-26 at 14 34 20"
src="https://user-images.githubusercontent.com/17645053/234489731-15822d21-38e1-4560-8bbe-69f122376abc.png">

2. User Level
"Secrets Management"
<img width="1427" alt="Screen Shot 2023-04-26 at 14 34 30"
src="https://user-images.githubusercontent.com/17645053/234489795-68c9c0cb-24f8-4f09-95c6-458ab914c313.png">

3. Repo and Organization Levels
"Runners Management" and "Secrets Management"
   Org:
<img width="1437" alt="Screen Shot 2023-04-26 at 14 35 07"
src="https://user-images.githubusercontent.com/17645053/234489996-f3af5ebb-d354-46ca-9087-a0b586845281.png">

<img width="1433" alt="Screen Shot 2023-04-26 at 14 35 14"
src="https://user-images.githubusercontent.com/17645053/234490004-3abf8fed-81fd-4ce2-837a-935dade1793d.png">

    Repo:
<img width="1419" alt="Screen Shot 2023-04-26 at 14 34 50"
src="https://user-images.githubusercontent.com/17645053/234489904-80c11038-4b58-462c-9d0b-8b7cf70bc2b3.png">

<img width="1430" alt="Screen Shot 2023-04-26 at 14 34 57"
src="https://user-images.githubusercontent.com/17645053/234489918-4e8d1fe2-9bcd-4d8a-96c1-238a8088d92e.png">

It also finished these tasks :

- [x] rename routers function "runners" to "actions", and refactor
related file names
- [x] check and modify part of the runners related functions to match
their name
- [x] Fix backend check caused by fmt check

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
43 files changed:
options/locale/locale_en-US.ini
routers/web/admin/admin.go
routers/web/admin/applications.go
routers/web/admin/auths.go
routers/web/admin/config.go
routers/web/admin/emails.go
routers/web/admin/notice.go
routers/web/admin/orgs.go
routers/web/admin/packages.go
routers/web/admin/repos.go
routers/web/admin/runners.go
routers/web/admin/users.go
routers/web/org/org_runners.go [deleted file]
routers/web/org/setting.go
routers/web/org/setting/runners.go [new file with mode: 0644]
routers/web/org/setting_secrets.go [deleted file]
routers/web/repo/runners.go [deleted file]
routers/web/repo/setting/runners.go [new file with mode: 0644]
routers/web/repo/setting/secrets.go [new file with mode: 0644]
routers/web/repo/setting_secrets.go [deleted file]
routers/web/repo/webhook.go
routers/web/shared/actions/runners.go
routers/web/user/setting/secrets.go
routers/web/web.go
services/auth/middleware.go
templates/admin/actions.tmpl [new file with mode: 0644]
templates/admin/navbar.tmpl
templates/admin/runners/base.tmpl [deleted file]
templates/org/settings/actions.tmpl [new file with mode: 0644]
templates/org/settings/navbar.tmpl
templates/org/settings/runners.tmpl [deleted file]
templates/org/settings/secrets.tmpl [deleted file]
templates/repo/header.tmpl
templates/repo/settings/actions.tmpl [new file with mode: 0644]
templates/repo/settings/nav.tmpl
templates/repo/settings/navbar.tmpl
templates/repo/settings/runners.tmpl [deleted file]
templates/shared/secrets/add_list.tmpl
templates/user/settings/actions.tmpl [new file with mode: 0644]
templates/user/settings/navbar.tmpl
templates/user/settings/secrets.tmpl [deleted file]
web_src/css/base.css
web_src/css/repository.css

index a6ffc1f4758ba81dddcacd88fb2e17c1f76a20a2..fb21ee2ec445d0a740e1a16f94be37a7457e6fdd 100644 (file)
@@ -3357,6 +3357,7 @@ deletion = Remove secret
 deletion.description = Removing a secret is permanent and cannot be undone. Continue?
 deletion.success = The secret has been removed.
 deletion.failed = Failed to remove secret.
+management = Secrets Management
 
 [actions]
 actions = Actions
index 9847a6d9236f66f89eb3f7173ea8d77910ad3e27..35c387c28bd89ae1eeee88ebfc3d4de15d72eb81 100644 (file)
@@ -113,7 +113,6 @@ func updateSystemStatus() {
 // Dashboard show admin panel dashboard
 func Dashboard(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.dashboard")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminDashboard"] = true
        ctx.Data["Stats"] = activities_model.GetStatistic()
        ctx.Data["NeedUpdate"] = updatechecker.GetNeedUpdate()
@@ -129,7 +128,6 @@ func Dashboard(ctx *context.Context) {
 func DashboardPost(ctx *context.Context) {
        form := web.GetForm(ctx).(*forms.AdminDashboardForm)
        ctx.Data["Title"] = ctx.Tr("admin.dashboard")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminDashboard"] = true
        ctx.Data["Stats"] = activities_model.GetStatistic()
        updateSystemStatus()
@@ -155,7 +153,6 @@ func DashboardPost(ctx *context.Context) {
 // Monitor show admin monitor page
 func Monitor(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.monitor")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminMonitor"] = true
        ctx.Data["Processes"], ctx.Data["ProcessCount"] = process.GetManager().Processes(false, true)
        ctx.Data["Entries"] = cron.ListTasks()
@@ -167,7 +164,6 @@ func Monitor(ctx *context.Context) {
 // GoroutineStacktrace show admin monitor goroutines page
 func GoroutineStacktrace(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.monitor")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminMonitor"] = true
 
        processStacks, processCount, goroutineCount, err := process.GetManager().ProcessStacktraces(false, false)
@@ -202,7 +198,6 @@ func Queue(ctx *context.Context) {
                return
        }
        ctx.Data["Title"] = ctx.Tr("admin.monitor.queue", mq.Name)
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminMonitor"] = true
        ctx.Data["Queue"] = mq
        ctx.HTML(http.StatusOK, tplQueue)
index 745d17ff2a442a95282b341ca28af9616a4f15c9..7b2752434037472b21c5207f2eb445d1465494b5 100644 (file)
@@ -31,7 +31,6 @@ func newOAuth2CommonHandlers() *user_setting.OAuth2CommonHandlers {
 // Applications render org applications page (for org, at the moment, there are only OAuth2 applications)
 func Applications(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("settings.applications")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminApplications"] = true
 
        apps, err := auth.GetOAuth2ApplicationsByUserID(ctx, 0)
@@ -47,7 +46,6 @@ func Applications(ctx *context.Context) {
 // ApplicationsPost response for adding an oauth2 application
 func ApplicationsPost(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("settings.applications")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminApplications"] = true
 
        oa := newOAuth2CommonHandlers()
@@ -56,7 +54,6 @@ func ApplicationsPost(ctx *context.Context) {
 
 // EditApplication displays the given application
 func EditApplication(ctx *context.Context) {
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminApplications"] = true
 
        oa := newOAuth2CommonHandlers()
@@ -66,7 +63,6 @@ func EditApplication(ctx *context.Context) {
 // EditApplicationPost response for editing oauth2 application
 func EditApplicationPost(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("settings.applications")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminApplications"] = true
 
        oa := newOAuth2CommonHandlers()
@@ -76,7 +72,6 @@ func EditApplicationPost(ctx *context.Context) {
 // ApplicationsRegenerateSecret handles the post request for regenerating the secret
 func ApplicationsRegenerateSecret(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("settings")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminApplications"] = true
 
        oa := newOAuth2CommonHandlers()
index 6ebd23b7bbd59c05a8ce6d9465d1c846851db800..b6ea3ff40300a4e6ca95edc3b8eaef990bacab98 100644 (file)
@@ -45,7 +45,6 @@ var (
 // Authentications show authentication config page
 func Authentications(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.authentication")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminAuthentications"] = true
 
        var err error
@@ -89,7 +88,6 @@ var (
 // NewAuthSource render adding a new auth source page
 func NewAuthSource(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.auths.new")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminAuthentications"] = true
 
        ctx.Data["type"] = auth.LDAP.Int()
@@ -237,7 +235,6 @@ func parseSSPIConfig(ctx *context.Context, form forms.AuthenticationForm) (*sspi
 func NewAuthSourcePost(ctx *context.Context) {
        form := *web.GetForm(ctx).(*forms.AuthenticationForm)
        ctx.Data["Title"] = ctx.Tr("admin.auths.new")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminAuthentications"] = true
 
        ctx.Data["CurrentTypeName"] = auth.Type(form.Type).String()
@@ -333,7 +330,6 @@ func NewAuthSourcePost(ctx *context.Context) {
 // EditAuthSource render editing auth source page
 func EditAuthSource(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.auths.edit")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminAuthentications"] = true
 
        ctx.Data["SecurityProtocols"] = securityProtocols
@@ -369,7 +365,6 @@ func EditAuthSource(ctx *context.Context) {
 func EditAuthSourcePost(ctx *context.Context) {
        form := *web.GetForm(ctx).(*forms.AuthenticationForm)
        ctx.Data["Title"] = ctx.Tr("admin.auths.edit")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminAuthentications"] = true
 
        ctx.Data["SMTPAuths"] = smtp.Authenticators
index 48815dcff8ed5d490d056cb0516a35dfdaf2d6cb..7460ea24a74560f403cd7702d69be809ee527f6c 100644 (file)
@@ -100,7 +100,6 @@ func shadowPassword(provider, cfgItem string) string {
 // Config show admin config page
 func Config(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.config")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminConfig"] = true
 
        systemSettings, err := system_model.GetAllSettings(ctx)
index c16158c6ae47fd953ecb045658f9c078ebb1a2b3..4618a78c3a7c8f8f95e1360503ddbf61777db709 100644 (file)
@@ -24,7 +24,6 @@ const (
 // Emails show all emails
 func Emails(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.emails")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminEmails"] = true
 
        opts := &user_model.SearchEmailOptions{
index f60cf90b3c74aecfb26b50784b5a03494360c8d5..9e4588dd7579c3abc55815cc4a2c3da150062ba5 100644 (file)
@@ -22,7 +22,6 @@ const (
 // Notices show notices for admin
 func Notices(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.notices")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminNotices"] = true
 
        total := system_model.CountNotices()
index a4eb0af58d0c8415f3fca10c7d5ede35ede99100..6a3617d67f9bcbb88e0f14db8b8a8339efbb2753 100644 (file)
@@ -21,7 +21,6 @@ const (
 // Organizations show all the organizations
 func Organizations(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.organizations")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminOrganizations"] = true
 
        explore.RenderUserSearch(ctx, &user_model.SearchUserOptions{
index 88fb47ca017916f7592a0b867f83ba231c6f5938..4d5987e780b6f272ec1fd273843dae4ed7c80ad0 100644 (file)
@@ -64,7 +64,6 @@ func Packages(ctx *context.Context) {
        }
 
        ctx.Data["Title"] = ctx.Tr("packages.title")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminPackages"] = true
        ctx.Data["Query"] = query
        ctx.Data["PackageType"] = packageType
index 53b609af966ba6c026e96eb9a01328d2bb0c013f..b22546f74994aeeaa4f2438450e39441303dc7f1 100644 (file)
@@ -29,7 +29,6 @@ const (
 // Repos show all the repositories
 func Repos(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.repositories")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminRepositories"] = true
 
        explore.RenderRepoSearch(ctx, &explore.RepoSearchOptions{
@@ -67,7 +66,6 @@ func DeleteRepo(ctx *context.Context) {
 // UnadoptedRepos lists the unadopted repositories
 func UnadoptedRepos(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.repositories")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminRepositories"] = true
 
        opts := db.ListOptions{
index a70b53fdcb1cb3bdb8a06b81d3710a3af09980a6..eaa268b4f142a45b6ec910d05aa2a1a4b28ce290 100644 (file)
@@ -4,75 +4,10 @@
 package admin
 
 import (
-       "net/url"
-
-       actions_model "code.gitea.io/gitea/models/actions"
-       "code.gitea.io/gitea/models/db"
-       "code.gitea.io/gitea/modules/base"
        "code.gitea.io/gitea/modules/context"
        "code.gitea.io/gitea/modules/setting"
-       actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
-)
-
-const (
-       tplRunners    base.TplName = "admin/runners/base"
-       tplRunnerEdit base.TplName = "admin/runners/edit"
 )
 
-// Runners show all the runners
-func Runners(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("actions.runners")
-       ctx.Data["PageIsAdmin"] = true
-       ctx.Data["PageIsAdminRunners"] = true
-
-       page := ctx.FormInt("page")
-       if page <= 1 {
-               page = 1
-       }
-
-       opts := actions_model.FindRunnerOptions{
-               ListOptions: db.ListOptions{
-                       Page:     page,
-                       PageSize: 100,
-               },
-               Sort:   ctx.Req.URL.Query().Get("sort"),
-               Filter: ctx.Req.URL.Query().Get("q"),
-       }
-
-       actions_shared.RunnersList(ctx, tplRunners, opts)
-}
-
-// EditRunner show editing runner page
-func EditRunner(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("actions.runners.edit_runner")
-       ctx.Data["PageIsAdmin"] = true
-       ctx.Data["PageIsAdminRunners"] = true
-
-       page := ctx.FormInt("page")
-       if page <= 1 {
-               page = 1
-       }
-
-       actions_shared.RunnerDetails(ctx, tplRunnerEdit, page, ctx.ParamsInt64(":runnerid"), 0, 0)
-}
-
-// EditRunnerPost response for editing runner
-func EditRunnerPost(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("actions.runners.edit")
-       ctx.Data["PageIsAdmin"] = true
-       ctx.Data["PageIsAdminRunners"] = true
-       actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"), 0, 0,
-               setting.AppSubURL+"/admin/runners/"+url.PathEscape(ctx.Params(":runnerid")))
-}
-
-// DeleteRunnerPost response for deleting a runner
-func DeleteRunnerPost(ctx *context.Context) {
-       actions_shared.RunnerDeletePost(ctx, ctx.ParamsInt64(":runnerid"),
-               setting.AppSubURL+"/admin/runners/",
-               setting.AppSubURL+"/admin/runners/"+url.PathEscape(ctx.Params(":runnerid")),
-       )
-}
-
-func ResetRunnerRegistrationToken(ctx *context.Context) {
-       actions_shared.RunnerResetRegistrationToken(ctx, 0, 0, setting.AppSubURL+"/admin/runners/")
+func RedirectToDefaultSetting(ctx *context.Context) {
+       ctx.Redirect(setting.AppSubURL + "/admin/actions/runners")
 }
index 531f14d08627ea5b88816a2c3423546b7d4ba9fa..2150bc42f7baf3dc444de019136a504353403521 100644 (file)
@@ -37,7 +37,6 @@ const (
 // Users show all the users
 func Users(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.users")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminUsers"] = true
 
        extraParamStrings := map[string]string{}
@@ -80,7 +79,6 @@ func Users(ctx *context.Context) {
 // NewUser render adding a new user page
 func NewUser(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.users.new_account")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminUsers"] = true
        ctx.Data["DefaultUserVisibilityMode"] = setting.Service.DefaultUserVisibilityMode
        ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()
@@ -102,7 +100,6 @@ func NewUser(ctx *context.Context) {
 func NewUserPost(ctx *context.Context) {
        form := web.GetForm(ctx).(*forms.AdminCreateUserForm)
        ctx.Data["Title"] = ctx.Tr("admin.users.new_account")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminUsers"] = true
        ctx.Data["DefaultUserVisibilityMode"] = setting.Service.DefaultUserVisibilityMode
        ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()
@@ -253,7 +250,6 @@ func prepareUserInfo(ctx *context.Context) *user_model.User {
 // EditUser show editing user page
 func EditUser(ctx *context.Context) {
        ctx.Data["Title"] = ctx.Tr("admin.users.edit_account")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminUsers"] = true
        ctx.Data["DisableRegularOrgCreation"] = setting.Admin.DisableRegularOrgCreation
        ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations
@@ -271,7 +267,6 @@ func EditUser(ctx *context.Context) {
 func EditUserPost(ctx *context.Context) {
        form := web.GetForm(ctx).(*forms.AdminEditUserForm)
        ctx.Data["Title"] = ctx.Tr("admin.users.edit_account")
-       ctx.Data["PageIsAdmin"] = true
        ctx.Data["PageIsAdminUsers"] = true
        ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations
        ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()
diff --git a/routers/web/org/org_runners.go b/routers/web/org/org_runners.go
deleted file mode 100644 (file)
index f87a506..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2022 The Gitea Authors. All rights reserved.
-// SPDX-License-Identifier: MIT
-
-package org
-
-import (
-       "net/url"
-
-       actions_model "code.gitea.io/gitea/models/actions"
-       "code.gitea.io/gitea/models/db"
-       "code.gitea.io/gitea/modules/context"
-       actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
-)
-
-// Runners render runners page
-func Runners(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("org.runners")
-       ctx.Data["PageIsOrgSettings"] = true
-       ctx.Data["PageIsOrgSettingsRunners"] = true
-
-       page := ctx.FormInt("page")
-       if page <= 1 {
-               page = 1
-       }
-
-       opts := actions_model.FindRunnerOptions{
-               ListOptions: db.ListOptions{
-                       Page:     page,
-                       PageSize: 100,
-               },
-               Sort:          ctx.Req.URL.Query().Get("sort"),
-               Filter:        ctx.Req.URL.Query().Get("q"),
-               OwnerID:       ctx.Org.Organization.ID,
-               WithAvailable: true,
-       }
-
-       actions_shared.RunnersList(ctx, tplSettingsRunners, opts)
-}
-
-// ResetRunnerRegistrationToken reset runner registration token
-func ResetRunnerRegistrationToken(ctx *context.Context) {
-       actions_shared.RunnerResetRegistrationToken(ctx,
-               ctx.Org.Organization.ID, 0,
-               ctx.Org.OrgLink+"/settings/runners")
-}
-
-// RunnersEdit render runner edit page
-func RunnersEdit(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("org.runners.edit")
-       ctx.Data["PageIsOrgSettings"] = true
-       ctx.Data["PageIsOrgSettingsRunners"] = true
-       page := ctx.FormInt("page")
-       if page <= 1 {
-               page = 1
-       }
-
-       actions_shared.RunnerDetails(ctx, tplSettingsRunnersEdit, page,
-               ctx.ParamsInt64(":runnerid"), ctx.Org.Organization.ID, 0,
-       )
-}
-
-// RunnersEditPost response for editing runner
-func RunnersEditPost(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("org.runners.edit")
-       ctx.Data["PageIsOrgSettings"] = true
-       ctx.Data["PageIsOrgSettingsRunners"] = true
-       actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"),
-               ctx.Org.Organization.ID, 0,
-               ctx.Org.OrgLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
-}
-
-// RunnerDeletePost response for deleting runner
-func RunnerDeletePost(ctx *context.Context) {
-       actions_shared.RunnerDeletePost(ctx,
-               ctx.ParamsInt64(":runnerid"),
-               ctx.Org.OrgLink+"/settings/runners",
-               ctx.Org.OrgLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
-}
index db8fc728dffc7a8c38400bb76841e129d575670f..4111b135315100c395a85e2320c7ab08eab831b0 100644 (file)
@@ -37,10 +37,6 @@ const (
        tplSettingsHooks base.TplName = "org/settings/hooks"
        // tplSettingsLabels template path for render labels settings
        tplSettingsLabels base.TplName = "org/settings/labels"
-       // tplSettingsRunners template path for render runners settings
-       tplSettingsRunners base.TplName = "org/settings/runners"
-       // tplSettingsRunnersEdit template path for render runners edit settings
-       tplSettingsRunnersEdit base.TplName = "org/settings/runners_edit"
 )
 
 // Settings render the main settings page
diff --git a/routers/web/org/setting/runners.go b/routers/web/org/setting/runners.go
new file mode 100644 (file)
index 0000000..c3c7710
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2022 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package setting
+
+import (
+       "code.gitea.io/gitea/modules/context"
+)
+
+func RedirectToDefaultSetting(ctx *context.Context) {
+       ctx.Redirect(ctx.Org.OrgLink + "/settings/actions/runners")
+}
diff --git a/routers/web/org/setting_secrets.go b/routers/web/org/setting_secrets.go
deleted file mode 100644 (file)
index 580a140..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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.ContextUser.ID,
-               0,
-               ctx.Org.OrgLink+"/settings/secrets",
-       )
-}
diff --git a/routers/web/repo/runners.go b/routers/web/repo/runners.go
deleted file mode 100644 (file)
index d3dbff1..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2022 The Gitea Authors. All rights reserved.
-// SPDX-License-Identifier: MIT
-
-package repo
-
-import (
-       "net/url"
-
-       actions_model "code.gitea.io/gitea/models/actions"
-       "code.gitea.io/gitea/models/db"
-       "code.gitea.io/gitea/modules/context"
-       actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
-)
-
-const (
-       tplRunners    = "repo/settings/runners"
-       tplRunnerEdit = "repo/settings/runner_edit"
-)
-
-// Runners render runners page
-func Runners(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("actions.runners")
-       ctx.Data["PageIsSettingsRunners"] = true
-
-       page := ctx.FormInt("page")
-       if page <= 1 {
-               page = 1
-       }
-
-       opts := actions_model.FindRunnerOptions{
-               ListOptions: db.ListOptions{
-                       Page:     page,
-                       PageSize: 100,
-               },
-               Sort:          ctx.Req.URL.Query().Get("sort"),
-               Filter:        ctx.Req.URL.Query().Get("q"),
-               RepoID:        ctx.Repo.Repository.ID,
-               WithAvailable: true,
-       }
-
-       actions_shared.RunnersList(ctx, tplRunners, opts)
-}
-
-func RunnersEdit(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("actions.runners")
-       ctx.Data["PageIsSettingsRunners"] = true
-       page := ctx.FormInt("page")
-       if page <= 1 {
-               page = 1
-       }
-
-       actions_shared.RunnerDetails(ctx, tplRunnerEdit, page,
-               ctx.ParamsInt64(":runnerid"), 0, ctx.Repo.Repository.ID,
-       )
-}
-
-func RunnersEditPost(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("actions.runners")
-       ctx.Data["PageIsSettingsRunners"] = true
-       actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"),
-               0, ctx.Repo.Repository.ID,
-               ctx.Repo.RepoLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
-}
-
-func ResetRunnerRegistrationToken(ctx *context.Context) {
-       actions_shared.RunnerResetRegistrationToken(ctx,
-               0, ctx.Repo.Repository.ID,
-               ctx.Repo.RepoLink+"/settings/runners")
-}
-
-// RunnerDeletePost response for deleting runner
-func RunnerDeletePost(ctx *context.Context) {
-       actions_shared.RunnerDeletePost(ctx, ctx.ParamsInt64(":runnerid"),
-               ctx.Repo.RepoLink+"/settings/runners",
-               ctx.Repo.RepoLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
-}
diff --git a/routers/web/repo/setting/runners.go b/routers/web/repo/setting/runners.go
new file mode 100644 (file)
index 0000000..e8ad635
--- /dev/null
@@ -0,0 +1,167 @@
+// Copyright 2022 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package setting
+
+import (
+       "errors"
+       "net/http"
+       "net/url"
+
+       actions_model "code.gitea.io/gitea/models/actions"
+       "code.gitea.io/gitea/models/db"
+       "code.gitea.io/gitea/modules/base"
+       "code.gitea.io/gitea/modules/context"
+       "code.gitea.io/gitea/modules/setting"
+       actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
+)
+
+const (
+       // TODO: Separate secrets from runners when layout is ready
+       tplRepoRunners     base.TplName = "repo/settings/actions"
+       tplOrgRunners      base.TplName = "org/settings/actions"
+       tplAdminRunners    base.TplName = "admin/actions"
+       tplRepoRunnerEdit  base.TplName = "repo/settings/runner_edit"
+       tplOrgRunnerEdit   base.TplName = "org/settings/runners_edit"
+       tplAdminRunnerEdit base.TplName = "admin/runners/edit"
+)
+
+type runnersCtx struct {
+       OwnerID            int64
+       RepoID             int64
+       IsRepo             bool
+       IsOrg              bool
+       IsAdmin            bool
+       RunnersTemplate    base.TplName
+       RunnerEditTemplate base.TplName
+       RedirectLink       string
+}
+
+func getRunnersCtx(ctx *context.Context) (*runnersCtx, error) {
+       if ctx.Data["PageIsRepoSettings"] == true {
+               return &runnersCtx{
+                       RepoID:             ctx.Repo.Repository.ID,
+                       OwnerID:            0,
+                       IsRepo:             true,
+                       RunnersTemplate:    tplRepoRunners,
+                       RunnerEditTemplate: tplRepoRunnerEdit,
+                       RedirectLink:       ctx.Repo.RepoLink + "/settings/actions/runners/",
+               }, nil
+       }
+
+       if ctx.Data["PageIsOrgSettings"] == true {
+               return &runnersCtx{
+                       RepoID:             0,
+                       OwnerID:            ctx.Org.Organization.ID,
+                       IsOrg:              true,
+                       RunnersTemplate:    tplOrgRunners,
+                       RunnerEditTemplate: tplOrgRunnerEdit,
+                       RedirectLink:       ctx.Org.OrgLink + "/settings/actions/runners/",
+               }, nil
+       }
+
+       if ctx.Data["PageIsAdmin"] == true {
+               return &runnersCtx{
+                       RepoID:             0,
+                       OwnerID:            0,
+                       IsAdmin:            true,
+                       RunnersTemplate:    tplAdminRunners,
+                       RunnerEditTemplate: tplAdminRunnerEdit,
+                       RedirectLink:       setting.AppSubURL + "/admin/actions/runners/",
+               }, nil
+       }
+
+       return nil, errors.New("unable to set Runners context")
+}
+
+// Runners render settings/actions/runners page for repo level
+func Runners(ctx *context.Context) {
+       ctx.Data["PageIsSharedSettingsRunners"] = true
+       ctx.Data["Title"] = ctx.Tr("actions.actions")
+       ctx.Data["PageType"] = "runners"
+
+       rCtx, err := getRunnersCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getRunnersCtx", err)
+               return
+       }
+
+       page := ctx.FormInt("page")
+       if page <= 1 {
+               page = 1
+       }
+
+       opts := actions_model.FindRunnerOptions{
+               ListOptions: db.ListOptions{
+                       Page:     page,
+                       PageSize: 100,
+               },
+               Sort:   ctx.Req.URL.Query().Get("sort"),
+               Filter: ctx.Req.URL.Query().Get("q"),
+       }
+       if rCtx.IsRepo {
+               opts.RepoID = rCtx.RepoID
+               opts.WithAvailable = true
+       } else if rCtx.IsOrg {
+               opts.OwnerID = rCtx.OwnerID
+               opts.WithAvailable = true
+       }
+       actions_shared.RunnersList(ctx, opts)
+
+       ctx.HTML(http.StatusOK, rCtx.RunnersTemplate)
+}
+
+// RunnersEdit renders runner edit page for repository level
+func RunnersEdit(ctx *context.Context) {
+       ctx.Data["PageIsSharedSettingsRunners"] = true
+       ctx.Data["Title"] = ctx.Tr("actions.runners.edit_runner")
+       rCtx, err := getRunnersCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getRunnersCtx", err)
+               return
+       }
+
+       page := ctx.FormInt("page")
+       if page <= 1 {
+               page = 1
+       }
+
+       actions_shared.RunnerDetails(ctx, page,
+               ctx.ParamsInt64(":runnerid"), rCtx.OwnerID, rCtx.RepoID,
+       )
+       ctx.HTML(http.StatusOK, rCtx.RunnerEditTemplate)
+}
+
+func RunnersEditPost(ctx *context.Context) {
+       rCtx, err := getRunnersCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getRunnersCtx", err)
+               return
+       }
+       actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"),
+               rCtx.OwnerID, rCtx.RepoID,
+               rCtx.RedirectLink+url.PathEscape(ctx.Params(":runnerid")))
+}
+
+func ResetRunnerRegistrationToken(ctx *context.Context) {
+       rCtx, err := getRunnersCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getRunnersCtx", err)
+               return
+       }
+       actions_shared.RunnerResetRegistrationToken(ctx, rCtx.OwnerID, rCtx.RepoID, rCtx.RedirectLink)
+}
+
+// RunnerDeletePost response for deleting runner
+func RunnerDeletePost(ctx *context.Context) {
+       rCtx, err := getRunnersCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getRunnersCtx", err)
+               return
+       }
+       actions_shared.RunnerDeletePost(ctx, ctx.ParamsInt64(":runnerid"), rCtx.RedirectLink, rCtx.RedirectLink+url.PathEscape(ctx.Params(":runnerid")))
+}
+
+func RedirectToDefaultSetting(ctx *context.Context) {
+       ctx.Redirect(ctx.Repo.RepoLink + "/settings/actions/runners")
+}
diff --git a/routers/web/repo/setting/secrets.go b/routers/web/repo/setting/secrets.go
new file mode 100644 (file)
index 0000000..444f16f
--- /dev/null
@@ -0,0 +1,115 @@
+// Copyright 2022 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package setting
+
+import (
+       "errors"
+       "net/http"
+
+       "code.gitea.io/gitea/modules/base"
+       "code.gitea.io/gitea/modules/context"
+       "code.gitea.io/gitea/modules/setting"
+       shared "code.gitea.io/gitea/routers/web/shared/secrets"
+)
+
+const (
+       // TODO: Separate secrets from runners when layout is ready
+       tplRepoSecrets base.TplName = "repo/settings/actions"
+       tplOrgSecrets  base.TplName = "org/settings/actions"
+       tplUserSecrets base.TplName = "user/settings/actions"
+)
+
+type secretsCtx struct {
+       OwnerID         int64
+       RepoID          int64
+       IsRepo          bool
+       IsOrg           bool
+       IsUser          bool
+       SecretsTemplate base.TplName
+       RedirectLink    string
+}
+
+func getSecretsCtx(ctx *context.Context) (*secretsCtx, error) {
+       if ctx.Data["PageIsRepoSettings"] == true {
+               return &secretsCtx{
+                       OwnerID:         0,
+                       RepoID:          ctx.Repo.Repository.ID,
+                       IsRepo:          true,
+                       SecretsTemplate: tplRepoSecrets,
+                       RedirectLink:    ctx.Repo.RepoLink + "/settings/actions/secrets",
+               }, nil
+       }
+
+       if ctx.Data["PageIsOrgSettings"] == true {
+               return &secretsCtx{
+                       OwnerID:         ctx.ContextUser.ID,
+                       RepoID:          0,
+                       IsOrg:           true,
+                       SecretsTemplate: tplOrgSecrets,
+                       RedirectLink:    ctx.Org.OrgLink + "/settings/actions/secrets",
+               }, nil
+       }
+
+       if ctx.Data["PageIsUserSettings"] == true {
+               return &secretsCtx{
+                       OwnerID:         ctx.Doer.ID,
+                       RepoID:          0,
+                       IsUser:          true,
+                       SecretsTemplate: tplUserSecrets,
+                       RedirectLink:    setting.AppSubURL + "/user/settings/actions/secrets",
+               }, nil
+       }
+
+       return nil, errors.New("unable to set Secrets context")
+}
+
+func Secrets(ctx *context.Context) {
+       ctx.Data["Title"] = ctx.Tr("actions.actions")
+       ctx.Data["PageType"] = "secrets"
+       ctx.Data["PageIsSharedSettingsSecrets"] = true
+
+       sCtx, err := getSecretsCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getSecretsCtx", err)
+               return
+       }
+
+       if sCtx.IsRepo {
+               ctx.Data["DisableSSH"] = setting.SSH.Disabled
+       }
+
+       shared.SetSecretsContext(ctx, sCtx.OwnerID, sCtx.RepoID)
+       if ctx.Written() {
+               return
+       }
+       ctx.HTML(http.StatusOK, sCtx.SecretsTemplate)
+}
+
+func SecretsPost(ctx *context.Context) {
+       sCtx, err := getSecretsCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getSecretsCtx", err)
+               return
+       }
+       shared.PerformSecretsPost(
+               ctx,
+               sCtx.OwnerID,
+               sCtx.RepoID,
+               sCtx.RedirectLink,
+       )
+}
+
+func SecretsDelete(ctx *context.Context) {
+       sCtx, err := getSecretsCtx(ctx)
+       if err != nil {
+               ctx.ServerError("getSecretsCtx", err)
+               return
+       }
+       shared.PerformSecretsDelete(
+               ctx,
+               sCtx.OwnerID,
+               sCtx.RepoID,
+               sCtx.RedirectLink,
+       )
+}
diff --git a/routers/web/repo/setting_secrets.go b/routers/web/repo/setting_secrets.go
deleted file mode 100644 (file)
index 57a4c47..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2022 The Gitea Authors. All rights reserved.
-// SPDX-License-Identifier: MIT
-
-package repo
-
-import (
-       "net/http"
-
-       "code.gitea.io/gitea/modules/base"
-       "code.gitea.io/gitea/modules/context"
-       "code.gitea.io/gitea/modules/setting"
-       shared "code.gitea.io/gitea/routers/web/shared/secrets"
-)
-
-const (
-       tplSecrets base.TplName = "repo/settings/secrets"
-)
-
-func Secrets(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("secrets.secrets")
-       ctx.Data["PageIsSettingsSecrets"] = true
-       ctx.Data["DisableSSH"] = setting.SSH.Disabled
-
-       shared.SetSecretsContext(ctx, 0, ctx.Repo.Repository.ID)
-       if ctx.Written() {
-               return
-       }
-
-       ctx.HTML(http.StatusOK, tplSecrets)
-}
-
-func SecretsPost(ctx *context.Context) {
-       shared.PerformSecretsPost(
-               ctx,
-               0,
-               ctx.Repo.Repository.ID,
-               ctx.Repo.RepoLink+"/settings/secrets",
-       )
-}
-
-func DeleteSecret(ctx *context.Context) {
-       shared.PerformSecretsDelete(
-               ctx,
-               0,
-               ctx.Repo.Repository.ID,
-               ctx.Repo.RepoLink+"/settings/secrets",
-       )
-}
index f30588967e83680b9471992be29633a00be1260b..a21b405c9676e10c421cee5d09f6488ddf02eb01 100644 (file)
@@ -67,7 +67,7 @@ type ownerRepoCtx struct {
 
 // getOwnerRepoCtx determines whether this is a repo, owner, or admin (both default and system) context.
 func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
-       if is, ok := ctx.Data["IsRepositoryWebhook"]; ok && is.(bool) {
+       if ctx.Data["PageIsRepoSettings"] == true {
                return &ownerRepoCtx{
                        RepoID:      ctx.Repo.Repository.ID,
                        Link:        path.Join(ctx.Repo.RepoLink, "settings/hooks"),
@@ -76,7 +76,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
                }, nil
        }
 
-       if is, ok := ctx.Data["IsOrganizationWebhook"]; ok && is.(bool) {
+       if ctx.Data["PageIsOrgSettings"] == true {
                return &ownerRepoCtx{
                        OwnerID:     ctx.ContextUser.ID,
                        Link:        path.Join(ctx.Org.OrgLink, "settings/hooks"),
@@ -85,7 +85,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
                }, nil
        }
 
-       if is, ok := ctx.Data["IsUserWebhook"]; ok && is.(bool) {
+       if ctx.Data["PageIsUserSettings"] == true {
                return &ownerRepoCtx{
                        OwnerID:     ctx.Doer.ID,
                        Link:        path.Join(setting.AppSubURL, "/user/settings/hooks"),
@@ -94,7 +94,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
                }, nil
        }
 
-       if ctx.Doer.IsAdmin {
+       if ctx.Data["PageIsAdmin"] == true {
                return &ownerRepoCtx{
                        IsAdmin:         true,
                        IsSystemWebhook: ctx.Params(":configType") == "system-hooks",
index 2c3614cbbcb2a8bfc2deee3c09c2c24557cff31a..9a50da2b492b485dbec839e24c61db4ddbd83cb5 100644 (file)
@@ -10,7 +10,6 @@ import (
 
        actions_model "code.gitea.io/gitea/models/actions"
        "code.gitea.io/gitea/models/db"
-       "code.gitea.io/gitea/modules/base"
        "code.gitea.io/gitea/modules/context"
        "code.gitea.io/gitea/modules/log"
        "code.gitea.io/gitea/modules/util"
@@ -18,8 +17,8 @@ import (
        "code.gitea.io/gitea/services/forms"
 )
 
-// RunnersList render common runners list page
-func RunnersList(ctx *context.Context, tplName base.TplName, opts actions_model.FindRunnerOptions) {
+// RunnersList prepares data for runners list
+func RunnersList(ctx *context.Context, opts actions_model.FindRunnerOptions) {
        count, err := actions_model.CountRunners(ctx, opts)
        if err != nil {
                ctx.ServerError("CountRunners", err)
@@ -58,13 +57,12 @@ func RunnersList(ctx *context.Context, tplName base.TplName, opts actions_model.
        ctx.Data["RunnerRepoID"] = opts.RepoID
 
        pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5)
-       ctx.Data["Page"] = pager
 
-       ctx.HTML(http.StatusOK, tplName)
+       ctx.Data["Page"] = pager
 }
 
-// RunnerDetails render runner details page
-func RunnerDetails(ctx *context.Context, tplName base.TplName, page int, runnerID, ownerID, repoID int64) {
+// RunnerDetails prepares data for runners edit page
+func RunnerDetails(ctx *context.Context, page int, runnerID, ownerID, repoID int64) {
        runner, err := actions_model.GetRunnerByID(ctx, runnerID)
        if err != nil {
                ctx.ServerError("GetRunnerByID", err)
@@ -111,8 +109,6 @@ func RunnerDetails(ctx *context.Context, tplName base.TplName, page int, runnerI
        ctx.Data["Tasks"] = tasks
        pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5)
        ctx.Data["Page"] = pager
-
-       ctx.HTML(http.StatusOK, tplName)
 }
 
 // RunnerDetailsEditPost response for edit runner details
index 2314f3694f77502a46c7755150b5b12f651b1fdc..eb09477bdb005f0326eb119c800365e7774c2926 100644 (file)
@@ -4,44 +4,10 @@
 package setting
 
 import (
-       "net/http"
-
-       "code.gitea.io/gitea/modules/base"
        "code.gitea.io/gitea/modules/context"
        "code.gitea.io/gitea/modules/setting"
-       shared "code.gitea.io/gitea/routers/web/shared/secrets"
-)
-
-const (
-       tplSettingsSecrets base.TplName = "user/settings/secrets"
 )
 
-func Secrets(ctx *context.Context) {
-       ctx.Data["Title"] = ctx.Tr("secrets.secrets")
-       ctx.Data["PageIsSettingsSecrets"] = true
-
-       shared.SetSecretsContext(ctx, ctx.Doer.ID, 0)
-       if ctx.Written() {
-               return
-       }
-
-       ctx.HTML(http.StatusOK, tplSettingsSecrets)
-}
-
-func SecretsPost(ctx *context.Context) {
-       shared.PerformSecretsPost(
-               ctx,
-               ctx.Doer.ID,
-               0,
-               setting.AppSubURL+"/user/settings/secrets",
-       )
-}
-
-func SecretsDelete(ctx *context.Context) {
-       shared.PerformSecretsDelete(
-               ctx,
-               ctx.Doer.ID,
-               0,
-               setting.AppSubURL+"/user/settings/secrets",
-       )
+func RedirectToDefaultSetting(ctx *context.Context) {
+       ctx.Redirect(setting.AppSubURL + "/user/settings/actions/secrets")
 }
index 746b098bda7ff4c2e73749237f3a94e5339062c7..a4ef96ecbe0f1d54eaa17eaf68be1eb170a39619 100644 (file)
@@ -30,8 +30,10 @@ import (
        "code.gitea.io/gitea/routers/web/healthcheck"
        "code.gitea.io/gitea/routers/web/misc"
        "code.gitea.io/gitea/routers/web/org"
+       org_setting "code.gitea.io/gitea/routers/web/org/setting"
        "code.gitea.io/gitea/routers/web/repo"
        "code.gitea.io/gitea/routers/web/repo/actions"
+       repo_setting "code.gitea.io/gitea/routers/web/repo/setting"
        "code.gitea.io/gitea/routers/web/user"
        user_setting "code.gitea.io/gitea/routers/web/user/setting"
        "code.gitea.io/gitea/routers/web/user/setting/security"
@@ -93,6 +95,14 @@ func buildAuthGroup() *auth_service.Group {
        return group
 }
 
+func ctxDataSet(args ...any) func(ctx *context.Context) {
+       return func(ctx *context.Context) {
+               for i := 0; i < len(args); i += 2 {
+                       ctx.Data[args[i].(string)] = args[i+1]
+               }
+       }
+}
+
 // Routes returns all web routes
 func Routes(ctx gocontext.Context) *web.Route {
        routes := web.NewRoute()
@@ -282,6 +292,24 @@ func registerRoutes(m *web.Route) {
                m.Post("/packagist/{id}", web.Bind(forms.NewPackagistHookForm{}), repo.PackagistHooksEditPost)
        }
 
+       addSettingsSecretsRoutes := func() {
+               m.Group("/secrets", func() {
+                       m.Get("", repo_setting.Secrets)
+                       m.Post("", web.Bind(forms.AddSecretForm{}), repo_setting.SecretsPost)
+                       m.Post("/delete", repo_setting.SecretsDelete)
+               })
+       }
+
+       addSettingsRunnersRoutes := func() {
+               m.Group("/runners", func() {
+                       m.Get("", repo_setting.Runners)
+                       m.Combo("/{runnerid}").Get(repo_setting.RunnersEdit).
+                               Post(web.Bind(forms.EditRunnerForm{}), repo_setting.RunnersEditPost)
+                       m.Post("/{runnerid}/delete", repo_setting.RunnerDeletePost)
+                       m.Get("/reset_registration_token", repo_setting.ResetRunnerRegistrationToken)
+               })
+       }
+
        // FIXME: not all routes need go through same middleware.
        // Especially some AJAX requests, we can reduce middleware number to improve performance.
        // Routers.
@@ -441,11 +469,12 @@ func registerRoutes(m *web.Route) {
                        })
                        m.Post("/chef/regenerate_keypair", user_setting.RegenerateChefKeyPair)
                }, packagesEnabled)
-               m.Group("/secrets", func() {
-                       m.Get("", user_setting.Secrets)
-                       m.Post("", web.Bind(forms.AddSecretForm{}), user_setting.SecretsPost)
-                       m.Post("/delete", user_setting.SecretsDelete)
-               })
+
+               m.Group("/actions", func() {
+                       m.Get("", user_setting.RedirectToDefaultSetting)
+                       addSettingsSecretsRoutes()
+               }, actions.MustEnableActions)
+
                m.Get("/organization", user_setting.Organization)
                m.Get("/repos", user_setting.Repos)
                m.Post("/repos/unadopted", user_setting.AdoptOrDeleteRepository)
@@ -459,14 +488,8 @@ func registerRoutes(m *web.Route) {
                                m.Post("/replay/{uuid}", repo.ReplayWebhook)
                        })
                        addWebhookEditRoutes()
-               }, webhooksEnabled, func(ctx *context.Context) {
-                       ctx.Data["IsUserWebhook"] = true
-               })
-       }, reqSignIn, func(ctx *context.Context) {
-               ctx.Data["PageIsUserSettings"] = true
-               ctx.Data["AllThemes"] = setting.UI.Themes
-               ctx.Data["EnablePackages"] = setting.Packages.Enabled
-       })
+               }, webhooksEnabled)
+       }, reqSignIn, ctxDataSet("PageIsUserSettings", true, "AllThemes", setting.UI.Themes, "EnablePackages", setting.Packages.Enabled))
 
        m.Group("/user", func() {
                // r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
@@ -591,16 +614,11 @@ func registerRoutes(m *web.Route) {
                        }
                })
 
-               m.Group("/runners", func() {
-                       m.Get("", admin.Runners)
-                       m.Get("/reset_registration_token", admin.ResetRunnerRegistrationToken)
-                       m.Combo("/{runnerid}").Get(admin.EditRunner).Post(web.Bind(forms.EditRunnerForm{}), admin.EditRunnerPost)
-                       m.Post("/{runnerid}/delete", admin.DeleteRunnerPost)
-               }, actions.MustEnableActions)
-       }, func(ctx *context.Context) {
-               ctx.Data["EnableOAuth2"] = setting.OAuth2.Enable
-               ctx.Data["EnablePackages"] = setting.Packages.Enabled
-       }, adminReq)
+               m.Group("/actions", func() {
+                       m.Get("", admin.RedirectToDefaultSetting)
+                       addSettingsRunnersRoutes()
+               })
+       }, adminReq, ctxDataSet("EnableOAuth2", setting.OAuth2.Enable, "EnablePackages", setting.Packages.Enabled))
        // ***** END: Admin *****
 
        m.Group("", func() {
@@ -724,9 +742,7 @@ func registerRoutes(m *web.Route) {
                                                m.Post("/replay/{uuid}", repo.ReplayWebhook)
                                        })
                                        addWebhookEditRoutes()
-                               }, webhooksEnabled, func(ctx *context.Context) {
-                                       ctx.Data["IsOrganizationWebhook"] = true
-                               })
+                               }, webhooksEnabled)
 
                                m.Group("/labels", func() {
                                        m.Get("", org.RetrieveLabels, org.Labels)
@@ -736,20 +752,12 @@ func registerRoutes(m *web.Route) {
                                        m.Post("/initialize", web.Bind(forms.InitializeLabelsForm{}), org.InitializeLabels)
                                })
 
-                               m.Group("/runners", func() {
-                                       m.Get("", org.Runners)
-                                       m.Combo("/{runnerid}").Get(org.RunnersEdit).
-                                               Post(web.Bind(forms.EditRunnerForm{}), org.RunnersEditPost)
-                                       m.Post("/{runnerid}/delete", org.RunnerDeletePost)
-                                       m.Get("/reset_registration_token", org.ResetRunnerRegistrationToken)
+                               m.Group("/actions", func() {
+                                       m.Get("", org_setting.RedirectToDefaultSetting)
+                                       addSettingsRunnersRoutes()
+                                       addSettingsSecretsRoutes()
                                }, actions.MustEnableActions)
 
-                               m.Group("/secrets", func() {
-                                       m.Get("", org.Secrets)
-                                       m.Post("", web.Bind(forms.AddSecretForm{}), org.SecretsPost)
-                                       m.Post("/delete", org.SecretsDelete)
-                               })
-
                                m.RouteMethods("/delete", "GET,POST", org.SettingsDelete)
 
                                m.Group("/packages", func() {
@@ -770,10 +778,7 @@ func registerRoutes(m *web.Route) {
                                                m.Post("/rebuild", org.RebuildCargoIndex)
                                        })
                                }, packagesEnabled)
-                       }, func(ctx *context.Context) {
-                               ctx.Data["EnableOAuth2"] = setting.OAuth2.Enable
-                               ctx.Data["EnablePackages"] = setting.Packages.Enabled
-                       })
+                       }, ctxDataSet("EnableOAuth2", setting.OAuth2.Enable, "EnablePackages", setting.Packages.Enabled, "PageIsOrgSettings", true))
                }, context.OrgAssignment(true, true))
        }, reqSignIn)
        // ***** END: Organization *****
@@ -907,9 +912,7 @@ func registerRoutes(m *web.Route) {
                                        m.Post("/replay/{uuid}", repo.ReplayWebhook)
                                })
                                addWebhookEditRoutes()
-                       }, webhooksEnabled, func(ctx *context.Context) {
-                               ctx.Data["IsRepositoryWebhook"] = true
-                       })
+                       }, webhooksEnabled)
 
                        m.Group("/keys", func() {
                                m.Combo("").Get(repo.DeployKeys).
@@ -917,12 +920,6 @@ func registerRoutes(m *web.Route) {
                                m.Post("/delete", repo.DeleteDeployKey)
                        })
 
-                       m.Group("/secrets", func() {
-                               m.Get("", repo.Secrets)
-                               m.Post("", web.Bind(forms.AddSecretForm{}), repo.SecretsPost)
-                               m.Post("/delete", repo.DeleteSecret)
-                       })
-
                        m.Group("/lfs", func() {
                                m.Get("/", repo.LFSFiles)
                                m.Get("/show/{oid}", repo.LFSFileGet)
@@ -936,18 +933,12 @@ func registerRoutes(m *web.Route) {
                                        m.Post("/{lid}/unlock", repo.LFSUnlock)
                                })
                        })
-
-                       m.Group("/runners", func() {
-                               m.Get("", repo.Runners)
-                               m.Combo("/{runnerid}").Get(repo.RunnersEdit).
-                                       Post(web.Bind(forms.EditRunnerForm{}), repo.RunnersEditPost)
-                               m.Post("/{runnerid}/delete", repo.RunnerDeletePost)
-                               m.Get("/reset_registration_token", repo.ResetRunnerRegistrationToken)
+                       m.Group("/actions", func() {
+                               m.Get("", repo_setting.RedirectToDefaultSetting)
+                               addSettingsRunnersRoutes()
+                               addSettingsSecretsRoutes()
                        }, actions.MustEnableActions)
-               }, func(ctx *context.Context) {
-                       ctx.Data["PageIsSettings"] = true
-                       ctx.Data["LFSStartServer"] = setting.LFS.StartServer
-               })
+               }, ctxDataSet("PageIsRepoSettings", true, "LFSStartServer", setting.LFS.StartServer))
        }, reqSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoAdmin, context.RepoRef())
 
        m.Post("/{username}/{reponame}/action/{action}", reqSignIn, context.RepoAssignment, context.UnitTypes(), repo.Action)
@@ -1098,9 +1089,8 @@ func registerRoutes(m *web.Route) {
                        m.Get("", repo.TagsList)
                        m.Get(".rss", feedEnabled, repo.TagsListFeedRSS)
                        m.Get(".atom", feedEnabled, repo.TagsListFeedAtom)
-               }, func(ctx *context.Context) {
-                       ctx.Data["EnableFeed"] = setting.Other.EnableFeed
-               }, repo.MustBeNotEmpty, reqRepoCodeReader, context.RepoRefByType(context.RepoRefTag, true))
+               }, ctxDataSet("EnableFeed", setting.Other.EnableFeed),
+                       repo.MustBeNotEmpty, reqRepoCodeReader, context.RepoRefByType(context.RepoRefTag, true))
                m.Post("/tags/delete", repo.DeleteTag, reqSignIn,
                        repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoCodeWriter, context.RepoRef())
        }, reqSignIn, context.RepoAssignment, context.UnitTypes())
@@ -1113,9 +1103,8 @@ func registerRoutes(m *web.Route) {
                        m.Get("/latest", repo.LatestRelease)
                        m.Get(".rss", feedEnabled, repo.ReleasesFeedRSS)
                        m.Get(".atom", feedEnabled, repo.ReleasesFeedAtom)
-               }, func(ctx *context.Context) {
-                       ctx.Data["EnableFeed"] = setting.Other.EnableFeed
-               }, repo.MustBeNotEmpty, reqRepoReleaseReader, context.RepoRefByType(context.RepoRefTag, true))
+               }, ctxDataSet("EnableFeed", setting.Other.EnableFeed),
+                       repo.MustBeNotEmpty, reqRepoReleaseReader, context.RepoRefByType(context.RepoRefTag, true))
                m.Get("/releases/attachments/{uuid}", repo.GetAttachment, repo.MustBeNotEmpty, reqRepoReleaseReader)
                m.Group("/releases", func() {
                        m.Get("/new", repo.NewRelease)
index b96810f17f6d10034f9a8bb94e7cdd199b389e42..abeafed9cb46f5e103579edc5071718e9622d645 100644 (file)
@@ -236,7 +236,6 @@ func VerifyAuthWithOptionsAPI(options *VerifyOptions) func(ctx *context.APIConte
                                })
                                return
                        }
-                       ctx.Data["PageIsAdmin"] = true
                }
        }
 }
diff --git a/templates/admin/actions.tmpl b/templates/admin/actions.tmpl
new file mode 100644 (file)
index 0000000..9640e0f
--- /dev/null
@@ -0,0 +1,7 @@
+{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin actions")}}
+       <div class="admin-setting-content">
+       {{if eq .PageType "runners"}}
+               {{template "shared/actions/runner_list" .}}
+       {{end}}
+       </div>
+{{template "admin/layout_footer" .}}
index e8eb54e58da485c56085559f3bd320219928d88d..51a93bacd7b63f7ce3d607671e725c8e0ab0bc1f 100644 (file)
                        </a>
                {{end}}
                {{if .EnableActions}}
-               <a class="{{if .PageIsAdminRunners}}active {{end}}item" href="{{AppSubUrl}}/admin/runners">
-                       {{.locale.Tr "actions.runners"}}
-               </a>
+               <div class="item">
+                       {{.locale.Tr "actions.actions"}}
+                       <div class="menu">
+                               <a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/admin/actions/runners">
+                                       {{.locale.Tr "actions.runners"}}
+                               </a>
+                       </div>
+               </div>
                {{end}}
                <a class="{{if .PageIsAdminConfig}}active {{end}}item" href="{{AppSubUrl}}/admin/config">
                        {{.locale.Tr "admin.config"}}
diff --git a/templates/admin/runners/base.tmpl b/templates/admin/runners/base.tmpl
deleted file mode 100644 (file)
index 36495b6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin runners")}}
-       <div class="admin-setting-content">
-               {{template "shared/actions/runner_list" .}}
-       </div>
-{{template "admin/layout_footer" .}}
diff --git a/templates/org/settings/actions.tmpl b/templates/org/settings/actions.tmpl
new file mode 100644 (file)
index 0000000..b3b24e0
--- /dev/null
@@ -0,0 +1,9 @@
+{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings actions")}}
+       <div class="org-setting-content">
+       {{if eq .PageType "runners"}}
+               {{template "shared/actions/runner_list" .}}
+       {{else if eq .PageType "secrets"}}
+               {{template "shared/secrets/add_list" .}}
+       {{end}}
+       </div>
+{{template "org/settings/layout_footer" .}}
index 7380deff779be0b06b996a958cd599a17a15d889..fcce43f914a21468a0d9ba279bff4d202cf71a1f 100644 (file)
@@ -12,9 +12,6 @@
                <a class="{{if .PageIsOrgSettingsLabels}}active {{end}}item" href="{{.OrgLink}}/settings/labels">
                        {{.locale.Tr "repo.labels"}}
                </a>
-               <a class="{{if .PageIsOrgSettingsSecrets}}active {{end}}item" href="{{.OrgLink}}/settings/secrets">
-                       {{.locale.Tr "secrets.secrets"}}
-               </a>
                {{if .EnableOAuth2}}
                <a class="{{if .PageIsSettingsApplications}}active {{end}}item" href="{{.OrgLink}}/settings/applications">
                        {{.locale.Tr "settings.applications"}}
                </a>
                {{end}}
                {{if .EnableActions}}
-               <a class="{{if .PageIsOrgSettingsRunners}}active {{end}}item" href="{{.OrgLink}}/settings/runners">
-                       {{.locale.Tr "actions.runners"}}
-               </a>
+               <div class="item">
+                       {{.locale.Tr "actions.actions"}}
+                       <div class="menu">
+                               <a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.OrgLink}}/settings/actions/runners">
+                                       {{.locale.Tr "actions.runners"}}
+                               </a>
+                               <a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{.OrgLink}}/settings/actions/secrets">
+                                       {{.locale.Tr "secrets.secrets"}}
+                               </a>
+                       </div>
+               </div>
                {{end}}
                <a class="{{if .PageIsSettingsDelete}}active {{end}}item" href="{{.OrgLink}}/settings/delete">
                        {{.locale.Tr "org.settings.delete"}}
diff --git a/templates/org/settings/runners.tmpl b/templates/org/settings/runners.tmpl
deleted file mode 100644 (file)
index 86cb1bc..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings runners")}}
-       <div class="org-setting-content">
-               {{template "shared/actions/runner_list" .}}
-       </div>
-{{template "org/settings/layout_footer" .}}
diff --git a/templates/org/settings/secrets.tmpl b/templates/org/settings/secrets.tmpl
deleted file mode 100644 (file)
index 68ce415..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings secrets")}}
-                       <div class="org-setting-content">
-                               {{template "shared/secrets/add_list" .}}
-                       </div>
-{{template "org/settings/layout_footer" .}}
index 8a6833f499316b4630c33a48be44a290decd0492..9b3b2ce7948f90c6d5747beda910c01a469746e5 100644 (file)
 
                                {{if .Permission.IsAdmin}}
                                        <div class="right menu">
-                                               <a class="{{if .PageIsSettings}}active {{end}}item" href="{{.RepoLink}}/settings">
+                                               <a class="{{if .PageIsRepoSettings}}active {{end}}item" href="{{.RepoLink}}/settings">
                                                        {{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}}
                                                </a>
                                        </div>
                {{else if .Permission.IsAdmin}}
                        <div class="ui tabular stackable menu navbar">
                                <div class="right menu">
-                                       <a class="{{if .PageIsSettings}}active {{end}}item" href="{{.RepoLink}}/settings">
+                                       <a class="{{if .PageIsRepoSettings}}active {{end}}item" href="{{.RepoLink}}/settings">
                                                {{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}}
                                        </a>
                                </div>
diff --git a/templates/repo/settings/actions.tmpl b/templates/repo/settings/actions.tmpl
new file mode 100644 (file)
index 0000000..7294423
--- /dev/null
@@ -0,0 +1,9 @@
+{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings actions")}}
+       <div class="repo-setting-content">
+               {{if eq .PageType "runners"}}
+                       {{template "shared/actions/runner_list" .}}
+               {{else if eq .PageType "secrets"}}
+                       {{template "shared/secrets/add_list" .}}
+               {{end}}
+       </div>
+{{template "repo/settings/layout_footer" .}}
index 3156d9b159fc860f28708ec7c3119bf392d26a2b..4a88d69adf5d2f99578da74e4311d1c9ba3b3df2 100644 (file)
@@ -13,7 +13,7 @@
                                <li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.locale.Tr "repo.settings.githooks"}}</a></li>
                        {{end}}
                        <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.locale.Tr "repo.settings.deploy_keys"}}</a></li>
-                       <li {{if .PageIsSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{.locale.Tr "secrets.secrets"}}</a></li>
+                       <li {{if .PageIsSharedSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{.locale.Tr "secrets.secrets"}}</a></li>
                </ul>
        </div>
 </div>
index 081d0c474ec5b63188e1fc681436325ac3e2bd9d..b1beda7c944c17766f3e6910f7a8d384dd735ea5 100644 (file)
                <a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{.RepoLink}}/settings/keys">
                        {{.locale.Tr "repo.settings.deploy_keys"}}
                </a>
-               <a class="{{if .PageIsSettingsSecrets}}active {{end}}item" href="{{.RepoLink}}/settings/secrets">
-                       {{.locale.Tr "secrets.secrets"}}
-               </a>
                {{if .LFSStartServer}}
                        <a class="{{if .PageIsSettingsLFS}}active {{end}}item" href="{{.RepoLink}}/settings/lfs">
                                {{.locale.Tr "repo.settings.lfs"}}
                        </a>
                {{end}}
                {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
-                       <a class="{{if .PageIsSettingsRunners}}active {{end}}item" href="{{.RepoLink}}/settings/runners">
-                               {{.locale.Tr "actions.runners"}}
-                       </a>
+               <div class="item">
+                       {{.locale.Tr "actions.actions"}}
+                       <div class="menu">
+                               <a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.RepoLink}}/settings/actions/runners">
+                                       {{.locale.Tr "actions.runners"}}
+                               </a>
+                               <a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{.RepoLink}}/settings/actions/secrets">
+                                       {{.locale.Tr "secrets.secrets"}}
+                               </a>
+                       </div>
+               </div>
                {{end}}
        </div>
 </div>
diff --git a/templates/repo/settings/runners.tmpl b/templates/repo/settings/runners.tmpl
deleted file mode 100644 (file)
index ab3ad40..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings runners")}}
-       <div class="repo-setting-content">
-               {{template "shared/actions/runner_list" .}}
-       </div>
-{{template "repo/settings/layout_footer" .}}
index e56ace8fc6e10051a61c7bf4819bbd1fb4756685..e743c16f9586650aae1b636ea30cb51f4adf1dcb 100644 (file)
@@ -1,5 +1,5 @@
 <h4 class="ui top attached header">
-       {{.locale.Tr "secrets.secrets"}}
+       {{.locale.Tr "secrets.management"}}
        <div class="ui right">
                <button class="ui primary tiny show-panel button" data-panel="#add-secret-panel">{{.locale.Tr "secrets.creation"}}</button>
        </div>
diff --git a/templates/user/settings/actions.tmpl b/templates/user/settings/actions.tmpl
new file mode 100644 (file)
index 0000000..4d56523
--- /dev/null
@@ -0,0 +1,8 @@
+{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings actions")}}
+       <div class="user-setting-content">
+       {{if eq .PageType "secrets"}}
+               {{template "shared/secrets/add_list" .}}
+       {{end}}
+       </div>
+
+{{template "user/settings/layout_footer" .}}
index 27ec73c34fb261fda3a5006bea0edea244df5019..b79308419bfc6eac74b9ab0c3abe4b2b0487a68a 100644 (file)
                <a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{AppSubUrl}}/user/settings/keys">
                        {{.locale.Tr "settings.ssh_gpg_keys"}}
                </a>
-               <a class="{{if .PageIsSettingsSecrets}}active {{end}}item" href="{{AppSubUrl}}/user/settings/secrets">
-                       {{.locale.Tr "secrets.secrets"}}
-               </a>
+               {{if .EnableActions}}
+               <div class="item">
+                       {{.locale.Tr "actions.actions"}}
+                       <div class="menu">
+                               <a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/secrets">
+                                       {{.locale.Tr "secrets.secrets"}}
+                               </a>
+                       </div>
+               </div>
+               {{end}}
                {{if .EnablePackages}}
                <a class="{{if .PageIsSettingsPackages}}active {{end}}item" href="{{AppSubUrl}}/user/settings/packages">
                        {{.locale.Tr "packages.title"}}
diff --git a/templates/user/settings/secrets.tmpl b/templates/user/settings/secrets.tmpl
deleted file mode 100644 (file)
index a831453..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings secrets")}}
-       <div class="user-setting-content">
-               {{template "shared/secrets/add_list" .}}
-       </div>
-
-{{template "user/settings/layout_footer" .}}
index dc7942e8a2770edebbd829f69c80c39a6fa4ed0f..c7ea0e47c8f215a19ba2718fdcae09c4a2ede916 100644 (file)
@@ -830,6 +830,21 @@ a.label,
   color: var(--color-text-light-3);
 }
 
+/* sub menu of vertical menu */
+.ui.vertical.menu .item .menu .item {
+  color: var(--color-text-light-2);
+  text-indent: 16px;
+}
+
+.ui.vertical.menu .item .menu .item:hover,
+.ui.vertical.menu .item .menu a.item:hover {
+  color: var(--color-text-light-1);
+}
+
+.ui.vertical.menu .item .menu .active.item {
+  color: var(--color-text);
+}
+
 /* slightly more contrast for filters on issue list */
 .ui.ui.menu .dropdown.item.disabled {
   color: var(--color-text-light-2);
index 80e2e1cb8b405d5b3f4c0c2b24be587d05a858b5..8b25775bb4440e2b876854e246f0f98b6f98a3c3 100644 (file)
 
 .settings.webhooks .list > .item:not(:first-child),
 .settings.githooks .list > .item:not(:first-child),
-.settings.runners .list > .item:not(:first-child) {
+.settings.actions .list > .item:not(:first-child) {
   padding: 0.25rem 1rem;
   margin: 12px -1rem -1rem;
 }