aboutsummaryrefslogtreecommitdiff
path: root/templates/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-13 06:00:37 -0400
committerUnknwon <u@gogs.io>2017-03-13 06:00:37 -0400
commite1dcd1105168e9a66f5bfcdb3e169580ad21a2e3 (patch)
tree8a5d213bd0afe8df8f88e8d44b6825400a448bc6 /templates/repo
parent24734a33e72dbdc1da4f7341cb2cf62521ce53f8 (diff)
repo/settings: improve Git hook editor
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/settings/githook_edit.tmpl12
1 files changed, 10 insertions, 2 deletions
diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl
index d139fd3f..807c590d 100644
--- a/templates/repo/settings/githook_edit.tmpl
+++ b/templates/repo/settings/githook_edit.tmpl
@@ -16,11 +16,11 @@
{{with .Hook}}
<div class="inline field">
<label>{{$.i18n.Tr "repo.settings.githook_name"}}</label>
- <span>{{.Name}}</span>
+ <span><code>{{.Name}}</code></span>
</div>
<div class="field">
<label for="content">{{$.i18n.Tr "repo.settings.githook_content"}}</label>
- <textarea id="content" name="content" rows="20" wrap="off" autofocus>{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
+ <textarea id="content" name="content" wrap="off" autofocus>{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
</div>
<div class="inline field">
@@ -33,4 +33,12 @@
</div>
</div>
</div>
+
+<script>
+ CodeMirror.autoLoadMode(CodeMirror.fromTextArea($('#content')[0], {
+ lineNumbers: true,
+ mode: 'shell'
+ }), "shell");
+</script>
+
{{template "base/footer" .}}