diff --git a/routers/web/repo/setting/webhook.go b/routers/web/repo/setting/webhook.go index ab3c70006f79..c12d7e82a667 100644 --- a/routers/web/repo/setting/webhook.go +++ b/routers/web/repo/setting/webhook.go @@ -151,6 +151,7 @@ func WebhooksNew(ctx *context.Context) { } } ctx.Data["BaseLink"] = orCtx.LinkNew + ctx.Data["BaseLinkNew"] = orCtx.LinkNew ctx.HTML(http.StatusOK, orCtx.NewTemplate) } diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl index ed6e670d60c7..5a3fc0e7b88d 100644 --- a/templates/repo/settings/webhook/base_list.tmpl +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -3,52 +3,7 @@
diff --git a/templates/repo/settings/webhook/link_menu.tmpl b/templates/repo/settings/webhook/link_menu.tmpl new file mode 100644 index 000000000000..e2c86dcc3c08 --- /dev/null +++ b/templates/repo/settings/webhook/link_menu.tmpl @@ -0,0 +1,50 @@ +{{$size := 20}} +{{if .Size}} + {{$size = .Size}} +{{end}} + diff --git a/templates/shared/webhook/icon.tmpl b/templates/shared/webhook/icon.tmpl index 84f9de266fab..0f80787c574a 100644 --- a/templates/shared/webhook/icon.tmpl +++ b/templates/shared/webhook/icon.tmpl @@ -3,7 +3,7 @@ {{$size = .Size}} {{end}} {{if eq .HookType "gitea"}} - + {{svg "gitea-gitea" $size "img"}} {{else if eq .HookType "gogs"}} {{else if eq .HookType "slack"}} diff --git a/templates/webhook/new.tmpl b/templates/webhook/new.tmpl index a185c42b51ea..305133c03a16 100644 --- a/templates/webhook/new.tmpl +++ b/templates/webhook/new.tmpl @@ -1,7 +1,12 @@

{{.CustomHeaderTitle}} -
- {{template "shared/webhook/icon" .ctxData}} +

diff --git a/web_src/css/base.css b/web_src/css/base.css index ea32aac6f777..0d547f16ffad 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -413,6 +413,13 @@ ol.ui.list li, color: var(--color-text-light-2); } +/* extend fomantic style '.ui.dropdown > .text > img' to include svg.img */ +.ui.dropdown > .text > .img { + margin-left: 0; + float: none; + margin-right: 0.78571429rem; +} + .ui.dropdown > .text > .description, .ui.dropdown .menu > .item > .description { color: var(--color-text-light-2);