loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Change webhook-type in create-view (#29114)

It's now possible to change webhook-type in create-view.

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/9ee1b9fb-843b-4f28-b8d6-6361e5d184f1)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/9dbf058f-5912-43af-9acd-487271212f2d)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 374e886f5113a996e1e927a60d1775e77262c364)

Conflicts:
templates/repo/settings/webhook/base_list.tmpl
templates/shared/webhook/icon.tmpl

authored by

Tim-Nicas Oelschläger
silverwind
Giteabot
and committed by
Earl Warren
7263b3ef c2d4c2fc

+71 -53
+1
routers/web/repo/setting/webhook.go
··· 151 151 } 152 152 } 153 153 ctx.Data["BaseLink"] = orCtx.LinkNew 154 + ctx.Data["BaseLinkNew"] = orCtx.LinkNew 154 155 155 156 ctx.HTML(http.StatusOK, orCtx.NewTemplate) 156 157 }
+1 -50
templates/repo/settings/webhook/base_list.tmpl
··· 3 3 <div class="ui right"> 4 4 <div class="ui jump dropdown"> 5 5 <div class="ui primary tiny button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</div> 6 - <div class="menu"> 7 - <a class="item" href="{{.BaseLinkNew}}/forgejo/new"> 8 - {{template "shared/webhook/icon" (dict "HookType" "forgejo" "Size" 20)}} 9 - {{ctx.Locale.Tr "repo.settings.web_hook_name_forgejo"}} 10 - </a> 11 - <a class="item" href="{{.BaseLinkNew}}/gitea/new"> 12 - {{template "shared/webhook/icon" (dict "HookType" "gitea" "Size" 20)}} 13 - {{ctx.Locale.Tr "repo.settings.web_hook_name_gitea"}} 14 - </a> 15 - <a class="item" href="{{.BaseLinkNew}}/gogs/new"> 16 - {{template "shared/webhook/icon" (dict "HookType" "gogs" "Size" 20)}} 17 - {{ctx.Locale.Tr "repo.settings.web_hook_name_gogs"}} 18 - </a> 19 - <a class="item" href="{{.BaseLinkNew}}/slack/new"> 20 - {{template "shared/webhook/icon" (dict "HookType" "slack" "Size" 20)}} 21 - {{ctx.Locale.Tr "repo.settings.web_hook_name_slack"}} 22 - </a> 23 - <a class="item" href="{{.BaseLinkNew}}/discord/new"> 24 - {{template "shared/webhook/icon" (dict "HookType" "discord" "Size" 20)}} 25 - {{ctx.Locale.Tr "repo.settings.web_hook_name_discord"}} 26 - </a> 27 - <a class="item" href="{{.BaseLinkNew}}/dingtalk/new"> 28 - {{template "shared/webhook/icon" (dict "HookType" "dingtalk" "Size" 20)}} 29 - {{ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk"}} 30 - </a> 31 - <a class="item" href="{{.BaseLinkNew}}/telegram/new"> 32 - {{template "shared/webhook/icon" (dict "HookType" "telegram" "Size" 20)}} 33 - {{ctx.Locale.Tr "repo.settings.web_hook_name_telegram"}} 34 - </a> 35 - <a class="item" href="{{.BaseLinkNew}}/msteams/new"> 36 - {{template "shared/webhook/icon" (dict "HookType" "msteams" "Size" 20)}} 37 - {{ctx.Locale.Tr "repo.settings.web_hook_name_msteams"}} 38 - </a> 39 - <a class="item" href="{{.BaseLinkNew}}/feishu/new"> 40 - {{template "shared/webhook/icon" (dict "HookType" "feishu" "Size" 20)}} 41 - {{ctx.Locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}} 42 - </a> 43 - <a class="item" href="{{.BaseLinkNew}}/matrix/new"> 44 - {{template "shared/webhook/icon" (dict "HookType" "matrix" "Size" 20)}} 45 - {{ctx.Locale.Tr "repo.settings.web_hook_name_matrix"}} 46 - </a> 47 - <a class="item" href="{{.BaseLinkNew}}/wechatwork/new"> 48 - {{template "shared/webhook/icon" (dict "HookType" "wechatwork" "Size" 20)}} 49 - {{ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork"}} 50 - </a> 51 - <a class="item" href="{{.BaseLinkNew}}/packagist/new"> 52 - {{template "shared/webhook/icon" (dict "HookType" "packagist" "Size" 20)}} 53 - {{ctx.Locale.Tr "repo.settings.web_hook_name_packagist"}} 54 - </a> 55 - </div> 6 + {{template "repo/settings/webhook/link_menu" .}} 56 7 </div> 57 8 </div> 58 9 </h4>
+1 -1
templates/shared/webhook/icon.tmpl
··· 5 5 {{if eq .HookType "forgejo"}} 6 6 <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/forgejo.svg"> 7 7 {{else if eq .HookType "gitea"}} 8 - <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gitea-original.svg"> 8 + {{svg "gitea-gitea" $size "img"}} 9 9 {{else if eq .HookType "gogs"}} 10 10 <img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/gogs.ico"> 11 11 {{else if eq .HookType "slack"}}
+7 -2
templates/webhook/new.tmpl
··· 1 1 <h4 class="ui top attached header"> 2 2 {{.CustomHeaderTitle}} 3 - <div class="ui right"> 4 - {{template "shared/webhook/icon" .ctxData}} 3 + <div class="ui right type dropdown"> 4 + <div class="text gt-df gt-ac"> 5 + {{template "shared/webhook/icon" (dict "Size" 20 "HookType" .ctxData.HookType)}} 6 + {{ctx.Locale.Tr (print "repo.settings.web_hook_name_" .ctxData.HookType)}} 7 + </div> 8 + {{svg "octicon-triangle-down" 14 "dropdown icon"}} 9 + {{template "repo/settings/webhook/link_menu" .ctxData}} 5 10 </div> 6 11 </h4> 7 12 <div class="ui attached segment">
+7
web_src/css/base.css
··· 413 413 color: var(--color-text-light-2); 414 414 } 415 415 416 + /* extend fomantic style '.ui.dropdown > .text > img' to include svg.img */ 417 + .ui.dropdown > .text > .img { 418 + margin-left: 0; 419 + float: none; 420 + margin-right: 0.78571429rem; 421 + } 422 + 416 423 .ui.dropdown > .text > .description, 417 424 .ui.dropdown .menu > .item > .description { 418 425 color: var(--color-text-light-2);