aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author65432021-03-06 06:13:38 +0100
committerGitHub2021-03-06 06:13:38 +0100
commit8e792986bb3e60abb087188fba3d02ba3d7e832b (patch)
tree79c600e47142a476a235077ad269b2962fb03edd
parentda80e90ac8b12e89be440bc45177230706c43920 (diff)
Fix a couple of issues with a feeds (#14897) (#14903)
Backport (#14897) witch fix couple of issues with feeds
-rw-r--r--modules/templates/helper.go5
-rw-r--r--templates/user/dashboard/feeds.tmpl3
2 files changed, 7 insertions, 1 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 63be27d98..cd6f28fa0 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 739caeba5..2748ea402 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -96,7 +96,8 @@
<span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji}}</span>
{{else if or (eq .GetOpType 10) (eq .GetOpType 21) (eq .GetOpType 22) (eq .GetOpType 23)}}
<a href="{{.GetCommentLink}}" class="text truncate issue title">{{.GetIssueTitle | RenderEmoji}}</a>
- <p class="text light grey">{{index .GetIssueInfos 1 | RenderEmoji}}</p>
+ {{$comment := index .GetIssueInfos 1}}
+ {{if gt (len $comment) 0}}<p class="text light grey">{{$comment | RenderEmoji}}</p>{{end}}
{{else if eq .GetOpType 11}}
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
{{else if or (eq .GetOpType 12) (eq .GetOpType 13) (eq .GetOpType 14) (eq .GetOpType 15)}}