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 @@ -109,6 +109,13 @@ type Project struct {
109
109
ClosedDateUnix timeutil.TimeStamp
110
110
}
111
111
112
+ // Ghost Project is a project which has been deleted
113
+ const GhostProjectID = - 1
114
+
115
+ func (p * Project ) IsGhost () bool {
116
+ return p .ID == GhostProjectID
117
+ }
118
+
112
119
func (p * Project ) LoadOwner (ctx context.Context ) (err error ) {
113
120
if p .Owner != nil {
114
121
return nil
Original file line number Diff line number Diff line change @@ -3675,6 +3675,7 @@ variables.update.failed = Failed to edit variable.
3675
3675
variables.update.success = The variable has been edited.
3676
3676
3677
3677
[projects]
3678
+ deleted.display_name = Deleted Project
3678
3679
type-1.display_name = Individual Project
3679
3680
type-2.display_name = Repository Project
3680
3681
type-3.display_name = Organization Project
Original file line number Diff line number Diff line change @@ -1669,7 +1669,7 @@ func ViewIssue(ctx *context.Context) {
1669
1669
}
1670
1670
1671
1671
ghostProject := & project_model.Project {
1672
- ID : - 1 ,
1672
+ ID : project_model . GhostProjectID ,
1673
1673
Title : ctx .Locale .TrString ("repo.issues.deleted_project" ),
1674
1674
}
1675
1675
Original file line number Diff line number Diff line change 582
582
{{template "shared/user/authorlink" .Poster}}
583
583
{{$oldProjectDisplayHtml := "Unknown Project"}}
584
584
{{if .OldProject}}
585
- {{$trKey := printf "projects.type-%d.display_name" .OldProject.Type}}
586
- {{$oldProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey) .OldProject.Title}}
585
+ {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}}
586
+ {{if not .OldProject.IsGhost}}
587
+ {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .OldProject.Type)}}
588
+ {{end}}
589
+ {{$oldProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` $tooltip .OldProject.Title}}
587
590
{{end}}
588
591
{{$newProjectDisplayHtml := "Unknown Project"}}
589
592
{{if .Project}}
590
- {{$trKey := printf "projects.type-%d.display_name" .Project.Type}}
591
- {{$newProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey) .Project.Title}}
593
+ {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}}
594
+ {{if not .Project.IsGhost}}
595
+ {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .Project.Type)}}
596
+ {{end}}
597
+ {{$newProjectDisplayHtml = HTMLFormat `<span data-tooltip-content="%s">%s</span>` $tooltip .Project.Title}}
592
598
{{end}}
593
599
{{if and (gt .OldProjectID 0) (gt .ProjectID 0)}}
594
600
{{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr}}
You can’t perform that action at this time.
0 commit comments