mirror of
https://github.com/go-gitea/gitea
synced 2025-12-07 13:28:25 +00:00
feat: support disable bots completely
This commit is contained in:
@@ -33,9 +33,11 @@
|
||||
{{.locale.Tr "settings.applications"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableBots}}
|
||||
<a class="{{if .PageIsAdminRunners}}active{{end}} item" href="{{AppSubUrl}}/admin/runners">
|
||||
{{.locale.Tr "admin.runners"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsAdminConfig}}active{{end}} item" href="{{AppSubUrl}}/admin/config">
|
||||
{{.locale.Tr "admin.config"}}
|
||||
</a>
|
||||
|
||||
@@ -22,9 +22,11 @@
|
||||
{{.locale.Tr "packages.title"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .EnableBots}}
|
||||
<a class="{{if .PageIsOrgSettingsRunners}}active{{end}} item" href="{{.OrgLink}}/settings/runners">
|
||||
{{.locale.Tr "repo.runners"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsOrgSettingsSecrets}}active{{end}} item" href="{{.OrgLink}}/settings/secrets">
|
||||
{{.locale.Tr "org.settings.secrets"}}
|
||||
</a>
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if and (not .UnitBotsGlobalDisabled) (.Permission.CanRead $.UnitTypeBots)}}
|
||||
{{if and .EnableBots (not .UnitBotsGlobalDisabled) (.Permission.CanRead $.UnitTypeBots)}}
|
||||
<a class="{{if .PageIsBots}}active{{end}} item" href="{{.RepoLink}}/bots">
|
||||
{{svg "octicon-play"}} {{.locale.Tr "repo.bots"}}
|
||||
{{if .Repository.NumOpenRuns}}
|
||||
|
||||
@@ -32,8 +32,10 @@
|
||||
{{.locale.Tr "repo.settings.lfs"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if .PageIsSettingsRunners}}active{{end}} item" href="{{.RepoLink}}/settings/runners">
|
||||
{{.locale.Tr "repo.settings.runners"}}
|
||||
</a>
|
||||
{{if and .EnableBots (not .UnitBotsGlobalDisabled) (.Permission.CanRead $.UnitTypeBots)}}
|
||||
<a class="{{if .PageIsSettingsRunners}}active{{end}} item" href="{{.RepoLink}}/settings/runners">
|
||||
{{.locale.Tr "repo.settings.runners"}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -420,18 +420,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$isBotsEnabled := .Repository.UnitEnabled $.UnitTypeBots}}
|
||||
<div class="inline field">
|
||||
<label>{{.locale.Tr "repo.bots"}}</label>
|
||||
{{if .UnitTypeBots.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_bots" type="checkbox" {{if $isBotsEnabled}}checked{{end}}>
|
||||
<label>{{.locale.Tr "repo.settings.bots_desc"}}</label>
|
||||
{{if .EnableBots }}
|
||||
{{$isBotsEnabled := .Repository.UnitEnabled $.UnitTypeBots}}
|
||||
<div class="inline field">
|
||||
<label>{{.locale.Tr "repo.bots"}}</label>
|
||||
{{if .UnitTypeBots.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_bots" type="checkbox" {{if $isBotsEnabled}}checked{{end}}>
|
||||
<label>{{.locale.Tr "repo.settings.bots_desc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if not .IsMirror}}
|
||||
<div class="ui divider"></div>
|
||||
|
||||
Reference in New Issue
Block a user