File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed
templates/repo/issue/view_content Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,13 @@ type Project struct {
103103 ClosedDateUnix timeutil.TimeStamp
104104}
105105
106+ // Ghost Project is a project which has been deleted
107+ const GhostProjectID = - 1
108+
109+ func (p * Project ) IsGhost () bool {
110+ return p .ID == GhostProjectID
111+ }
112+
106113func (p * Project ) LoadOwner (ctx context.Context ) (err error ) {
107114 if p .Owner != nil {
108115 return nil
Original file line number Diff line number Diff line change @@ -3705,6 +3705,7 @@ variables.update.failed = Failed to edit variable.
37053705variables.update.success = The variable has been edited.
37063706
37073707[projects]
3708+ deleted.display_name = Deleted Project
37083709type-1.display_name = Individual Project
37093710type-2.display_name = Repository Project
37103711type-3.display_name = Organization Project
Original file line number Diff line number Diff line change @@ -1676,7 +1676,7 @@ func ViewIssue(ctx *context.Context) {
16761676 }
16771677
16781678 ghostProject := & project_model.Project {
1679- ID : - 1 ,
1679+ ID : project_model . GhostProjectID ,
16801680 Title : ctx .Locale .TrString ("repo.issues.deleted_project" ),
16811681 }
16821682
Original file line number Diff line number Diff line change 581581 {{template "shared/user/authorlink" .Poster}}
582582 {{$oldProjectDisplayHtml := "Unknown Project"}}
583583 {{if .OldProject}}
584- {{$trKey := printf "projects.type-%d.display_name" .OldProject.Type}}
585- {{$oldProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey) .OldProject.Title}}
584+ {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}}
585+ {{if not .OldProject.IsGhost}}
586+ {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .OldProject.Type)}}
587+ {{end}}
588+ {{$oldProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` $tooltip .OldProject.Title}}
586589 {{end}}
587590 {{$newProjectDisplayHtml := "Unknown Project"}}
588591 {{if .Project}}
589- {{$trKey := printf "projects.type-%d.display_name" .Project.Type}}
590- {{$newProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey) .Project.Title}}
592+ {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}}
593+ {{if not .Project.IsGhost}}
594+ {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .Project.Type)}}
595+ {{end}}
596+ {{$newProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` $tooltip .Project.Title}}
591597 {{end}}
592598 {{if and (gt .OldProjectID 0) (gt .ProjectID 0)}}
593599 {{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr}}
You can’t perform that action at this time.
0 commit comments