Skip to content

Commit

Permalink
Merge go-gitea#27231 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kerwin612 committed Nov 3, 2023
1 parent 57a65e2 commit a566e3a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions templates/admin/hook_new.tmpl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin settings new webhook")}}
<div class="admin-setting-content">
{{$IsNew := false}}
{{$CustomHeaderTitle := .locale.Tr "admin.defaulthooks.update_webhook"}}
{{$CustomHeaderTitle := ctx.Locale.Tr "admin.defaulthooks.update_webhook"}}
{{if .PageIsAdminDefaultHooksNew}}
{{$IsNew = true}}
{{$CustomHeaderTitle = .locale.Tr "admin.defaulthooks.add_webhook"}}
{{$CustomHeaderTitle = ctx.Locale.Tr "admin.defaulthooks.add_webhook"}}
{{else if .PageIsAdminSystemHooksNew}}
{{$IsNew = true}}
{{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.add_webhook"}}
{{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.add_webhook"}}
{{else if .Webhook.IsSystemWebhook}}
{{$IsNew = false}}
{{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.update_webhook"}}
{{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.update_webhook"}}
{{end}}
{{template "webhook/form" (dict "ctxData" . "IsNew" $IsNew "CustomHeaderTitle" $CustomHeaderTitle)}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/org/settings/hook_new.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings new webhook")}}
<div class="org-setting-content">
{{$IsNew := false}}
{{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
{{if .PageIsSettingsHooksNew}}
{{$IsNew = true}}
{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}
{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}
{{end}}
{{template "webhook/form" (dict "ctxData" . "IsNew" $IsNew "CustomHeaderTitle" $CustomHeaderTitle)}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/settings/webhook/base_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Title}}
<div class="ui right">
<div class="ui jump dropdown">
<div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div>
<div class="ui primary tiny button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</div>
{{template "webhook/selector" .}}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/settings/webhook/new.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}}
<div class="repo-setting-content">
{{$IsNew := false}}
{{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
{{if .PageIsSettingsHooksNew}}
{{$IsNew = true}}
{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}
{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}
{{end}}
{{template "webhook/form" (dict "ctxData" . "IsNew" $IsNew "CustomHeaderTitle" $CustomHeaderTitle)}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/user/settings/hook_new.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings new webhook")}}
<div class="user-setting-content">
{{$IsNew := false}}
{{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
{{if .PageIsSettingsHooksNew}}
{{$IsNew = true}}
{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}
{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}
{{end}}
{{template "webhook/form" (dict "ctxData" . "IsNew" $IsNew "CustomHeaderTitle" $CustomHeaderTitle)}}
</div>
Expand Down
22 changes: 11 additions & 11 deletions templates/webhook/selector.tmpl
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<div class="menu">
<a class="item" href="{{.BaseLinkNew}}/gitea/new">
{{template "shared/webhook/icon" (dict "HookType" "gitea" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_gitea"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_gitea"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/gogs/new">
{{template "shared/webhook/icon" (dict "HookType" "gogs" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_gogs"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_gogs"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/slack/new">
{{template "shared/webhook/icon" (dict "HookType" "slack" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_slack"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_slack"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/discord/new">
{{template "shared/webhook/icon" (dict "HookType" "discord" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_discord"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_discord"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/dingtalk/new">
{{template "shared/webhook/icon" (dict "HookType" "dingtalk" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_dingtalk"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/telegram/new">
{{template "shared/webhook/icon" (dict "HookType" "telegram" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_telegram"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_telegram"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/msteams/new">
{{template "shared/webhook/icon" (dict "HookType" "msteams" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_msteams"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_msteams"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/feishu/new">
{{template "shared/webhook/icon" (dict "HookType" "feishu" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/matrix/new">
{{template "shared/webhook/icon" (dict "HookType" "matrix" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_matrix"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_matrix"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/wechatwork/new">
{{template "shared/webhook/icon" (dict "HookType" "wechatwork" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_wechatwork"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/packagist/new">
{{template "shared/webhook/icon" (dict "HookType" "packagist" "Size" 20)}}
{{.locale.Tr "repo.settings.web_hook_name_packagist"}}
{{ctx.Locale.Tr "repo.settings.web_hook_name_packagist"}}
</a>
</div>

0 comments on commit a566e3a

Please sign in to comment.