summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-08-02 01:46:54 -0700
committerLauris BH <lauris@nix.lv>2017-08-02 11:46:54 +0300
commitf29458bd3a20d2d89638d5031d801c161f456374 (patch)
tree959c680d58eb5cfd82d719357759963fa7095fe6 /templates
parent539d9f4c3070abb0f024b133a4f53187a76cbcb7 (diff)
downloadgitea-f29458bd3a20d2d89638d5031d801c161f456374.tar.gz
gitea-f29458bd3a20d2d89638d5031d801c161f456374.zip
EnableUnit() -> UnitEnabled() (#2242)
Diffstat (limited to 'templates')
-rw-r--r--templates/org/team/new.tmpl2
-rw-r--r--templates/repo/header.tmpl12
-rw-r--r--templates/repo/settings/options.tmpl22
3 files changed, 18 insertions, 18 deletions
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
index 79338394bf..27335e247a 100644
--- a/templates/org/team/new.tmpl
+++ b/templates/org/team/new.tmpl
@@ -57,7 +57,7 @@
{{range $t, $unit := $.Units}}
<div class="field">
<div class="ui toggle checkbox">
- <input type="checkbox" class="hidden" name="units" value="{{$unit.Type}}"{{if $.Team.EnableUnit $unit.Type}} checked{{end}}>
+ <input type="checkbox" class="hidden" name="units" value="{{$unit.Type}}"{{if $.Team.UnitEnabled $unit.Type}} checked{{end}}>
<label>{{$.i18n.Tr $unit.NameKey}}</label>
<span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
</div>
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index db636eb9bd..7c91000488 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -49,19 +49,19 @@
{{if not .IsDiffCompare}}
<div class="ui tabs container">
<div class="ui tabular stackable menu navbar">
- {{if .Repository.EnableUnit $.UnitTypeCode}}
+ {{if .Repository.UnitEnabled $.UnitTypeCode}}
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
<i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
</a>
{{end}}
- {{if .Repository.EnableUnit $.UnitTypeIssues}}
+ {{if .Repository.UnitEnabled $.UnitTypeIssues}}
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
<i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenIssues}}</span>
</a>
{{end}}
- {{if .Repository.EnableUnit $.UnitTypeExternalTracker}}
+ {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
<i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} </span>
</a>
@@ -73,19 +73,19 @@
</a>
{{end}}
- {{if and (.Repository.EnableUnit $.UnitTypeCode) (not .IsBareRepo)}}
+ {{if and (.Repository.UnitEnabled $.UnitTypeCode) (not .IsBareRepo)}}
<a class="{{if (or (.PageIsCommits) (.PageIsDiff))}}active{{end}} item" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}">
<i class="octicon octicon-history"></i> {{.i18n.Tr "repo.commits"}} <span class="ui {{if not .CommitsCount}}gray{{else}}blue{{end}} small label">{{.CommitsCount}}</span>
</a>
{{end}}
- {{if and (.Repository.EnableUnit $.UnitTypeReleases) (not .IsBareRepo) }}
+ {{if and (.Repository.UnitEnabled $.UnitTypeReleases) (not .IsBareRepo) }}
<a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
<i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumTags}}gray{{else}}blue{{end}} small label">{{.Repository.NumTags}}</span>
</a>
{{end}}
- {{if or (.Repository.EnableUnit $.UnitTypeWiki) (.Repository.EnableUnit $.UnitTypeExternalWiki)}}
+ {{if or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
<a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
<i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
</a>
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 8ad09d4306..8a7ea218bc 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -93,7 +93,7 @@
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="advanced">
- {{$isWikiEnabled := or (.Repository.EnableUnit $.UnitTypeWiki) (.Repository.EnableUnit $.UnitTypeExternalWiki)}}
+ {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
<div class="inline field">
<label>{{.i18n.Tr "repo.wiki"}}</label>
<div class="ui checkbox">
@@ -104,17 +104,17 @@
<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}}/>
+ <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}checked{{end}}/>
<label>{{.i18n.Tr "repo.settings.use_internal_wiki"}}</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
- <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.EnableUnit $.UnitTypeExternalWiki}}checked{{end}}/>
+ <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.UnitTypeExternalWiki}}checked{{end}}/>
<label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
</div>
</div>
- <div class="field {{if not (.Repository.EnableUnit $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
+ <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
<label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
<input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
<p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
@@ -123,7 +123,7 @@
<div class="ui divider"></div>
- {{$isIssuesEnabled := or (.Repository.EnableUnit $.UnitTypeIssues) (.Repository.EnableUnit $.UnitTypeExternalTracker)}}
+ {{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
<div class="inline field">
<label>{{.i18n.Tr "repo.issues"}}</label>
<div class="ui checkbox">
@@ -134,17 +134,17 @@
<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}}/>
+ <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}checked{{end}}/>
<label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
- <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-target="#external_issue_box" {{if .Repository.EnableUnit $.UnitTypeExternalTracker}}checked{{end}}/>
+ <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}checked{{end}}/>
<label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
</div>
</div>
- <div class="field {{if not (.Repository.EnableUnit $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
+ <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
<div class="field">
<label for="external_tracker_url">{{.i18n.Tr "repo.settings.external_tracker_url"}}</label>
<input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
@@ -181,7 +181,7 @@
<div class="inline field">
<label>{{.i18n.Tr "repo.pulls"}}</label>
<div class="ui checkbox">
- <input name="enable_pulls" type="checkbox" {{if .Repository.EnableUnit $.UnitTypePullRequests}}checked{{end}}>
+ <input name="enable_pulls" type="checkbox" {{if .Repository.UnitEnabled $.UnitTypePullRequests}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
</div>
</div>
@@ -222,7 +222,7 @@
</div>
</div>
- {{if .Repository.EnableUnit $.UnitTypeWiki}}
+ {{if .Repository.UnitEnabled $.UnitTypeWiki}}
<div class="ui divider"></div>
<div class="item">
@@ -354,7 +354,7 @@
</div>
</div>
- {{if .Repository.EnableUnit $.UnitTypeWiki}}
+ {{if .Repository.UnitEnabled $.UnitTypeWiki}}
<div class="ui small modal" id="delete-wiki-modal">
<div class="header">
{{.i18n.Tr "repo.settings.wiki-delete"}}