diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 63be27d987..cd6f28fa0e 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -689,6 +689,11 @@ func ActionIcon(opType models.ActionType) string { // ActionContent2Commits converts action content to push commits func ActionContent2Commits(act Actioner) *repository.PushCommits { push := repository.NewPushCommits() + + if act == nil || act.GetContent() == "" { + return push + } + if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil { log.Error("json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err) } diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 739caeba5f..2748ea4022 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -96,7 +96,8 @@ {{index .GetIssueInfos 1 | RenderEmoji}} {{else if or (eq .GetOpType 10) (eq .GetOpType 21) (eq .GetOpType 22) (eq .GetOpType 23)}} {{.GetIssueTitle | RenderEmoji}} -
{{index .GetIssueInfos 1 | RenderEmoji}}
+ {{$comment := index .GetIssueInfos 1}} + {{if gt (len $comment) 0}}{{$comment | RenderEmoji}}
{{end}} {{else if eq .GetOpType 11}}{{index .GetIssueInfos 1}}
{{else if or (eq .GetOpType 12) (eq .GetOpType 13) (eq .GetOpType 14) (eq .GetOpType 15)}}