Skip to content

Commit 1848858

Browse files
GiteaBotsilverwind
andauthored
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: <img width="768" alt="Screenshot 2023-09-29 at 22 52 58" src="https://github.com/go-gitea/gitea/assets/115237/edda8b84-23cf-4a43-90ad-a892798f4e6c"> After: <img width="781" alt="Screenshot 2023-09-29 at 22 58 09" src="https://github.com/go-gitea/gitea/assets/115237/7097474d-efcf-4f22-a2ab-834a4e25c4e8"> Co-authored-by: silverwind <[email protected]>
1 parent a398089 commit 1848858

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

templates/user/dashboard/feeds.tmpl

+14-12
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,23 @@
7878
{{$reviewer := index .GetIssueInfos 1}}
7979
{{ctx.Locale.Tr "action.review_dismissed" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape) $reviewer | Str2html}}
8080
{{end}}
81+
{{TimeSince .GetCreate ctx.Locale}}
8182
</div>
8283
{{if .GetOpType.InActions "commit_repo" "mirror_sync_push"}}
8384
{{$push := ActionContent2Commits .}}
8485
{{$repoLink := (.GetRepoLink ctx)}}
85-
{{range $push.Commits}}
86-
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
87-
<div class="flex-text-block">
88-
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
89-
<a class="gt-mono" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
90-
<span class="text truncate light grey">
91-
{{RenderCommitMessage $.Context .Message $repoLink $.ComposeMetas}}
92-
</span>
93-
</div>
94-
{{end}}
86+
<div class="gt-df gt-fc gt-gap-2">
87+
{{range $push.Commits}}
88+
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
89+
<div class="flex-text-block">
90+
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
91+
<a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
92+
<span class="text truncate">
93+
{{RenderCommitMessage $.Context .Message $repoLink $.ComposeMetas}}
94+
</span>
95+
</div>
96+
{{end}}
97+
</div>
9598
{{if and (gt $push.Len 1) $push.CompareURL}}
9699
<a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{ctx.Locale.Tr "action.compare_commits" $push.Len}} »</a>
97100
{{end}}
@@ -103,7 +106,7 @@
103106
<a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</a>
104107
{{$comment := index .GetIssueInfos 1}}
105108
{{if gt (len $comment) 0}}
106-
<div class="flex-item-body">{{$comment | RenderEmoji $.Context | RenderCodeBlock}}</div>
109+
<div class="markup gt-font-14">{{RenderMarkdownToHtml ctx $comment}}</div>
107110
{{end}}
108111
{{else if .GetOpType.InActions "merge_pull_request"}}
109112
<div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div>
@@ -113,7 +116,6 @@
113116
<div class="flex-item-body text black">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div>
114117
<div class="flex-item-body text black">{{index .GetIssueInfos 2 | RenderEmoji $.Context}}</div>
115118
{{end}}
116-
<div class="flex-item-body">{{TimeSince .GetCreate ctx.Locale}}</div>
117119
</div>
118120
<div class="flex-item-trailing">
119121
{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey gt-mr-2"}}

web_src/css/shared/flex-list.css

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
}
7070

7171
.flex-item .flex-item-body {
72-
font-size: 13px;
7372
display: flex;
7473
align-items: center;
7574
flex-wrap: wrap;

0 commit comments

Comments
 (0)