diff --git a/models/webhook.go b/models/webhook.go index 47052cb39..c37a1a478 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -353,9 +353,10 @@ const ( ) var hookTaskTypes = map[string]HookTaskType{ - "gogs": GOGS, - "slack": SLACK, - "discord": DISCORD, + "gogs": GOGS, + "slack": SLACK, + "discord": DISCORD, + "dingtalk": DINGTALK, } // ToHookTaskType returns HookTaskType by given name. @@ -371,6 +372,8 @@ func (t HookTaskType) Name() string { return "slack" case DISCORD: return "discord" + case DINGTALK: + return "dingtalk" } return "" } diff --git a/public/css/gogs.css b/public/css/gogs.css index c1fc48a2c..a9c3249c7 100644 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -2399,6 +2399,9 @@ footer .ui.language .menu { .repository.settings.webhooks .types .menu .item { padding: 10px !important; } +.repository.settings.webhooks .logo.item img { + margin-top: -4px; +} .repository.settings.webhook .text.desc { margin-top: 5px; } diff --git a/public/less/_repository.less b/public/less/_repository.less index 7167c4cfe..04053c8b9 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -1407,6 +1407,10 @@ padding: 10px !important; } } + + .logo.item img { + margin-top: -4px; + } } &.webhook { diff --git a/routes/repo/pull.go b/routes/repo/pull.go index c6652c7fc..71199ee28 100644 --- a/routes/repo/pull.go +++ b/routes/repo/pull.go @@ -275,7 +275,7 @@ func ViewPullCommits(c *context.Context) { if c.Written() { return } else if prInfo == nil { - c.Handle(404, "ViewPullCommits", nil) + c.NotFound() return } commits = prInfo.Commits diff --git a/templates/repo/settings/webhook/list.tmpl b/templates/repo/settings/webhook/list.tmpl index 4e0a586f4..c8c6b3784 100644 --- a/templates/repo/settings/webhook/list.tmpl +++ b/templates/repo/settings/webhook/list.tmpl @@ -9,19 +9,19 @@