Files
gitea/templates/repo/settings/githook_edit.tmpl
silverwind 47b387921a Add code editor setting dropdowns (#36534)
Adds three `<select>` controls on top right for indent style, indent
size, and line wrap to the code editor (`_edit`), diff patch editor
(`_diffpatch`) and git hook editor (`/settings/hooks/git/pre-receive`).

The git hooks editor is restyled to wrap the content in a box. Also
included is a bugfix for the git hooks editor where monaco was not
initialized correctly.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-12 03:55:46 +08:00

30 lines
1.3 KiB
Handlebars

{{template "repo/settings/layout_head" (dict "ctxData" . "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-text-block tw-justify-between tw-flex-wrap">
{{ctx.Locale.Tr "repo.settings.githooks"}}
<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="inline field">
<label>{{ctx.Locale.Tr "repo.settings.githook_name"}}</label>
<span class="hook-filename">{{.Name}}</span>
</div>
<div class="field">
<label for="content">{{ctx.Locale.Tr "repo.settings.githook_content"}}</label>
<textarea id="content" name="content" class="tw-hidden">{{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" .}}