2
0

feat(i18n): add organization license settings and AI template helpers
Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Failing after 1m46s
Build and Release / Unit Tests (push) Successful in 3m14s
Build and Release / Lint (push) Failing after 3m39s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped

Add organization-level license management with new settings page and locale strings across all languages. Add AI feature detection helpers (IsAIEnabled, IsAICodeReviewEnabled, IsAIIssueTriageEnabled) to template functions. Add license scanning functionality to repository settings.
This commit is contained in:
2026-01-19 17:19:32 -05:00
parent a91f76bbab
commit d352b138d7
41 changed files with 804 additions and 76 deletions

View File

@@ -12,6 +12,7 @@ import (
"strings"
"time"
"code.gitcaddy.com/server/v3/modules/ai"
"code.gitcaddy.com/server/v3/modules/base"
"code.gitcaddy.com/server/v3/modules/htmlutil"
"code.gitcaddy.com/server/v3/modules/markup"
@@ -165,9 +166,23 @@ func NewFuncMap() template.FuncMap {
"FilenameIsImage": filenameIsImage,
"TabSizeClass": tabSizeClass,
// -----------------------------------------------------------------
// AI features
"IsAIEnabled": ai.IsEnabled,
"IsAICodeReviewEnabled": isAICodeReviewEnabled,
"IsAIIssueTriageEnabled": isAIIssueTriageEnabled,
}
}
func isAICodeReviewEnabled() bool {
return ai.IsEnabled() && setting.AI.EnableCodeReview
}
func isAIIssueTriageEnabled() bool {
return ai.IsEnabled() && setting.AI.EnableIssueTriage
}
// SanitizeHTML sanitizes the input by default sanitization rules.
func SanitizeHTML(s string) template.HTML {
return markup.Sanitize(s)