From 8885108c42fd2811c1bd7371adf57940e6d1d208 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 21 Oct 2023 18:29:06 +0800 Subject: [PATCH] Improve feed icons and feed merge text color (#27498) (#27716) Backport #27498 by @silverwind 1. Improve various feed icons 2. Fix merge message color image image Fixes: https://github.com/go-gitea/gitea/issues/27495 Continues: https://github.com/go-gitea/gitea/pull/27356 Co-authored-by: silverwind --- modules/templates/util_misc.go | 24 ++++++++++++++---------- templates/user/dashboard/feeds.tmpl | 6 +++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/modules/templates/util_misc.go b/modules/templates/util_misc.go index fe02e4b0c3..6c1b4ab240 100644 --- a/modules/templates/util_misc.go +++ b/modules/templates/util_misc.go @@ -74,27 +74,31 @@ func ActionIcon(opType activities_model.ActionType) string { switch opType { case activities_model.ActionCreateRepo, activities_model.ActionTransferRepo, activities_model.ActionRenameRepo: return "repo" - case activities_model.ActionCommitRepo, activities_model.ActionPushTag, activities_model.ActionDeleteTag, activities_model.ActionDeleteBranch: + case activities_model.ActionCommitRepo: return "git-commit" - case activities_model.ActionCreateIssue: - return "issue-opened" - case activities_model.ActionCreatePullRequest: - return "git-pull-request" - case activities_model.ActionCommentIssue, activities_model.ActionCommentPull: - return "comment-discussion" + case activities_model.ActionDeleteBranch: + return "git-branch" case activities_model.ActionMergePullRequest, activities_model.ActionAutoMergePullRequest: return "git-merge" - case activities_model.ActionCloseIssue, activities_model.ActionClosePullRequest: + case activities_model.ActionCreatePullRequest: + return "git-pull-request" + case activities_model.ActionClosePullRequest: + return "git-pull-request-closed" + case activities_model.ActionCreateIssue: + return "issue-opened" + case activities_model.ActionCloseIssue: return "issue-closed" case activities_model.ActionReopenIssue, activities_model.ActionReopenPullRequest: return "issue-reopened" + case activities_model.ActionCommentIssue, activities_model.ActionCommentPull: + return "comment-discussion" case activities_model.ActionMirrorSyncPush, activities_model.ActionMirrorSyncCreate, activities_model.ActionMirrorSyncDelete: return "mirror" case activities_model.ActionApprovePullRequest: return "check" case activities_model.ActionRejectPullRequest: - return "diff" - case activities_model.ActionPublishRelease: + return "file-diff" + case activities_model.ActionPublishRelease, activities_model.ActionPushTag, activities_model.ActionDeleteTag: return "tag" case activities_model.ActionPullReviewDismissed: return "x" diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index f3b935ec55..f1aac9f385 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -106,12 +106,12 @@
{{$comment | RenderEmoji $.Context | RenderCodeBlock}}
{{end}} {{else if .GetOpType.InActions "merge_pull_request"}} -
{{index .GetIssueInfos 1}}
+
{{index .GetIssueInfos 1}}
{{else if .GetOpType.InActions "close_issue" "reopen_issue" "close_pull_request" "reopen_pull_request"}} {{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}} {{else if .GetOpType.InActions "pull_review_dismissed"}} -
{{ctx.Locale.Tr "action.review_dismissed_reason"}}
-
{{index .GetIssueInfos 2 | RenderEmoji $.Context}}
+
{{ctx.Locale.Tr "action.review_dismissed_reason"}}
+
{{index .GetIssueInfos 2 | RenderEmoji $.Context}}
{{end}}
{{TimeSince .GetCreate ctx.Locale}}