mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-24 22:36:17 +02:00
Merge branch 'main' into feature/bots
This commit is contained in:
commit
59c3707da2
@ -398,6 +398,15 @@ func SettingsPost(ctx *context.Context) {
|
|||||||
repoChanged = true
|
repoChanged = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if form.EnableCode && !unit_model.TypeCode.UnitGlobalDisabled() {
|
||||||
|
units = append(units, repo_model.RepoUnit{
|
||||||
|
RepoID: repo.ID,
|
||||||
|
Type: unit_model.TypeCode,
|
||||||
|
})
|
||||||
|
} else if !unit_model.TypeCode.UnitGlobalDisabled() {
|
||||||
|
deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeCode)
|
||||||
|
}
|
||||||
|
|
||||||
if form.EnableWiki && form.EnableExternalWiki && !unit_model.TypeExternalWiki.UnitGlobalDisabled() {
|
if form.EnableWiki && form.EnableExternalWiki && !unit_model.TypeExternalWiki.UnitGlobalDisabled() {
|
||||||
if !validation.IsValidExternalURL(form.ExternalWikiURL) {
|
if !validation.IsValidExternalURL(form.ExternalWikiURL) {
|
||||||
ctx.Flash.Error(ctx.Tr("repo.settings.external_wiki_url_error"))
|
ctx.Flash.Error(ctx.Tr("repo.settings.external_wiki_url_error"))
|
||||||
|
@ -134,6 +134,7 @@ type RepoSettingForm struct {
|
|||||||
EnablePrune bool
|
EnablePrune bool
|
||||||
|
|
||||||
// Advanced settings
|
// Advanced settings
|
||||||
|
EnableCode bool
|
||||||
EnableWiki bool
|
EnableWiki bool
|
||||||
EnableExternalWiki bool
|
EnableExternalWiki bool
|
||||||
ExternalWikiURL string
|
ExternalWikiURL string
|
||||||
|
@ -249,6 +249,19 @@
|
|||||||
{{.CsrfTokenHtml}}
|
{{.CsrfTokenHtml}}
|
||||||
<input type="hidden" name="action" value="advanced">
|
<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)}}
|
{{$isWikiEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeWiki) (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}
|
||||||
<div class="inline field">
|
<div class="inline field">
|
||||||
<label>{{.locale.Tr "repo.wiki"}}</label>
|
<label>{{.locale.Tr "repo.wiki"}}</label>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user