From f1c826ed29ec1925c4ed080c6cf1ab0baa8c97c4 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 20 Jan 2023 06:18:58 +0100 Subject: [PATCH] Mute all links in issue timeline (#22534) Backport of https://github.com/go-gitea/gitea/pull/22533. https://github.com/go-gitea/gitea/pull/21799 introduced a regression where some links in the issue timeline were not muted any more. Fix it by replacing all `class="text grey"` with `class="text grey muted-links"` in the file. Co-authored-by: KN4CK3R --- .../repo/issue/view_content/comments.tmpl | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index e9b7172d1..a9ceb084f 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -29,7 +29,7 @@ {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{.OriginalAuthor}} - + {{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}} @@ -41,7 +41,7 @@ {{avatar .Poster}} {{end}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} @@ -95,7 +95,7 @@
{{svg "octicon-dot-fill"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if .Issue.IsPull}} {{$.locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}} @@ -108,7 +108,7 @@
{{svg "octicon-circle-slash"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if .Issue.IsPull}} {{$.locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}} @@ -121,7 +121,7 @@
{{svg "octicon-git-merge"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$link := printf "%s/commit/%s" $.Repository.HTMLURL ($.Issue.PullRequest.MergedCommitID|PathEscape)}} {{if eq $.Issue.PullRequest.Status 3}} @@ -156,20 +156,20 @@ {{if eq .RefAction 3}}{{end}}
{{else if eq .Type 4}}
{{svg "octicon-bookmark"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}
{{svg "octicon-git-commit"}} - {{.Content | Str2html}} + {{.Content | Str2html}}
{{else if eq .Type 7}} @@ -177,7 +177,7 @@
{{svg "octicon-tag"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if and .AddedLabels (not .RemovedLabels)}} {{$.locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels .AddedLabels $.RepoLink) $createdStr | Safe}} @@ -193,7 +193,7 @@
{{svg "octicon-milestone"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}} @@ -204,7 +204,7 @@ {{if gt .AssigneeID 0}} {{if .RemovedAssignee}} {{template "shared/user/avatarlink" .Assignee}} - + {{template "shared/user/authorlink" .Assignee}} {{if eq .Poster.ID .Assignee.ID}} {{$.locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}} @@ -214,7 +214,7 @@ {{else}} {{template "shared/user/avatarlink" .Assignee}} - + {{template "shared/user/authorlink" .Assignee}} {{if eq .Poster.ID .AssigneeID}} {{$.locale.Tr "repo.issues.self_assign_at" $createdStr | Safe}} @@ -229,7 +229,7 @@
{{svg "octicon-pencil"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji) (.NewTitle|RenderEmoji) $createdStr | Safe}} @@ -238,7 +238,7 @@
{{svg "octicon-git-branch"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}} @@ -247,7 +247,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.start_tracking_history" $createdStr | Safe}} @@ -256,35 +256,35 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}} {{template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" .}}
{{svg "octicon-clock"}} - {{.Content}} + {{.Content}}
{{else if eq .Type 14}}
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}} {{template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" .}}
{{svg "octicon-clock"}} - {{.Content}} + {{.Content}}
{{else if eq .Type 15}}
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}} @@ -293,7 +293,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}} @@ -302,7 +302,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$parsedDeadline := .Content | ParseDeadline}} {{$.locale.Tr "repo.issues.due_date_modified" (index $parsedDeadline 0) (index $parsedDeadline 1) $createdStr | Safe}} @@ -312,7 +312,7 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}} @@ -321,15 +321,15 @@
{{svg "octicon-package-dependents"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}} {{if .DependentIssue}}
{{svg "octicon-plus"}} - - + + {{if eq .DependentIssue.RepoID .Issue.RepoID}} #{{.DependentIssue.Index}} {{.DependentIssue.Title}} {{else}} @@ -344,15 +344,15 @@
{{svg "octicon-package-dependents"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}} {{if .DependentIssue}}
- {{svg "octicon-trash"}} - - + {{svg "octicon-trash"}} + + {{if eq .DependentIssue.RepoID .Issue.RepoID}} #{{.DependentIssue.Index}} {{.DependentIssue.Title}} {{else}} @@ -373,13 +373,13 @@ {{end}} {{svg (printf "octicon-%s" .Review.Type.Icon)}} - + {{if .OriginalAuthor}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{.OriginalAuthor}} - {{if $.Repository.OriginalURL}} + {{if $.Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} {{else}} {{template "shared/user/authorlink" .Poster}} @@ -404,13 +404,13 @@
- + {{if .OriginalAuthor}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{.OriginalAuthor}} - {{if $.Repository.OriginalURL}} + {{if $.Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} {{else}} {{template "shared/user/authorlink" .Poster}} @@ -532,13 +532,13 @@ {{avatar .Poster}} {{end}} - + {{if .OriginalAuthor}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} {{.OriginalAuthor}} - {{if $.Repository.OriginalURL}} + {{if $.Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} {{else}} {{template "shared/user/authorlink" .Poster}} @@ -628,12 +628,12 @@ {{svg "octicon-lock"}} {{template "shared/user/avatarlink" .Poster}} {{if .Content}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}} {{else}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}} @@ -643,7 +643,7 @@
{{svg "octicon-key"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.unlock_comment" $createdStr | Safe}} @@ -652,7 +652,7 @@
{{svg "octicon-git-branch"}} {{template "shared/user/avatarlink" .Poster}} - + {{.Poster.Name}} {{$.locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} @@ -661,21 +661,21 @@
{{svg "octicon-clock"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{$.locale.Tr "repo.issues.del_time_history" $createdStr | Safe}}
{{svg "octicon-clock"}} - {{.Content}} + {{.Content}}
{{else if eq .Type 27}}
{{svg "octicon-eye"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if (gt .AssigneeID 0)}} {{if .RemovedAssignee}} @@ -699,7 +699,7 @@ {{else if and (eq .Type 29) (or (gt .CommitsNum 0) .IsForcePush)}}
{{svg "octicon-repo-push"}} - + {{template "shared/user/authorlink" .Poster}} {{if .IsForcePush}} {{$.locale.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}} @@ -716,7 +716,7 @@
{{svg "octicon-project"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if gt .OldProjectID 0}} {{if gt .ProjectID 0}} @@ -737,7 +737,7 @@ {{svg "octicon-x" 16}} - + {{template "shared/user/authorlink" .Poster}} {{$reviewerName := ""}} {{if eq .Review.OriginalAuthor ""}} @@ -752,7 +752,7 @@
- + {{$.locale.Tr "action.review_dismissed_reason"}}
@@ -773,7 +773,7 @@
{{svg "octicon-git-branch"}} {{template "shared/user/avatarlink" .Poster}} - + {{template "shared/user/authorlink" .Poster}} {{if and .OldRef .NewRef}} {{$.locale.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} @@ -787,7 +787,7 @@ {{else if or (eq .Type 34) (eq .Type 35)}}
{{svg "octicon-git-merge" 16}} - + {{template "shared/user/authorlink" .Poster}} {{if eq .Type 34}}{{$.locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr | Safe}} {{else}}{{$.locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr | Safe}}{{end}}