diff options
author | David Svantesson <davidsvantesson@gmail.com> | 2020-01-17 08:34:37 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2020-01-17 09:34:37 +0200 |
commit | 3c07d03c0388d3b86138572401281b51f2db9282 (patch) | |
tree | 06eecf8b818ee8721a5dbfdd688eb5f45e5bef51 /templates/repo/settings | |
parent | 36943e56d66a2d711a6b0c27219ce91a3ddc020a (diff) | |
download | gitea-3c07d03c0388d3b86138572401281b51f2db9282.tar.gz gitea-3c07d03c0388d3b86138572401281b51f2db9282.zip |
Add setting to set default and global disabled repository units. (#8788)
* Add possibility to global disable repo units.
* Add Default Repo Unit app.ini setting.
* Hide units
* Hide disabled repo units
* Minor fixes
* Indicate disabled units in team settings.
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates/repo/settings')
-rw-r--r-- | templates/repo/settings/options.tmpl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 6f96ff7f47..c674fcf7f9 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -144,20 +144,32 @@ {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}} <div class="inline field"> <label>{{.i18n.Tr "repo.wiki"}}</label> + {{if and (.UnitTypeWiki.UnitGlobalDisabled) (.UnitTypeExternalWiki.UnitGlobalDisabled)}} + <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}"> + {{else}} <div class="ui checkbox"> + {{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 $isWikiEnabled}}disabled{{end}}" id="wiki_box"> <div class="field"> + {{if .UnitTypeWiki.UnitGlobalDisabled}} + <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}"> + {{else}} <div class="ui radio checkbox"> + {{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"> + {{if .UnitTypeExternalWiki.UnitGlobalDisabled}} + <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}"> + {{else}} <div class="ui radio checkbox"> + {{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> @@ -174,14 +186,22 @@ {{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}} <div class="inline field"> <label>{{.i18n.Tr "repo.issues"}}</label> + {{if and (.UnitTypeIssues.UnitGlobalDisabled) (.UnitTypeExternalTracker.UnitGlobalDisabled)}} + <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}"> + {{else}} <div class="ui checkbox"> + {{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 $isIssuesEnabled}}disabled{{end}}" id="issue_box"> <div class="field"> + {{if .UnitTypeIssues.UnitGlobalDisabled}} + <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}"> + {{else}} <div class="ui radio checkbox"> + {{end}} <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}checked{{end}}/> <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label> </div> @@ -209,7 +229,11 @@ </div> </div> <div class="field"> + {{if .UnitTypeExternalTracker.UnitGlobalDisabled}} + <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}"> + {{else}} <div class="ui radio checkbox"> + {{end}} <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}checked{{end}}/> <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label> </div> @@ -251,7 +275,11 @@ {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}} <div class="inline field"> <label>{{.i18n.Tr "repo.pulls"}}</label> + {{if .UnitTypePullRequests.UnitGlobalDisabled}} + <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}"> + {{else}} <div class="ui checkbox"> + {{end}} <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}> <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label> </div> |