aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/settings/options.tmpl
diff options
context:
space:
mode:
authorMorlinest <Morlinest@users.noreply.github.com>2017-04-03 04:19:51 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-04-03 10:19:51 +0800
commit21fd3da6f5c2787d3df7670fd7d571cf36039ff9 (patch)
treeaa27b1d7e1adffe5e9140d35cf88823e351e8711 /templates/repo/settings/options.tmpl
parent37a34c1a28c1a49e00adfef751b44de2f1b84d4b (diff)
downloadgitea-21fd3da6f5c2787d3df7670fd7d571cf36039ff9.tar.gz
gitea-21fd3da6f5c2787d3df7670fd7d571cf36039ff9.zip
Fix disabled fields in repo settings UI (#1431)
Diffstat (limited to 'templates/repo/settings/options.tmpl')
-rw-r--r--templates/repo/settings/options.tmpl10
1 files changed, 6 insertions, 4 deletions
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index cd7d2c304b..dbe7d81f84 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -93,14 +93,15 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="advanced">
+ {{$isWikiEnabled := or (.Repository.EnableUnit $.UnitTypeWiki) (.Repository.EnableUnit $.UnitTypeExternalWiki)}}
<div class="inline field">
<label>{{.i18n.Tr "repo.wiki"}}</label>
<div class="ui checkbox">
- <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if or (.Repository.EnableUnit $.UnitTypeWiki) (.Repository.EnableUnit $.UnitTypeExternalWiki)}}checked{{end}}>
+ <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
</div>
</div>
- <div class="field {{if not (.Repository.EnableUnit $.UnitTypeWiki)}}disabled{{end}}" id="wiki_box">
+ <div class="field {{if not $isWikiEnabled}}disabled{{end}}" id="wiki_box">
<div class="field">
<div class="ui radio checkbox">
<input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.EnableUnit $.UnitTypeExternalWiki)}}checked{{end}}/>
@@ -122,14 +123,15 @@
<div class="ui divider"></div>
+ {{$isIssuesEnabled := or (.Repository.EnableUnit $.UnitTypeIssues) (.Repository.EnableUnit $.UnitTypeExternalTracker)}}
<div class="inline field">
<label>{{.i18n.Tr "repo.issues"}}</label>
<div class="ui checkbox">
- <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if or (.Repository.EnableUnit $.UnitTypeIssues) (.Repository.EnableUnit $.UnitTypeExternalTracker)}}checked{{end}}>
+ <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
</div>
</div>
- <div class="field {{if not (.Repository.EnableUnit $.UnitTypeIssues)}}disabled{{end}}" id="issue_box">
+ <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
<div class="field">
<div class="ui radio checkbox">
<input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-target="#external_issue_box" {{if not (.Repository.EnableUnit $.UnitTypeExternalTracker)}}checked{{end}}/>