Merge default and system webhooks under one menu (#14244)

This commit is contained in:
Lauris BH 2021-01-15 01:24:03 +02:00 committed by GitHub
parent 84b147c7f0
commit 6eee9f0f4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 148 additions and 141 deletions

View file

@ -4,10 +4,14 @@
<div class="ui container">
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{if .PageIsAdminHooksNew}}
{{.i18n.Tr "admin.hooks.add_webhook"}}
{{if .PageIsAdminDefaultHooksNew}}
{{.i18n.Tr "admin.defaulthooks.add_webhook"}}
{{else if .PageIsAdminSystemHooksNew}}
{{.i18n.Tr "admin.systemhooks.add_webhook"}}
{{else if .Webhook.IsSystemWebhook}}
{{.i18n.Tr "admin.systemhooks.update_webhook"}}
{{else}}
{{.i18n.Tr "admin.hooks.update_webhook"}}
{{.i18n.Tr "admin.defaulthooks.update_webhook"}}
{{end}}
<div class="ui right">
{{if eq .HookType "gitea"}}

View file

@ -2,7 +2,12 @@
<div class="page-content admin hooks">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "repo/settings/webhook/list" .}}
{{template "base/alert" .}}
{{template "repo/settings/webhook/base_list" .SystemWebhooks}}
{{template "repo/settings/webhook/base_list" .DefaultWebhooks}}
{{template "repo/settings/webhook/delete_modal" .}}
</div>
</div>
{{template "base/footer" .}}

View file

@ -12,12 +12,9 @@
<a class="{{if .PageIsAdminRepositories}}active{{end}} item" href="{{AppSubUrl}}/admin/repos">
{{.i18n.Tr "admin.repositories"}}
</a>
<a class="{{if .PageIsAdminHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
{{.i18n.Tr "admin.hooks"}}
</a>
<a class="{{if .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/system-hooks">
{{.i18n.Tr "admin.systemhooks"}}
</a>
<a class="{{if .PageIsAdminAuthentications}}active{{end}} item" href="{{AppSubUrl}}/admin/auths">
{{.i18n.Tr "admin.authentication"}}
</a>