From 1848858a1e85418b718c033c4fd03bdf63b7ff54 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 21 Oct 2023 19:13:15 +0800 Subject: [PATCH] Feed UI Improvements (#27356) (#27717) Backport #27356 by @silverwind Various improvements related to feeds: - Fix markdown rendering - Increase font size from 13px to default 14px via `flex-item` - Add style to hashes - Move the timestamp to title line. I realize it's not optimal for translation, we may need to change all these translations Before: Screenshot 2023-09-29 at 22 52 58 After: Screenshot 2023-09-29 at 22 58 09 Co-authored-by: silverwind --- templates/user/dashboard/feeds.tmpl | 26 ++++++++++++++------------ web_src/css/shared/flex-list.css | 1 - 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index f1aac9f385..c986dcfb44 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -78,20 +78,23 @@ {{$reviewer := index .GetIssueInfos 1}} {{ctx.Locale.Tr "action.review_dismissed" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape) $reviewer | Str2html}} {{end}} + {{TimeSince .GetCreate ctx.Locale}} {{if .GetOpType.InActions "commit_repo" "mirror_sync_push"}} {{$push := ActionContent2Commits .}} {{$repoLink := (.GetRepoLink ctx)}} - {{range $push.Commits}} - {{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}} -
- - {{ShortSha .Sha1}} - - {{RenderCommitMessage $.Context .Message $repoLink $.ComposeMetas}} - -
- {{end}} +
+ {{range $push.Commits}} + {{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}} +
+ + {{ShortSha .Sha1}} + + {{RenderCommitMessage $.Context .Message $repoLink $.ComposeMetas}} + +
+ {{end}} +
{{if and (gt $push.Len 1) $push.CompareURL}} {{ctx.Locale.Tr "action.compare_commits" $push.Len}} ยป {{end}} @@ -103,7 +106,7 @@ {{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}} {{$comment := index .GetIssueInfos 1}} {{if gt (len $comment) 0}} -
{{$comment | RenderEmoji $.Context | RenderCodeBlock}}
+
{{RenderMarkdownToHtml ctx $comment}}
{{end}} {{else if .GetOpType.InActions "merge_pull_request"}}
{{index .GetIssueInfos 1}}
@@ -113,7 +116,6 @@
{{ctx.Locale.Tr "action.review_dismissed_reason"}}
{{index .GetIssueInfos 2 | RenderEmoji $.Context}}
{{end}} -
{{TimeSince .GetCreate ctx.Locale}}
{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey gt-mr-2"}} diff --git a/web_src/css/shared/flex-list.css b/web_src/css/shared/flex-list.css index a7cfc8f163..93d8c9b49c 100644 --- a/web_src/css/shared/flex-list.css +++ b/web_src/css/shared/flex-list.css @@ -69,7 +69,6 @@ } .flex-item .flex-item-body { - font-size: 13px; display: flex; align-items: center; flex-wrap: wrap;