From 779cb18857d7d799d307fd353073f68003ff1871 Mon Sep 17 00:00:00 2001 From: logikonline Date: Sun, 1 Feb 2026 18:33:10 -0500 Subject: [PATCH] fix(blog): improve blog tab visibility and add help text Changes blog tab visibility check from generic IsWriter to specific CanWrite permission for code unit. Adds help text to blog and subscription settings explaining behavior and access requirements. --- options/locale/locale_en-US.json | 2 ++ templates/repo/header.tmpl | 2 +- templates/repo/settings/options.tmpl | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 1d2036f3f5..80e9cdf635 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -2005,6 +2005,7 @@ "repo.settings.blog": "Blog", "repo.settings.blog.enable": "Enable Blog", "repo.settings.blog.enable_desc": "Allow blog posts to be created and published from this repository.", + "repo.settings.blog.enable_help": "When enabled, repo members with write access can create, edit, and publish blog posts. Subscribers and watchers will be notified on publish.", "repo.settings.blog.saved": "Blog settings saved.", "repo.wiki": "Wiki", "repo.wiki.welcome": "Welcome to the Wiki.", @@ -4136,6 +4137,7 @@ "repo.settings.subscriptions.products": "Products", "repo.settings.subscriptions.clients": "Clients", "repo.settings.subscriptions.enable": "Enable paid subscriptions", + "repo.settings.subscriptions.enable_help": "When enabled, code access (source view, clone, archive) will require an active subscription. Issues and releases remain accessible per the repository's visibility settings.", "repo.settings.subscriptions.enable_desc": "When enabled, code access (source view, clone, archive) will require an active subscription. Issues and releases remain accessible per the repository's visibility settings.", "repo.settings.subscriptions.enabled": "Subscriptions are enabled for this repository.", "repo.settings.subscriptions.disabled": "Subscriptions are disabled.", diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 934174978c..f2842813e2 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -214,7 +214,7 @@ {{end}} {{if and .Repository.BlogEnabled (ctx.RootData.SystemConfig.Theme.EnableBlogs.Value ctx)}} - {{if or .IsWriter (gt .BlogPostCount 0)}} + {{if or (.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) (gt .BlogPostCount 0)}} {{svg "octicon-note"}} {{ctx.Locale.Tr "repo.blog"}} {{if gt .BlogPostCount 0}}{{.BlogPostCount}}{{end}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index f4d05e4a99..228563cf42 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -361,6 +361,7 @@ +

{{ctx.Locale.Tr "repo.settings.blog.enable_help"}}

{{end}}