diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index d1ea8f8ed..c0e94d3b8 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3414,3 +3414,8 @@ runs.invalid_workflow_helper = Workflow config file is invalid. Please check you runs.no_matching_runner_helper = No matching runner: %s need_approval_desc = Need approval to run workflows for fork pull request. + +[projects] +type-1.display_name = Individual Project +type-2.display_name = Repository Project +type-3.display_name = Organization Project diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 116c02b8b..45077e91b 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -732,14 +732,22 @@ {{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/authorlink" .Poster}} - {{if gt .OldProjectID 0}} - {{if gt .ProjectID 0}} - {{$.locale.Tr "repo.issues.change_project_at" (.OldProject.Title|Escape) (.Project.Title|Escape) $createdStr | Safe}} - {{else}} - {{$.locale.Tr "repo.issues.remove_project_at" (.OldProject.Title|Escape) $createdStr | Safe}} - {{end}} + {{$oldProjectDisplayHtml := "Unknown Project"}} + {{if .OldProject}} + {{$trKey := printf "projects.type-%d.display_name" .OldProject.Type}} + {{$oldProjectDisplayHtml = printf `%s` ($.locale.Tr $trKey | Escape) (.OldProject.Title | Escape)}} + {{end}} + {{$newProjectDisplayHtml := "Unknown Project"}} + {{if .Project}} + {{$trKey := printf "projects.type-%d.display_name" .Project.Type}} + {{$newProjectDisplayHtml = printf `%s` ($.locale.Tr $trKey | Escape) (.Project.Title | Escape)}} + {{end}} + {{if and (gt .OldProjectID 0) (gt .ProjectID 0)}} + {{$.locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr | Safe}} + {{else if gt .OldProjectID 0}} + {{$.locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr | Safe}} {{else if gt .ProjectID 0}} - {{$.locale.Tr "repo.issues.add_project_at" (.Project.Title|Escape) $createdStr | Safe}} + {{$.locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr | Safe}} {{end}}