0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-07 08:13:50 +02:00
gitea/templates/repo/settings/githook_edit.tmpl
Copilot b093c2c43c
refactor(templates): remove ctxData from tmpl files, use ctx.RootData instead (#37567)
Sub-templates have direct access to `ctx.RootData` (the root data map),
so there is no need for callers to explicitly pass it as `ctxData` via `dict`.

Also fix #37569 by the way

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-05-06 18:21:48 +00:00

27 lines
1.1 KiB
Handlebars

{{template "repo/settings/layout_head" (dict "pageClass" "repository settings edit githook")}}
<div class="repo-setting-content">
<form class="ui form" action="{{.Link}}" method="post">
<h4 class="ui top attached header flex-left-right">
{{.Hook.Name}}
<div class="tw-font-normal tw-font-sans tw-text-base">
{{template "repo/editor/options" dict "CodeEditorConfig" $.CodeEditorConfig}}
</div>
</h4>
<div class="ui attached segment">
<p>{{ctx.Locale.Tr "repo.settings.githook_edit_desc"}}</p>
{{with .Hook}}
<div class="field">
<textarea id="content" name="content" class="tw-hidden"
data-code-editor-config="{{JsonUtils.EncodeToString $.CodeEditorConfig}}"
placeholder="{{ctx.Locale.Tr "editor.code_editor.placeholder"}}">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
<div class="editor-loading is-loading"></div>
</div>
<div class="inline field">
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_githook"}}</button>
</div>
{{end}}
</div>
</form>
</div>
{{template "repo/settings/layout_footer" .}}