File tree 4 files changed +19
-5
lines changed
templates/repo/issue/view_content 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,13 @@ type Project struct {
103
103
ClosedDateUnix timeutil.TimeStamp
104
104
}
105
105
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
+
106
113
func (p * Project ) LoadOwner (ctx context.Context ) (err error ) {
107
114
if p .Owner != nil {
108
115
return nil
Original file line number Diff line number Diff line change @@ -3705,6 +3705,7 @@ variables.update.failed = Failed to edit variable.
3705
3705
variables.update.success = The variable has been edited.
3706
3706
3707
3707
[projects]
3708
+ deleted.display_name = Deleted Project
3708
3709
type-1.display_name = Individual Project
3709
3710
type-2.display_name = Repository Project
3710
3711
type-3.display_name = Organization Project
Original file line number Diff line number Diff line change @@ -1676,7 +1676,7 @@ func ViewIssue(ctx *context.Context) {
1676
1676
}
1677
1677
1678
1678
ghostProject := & project_model.Project {
1679
- ID : - 1 ,
1679
+ ID : project_model . GhostProjectID ,
1680
1680
Title : ctx .Locale .TrString ("repo.issues.deleted_project" ),
1681
1681
}
1682
1682
Original file line number Diff line number Diff line change 581
581
{{template "shared/user/authorlink" .Poster}}
582
582
{{$oldProjectDisplayHtml := "Unknown Project"}}
583
583
{{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}}
586
589
{{end}}
587
590
{{$newProjectDisplayHtml := "Unknown Project"}}
588
591
{{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}}
591
597
{{end}}
592
598
{{if and (gt .OldProjectID 0) (gt .ProjectID 0)}}
593
599
{{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr}}
You can’t perform that action at this time.
0 commit comments