aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-11-14 04:57:34 +0100
committerGitHub <noreply@github.com>2020-11-13 22:57:34 -0500
commit374ff60465ace2471d0dde121c6a3e1527ab0bec (patch)
tree76070c023124891a4ee08da8b5db01e13bf90d65 /templates/repo
parenta2efcb6acc85dbd231c402a4c308e76289d06cbd (diff)
downloadgitea-374ff60465ace2471d0dde121c6a3e1527ab0bec.tar.gz
gitea-374ff60465ace2471d0dde121c6a3e1527ab0bec.zip
Use monaco for the git hook editor (#13552)
Migrate git hook editor to monaco, replacing CodeMirror. Had to do a few refactors to make the monaco instantiation generic enough to be of use. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/editor/edit.tmpl2
-rw-r--r--templates/repo/settings/githook_edit.tmpl6
-rw-r--r--templates/repo/settings/githooks.tmpl4
3 files changed, 7 insertions, 5 deletions
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl
index 6b88d88597..b991d24242 100644
--- a/templates/repo/editor/edit.tmpl
+++ b/templates/repo/editor/edit.tmpl
@@ -36,7 +36,7 @@
{{end}}
</div>
<div class="ui bottom attached active tab segment" data-tab="write">
- <textarea id="edit_area" name="content" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
+ <textarea id="edit_area" name="content" class="hide" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
data-url="{{.Repository.APIURL}}/markdown"
data-context="{{.RepoLink}}"
data-markdown-file-exts="{{.MarkdownFileExts}}"
diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl
index 04833cfc58..4d68d9bfb1 100644
--- a/templates/repo/settings/githook_edit.tmpl
+++ b/templates/repo/settings/githook_edit.tmpl
@@ -14,13 +14,13 @@
{{with .Hook}}
<div class="inline field">
<label>{{$.i18n.Tr "repo.settings.githook_name"}}</label>
- <span>{{.Name}}</span>
+ <span class="hook-filename">{{.Name}}</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" class="hide">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
+ <div class="editor-loading is-loading"></div>
</div>
-
<div class="inline field">
<button class="ui green button">{{$.i18n.Tr "repo.settings.update_githook"}}</button>
</div>
diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl
index 213637ed46..522ec75e83 100644
--- a/templates/repo/settings/githooks.tmpl
+++ b/templates/repo/settings/githooks.tmpl
@@ -16,7 +16,9 @@
<div class="item">
<span class="text {{if .IsActive}}green{{else}}grey{{end}}">{{svg "octicon-dot-fill"}}</span>
<span>{{.Name}}</span>
- <a class="text blue ui right" href="{{$.RepoLink}}/settings/hooks/git/{{.Name}}"><i class="fa fa-pencil"></i></a>
+ <a class="text blue ui right" href="{{$.RepoLink}}/settings/hooks/git/{{.Name}}">
+ {{svg "octicon-pencil"}}
+ </a>
</div>
{{end}}
</div>