From 83f571628d186d8b865707c3c7b22de8bd530c4c Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 30 Sep 2023 17:48:34 +0200 Subject: [PATCH] Feed UI Improvements (#27356) 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 --- 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 eb1b503a1..876a245fe 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 a7cfc8f16..93d8c9b49 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;