From a6d45f8b97545fcf4818e7559280707cee7c983a Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 19 Mar 2024 11:56:25 +0100 Subject: [PATCH] Implement FederationEnabled function for templates --- modules/templates/helper.go | 3 +++ templates/repo/settings/options.tmpl | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index bcb94bff25..9b2668d318 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -152,6 +152,9 @@ func NewFuncMap() template.FuncMap { "MermaidMaxSourceCharacters": func() int { return setting.MermaidMaxSourceCharacters }, + "FederationEnabled": func() bool { + return setting.Federation.Enabled + }, // ----------------------------------------------------------------- // render diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 4bcbe0777f..0aba59c794 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -63,9 +63,7 @@ - - {{$showFederationSettings := true}} - {{if $showFederationSettings}} + {{if FederationEnabled}}

{{ctx.Locale.Tr "repo.settings.federation_settings"}}