summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-12 13:29:27 +0800
committerGitHub <noreply@github.com>2022-12-12 13:29:27 +0800
commit003b4e209ce27e21e68b6a48ad2a7f6a1bcb17fb (patch)
tree73cd3aa90365da8d149cb1077c185d6f5451fa21 /templates
parent3e8285b824d77bafa3335765d68a6b499d9faad4 (diff)
downloadgitea-003b4e209ce27e21e68b6a48ad2a7f6a1bcb17fb.tar.gz
gitea-003b4e209ce27e21e68b6a48ad2a7f6a1bcb17fb.zip
Allow disable code tab (#20805)
I know some users created a repository in an organization but just use issues and projects to handle the whole organizations issues. So that `Code` could be disabled per repository. <img width="1148" alt="image" src="https://user-images.githubusercontent.com/81045/184792075-346cb508-b620-4adb-bc9a-cba76fdcb294.png"> It could also become a wiki repository. <img width="1173" alt="image" src="https://user-images.githubusercontent.com/81045/184792324-e15c6f68-35c0-4105-ab77-83585ce53672.png"> Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/settings/options.tmpl13
1 files changed, 13 insertions, 0 deletions
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index aa79f75617..e1f53072b8 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -249,6 +249,19 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="advanced">
+ {{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}}
+ <div class="inline field">
+ <label>{{.locale.Tr "repo.code"}}</label>
+ {{if .UnitTypeCode.UnitGlobalDisabled}}
+ <div class="ui checkbox tooltip disabled" data-content="{{.locale.Tr "repo.unit_disabled"}}">
+ {{else}}
+ <div class="ui checkbox">
+ {{end}}
+ <input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}>
+ <label>{{.locale.Tr "repo.code.desc"}}</label>
+ </div>
+ </div>
+
{{$isWikiEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeWiki) (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}
<div class="inline field">
<label>{{.locale.Tr "repo.wiki"}}</label>