Skip to content

More improvements for the "flex list" and the dashboard list #26675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/devtest/flex-list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</div>
<div class="flex-item-body">
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong content
<span class="text truncate">Truncate very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong content</span>
</div>
</div>
<div class="flex-item-trailing">
Expand Down
34 changes: 15 additions & 19 deletions templates/user/dashboard/feeds.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,21 @@
{{end}}
</div>
{{if or (eq .GetOpType 5) (eq .GetOpType 18)}}
<div class="gt-pl-5">
{{$push := ActionContent2Commits .}}
{{$repoLink := .GetRepoLink}}
{{range $push.Commits}}
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
<div class="flex-item">
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
<a class="commit-id" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
<span class="text truncate light grey">
{{RenderCommitMessage $.Context .Message $repoLink $.ComposeMetas}}
</span>
</div>
{{end}}
{{if and (gt $push.Len 1) $push.CompareURL}}
<div class="flex-item">
<a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.locale.Tr "action.compare_commits" $push.Len}} »</a>
</div>
{{end}}
</div>
{{$push := ActionContent2Commits .}}
{{$repoLink := .GetRepoLink}}
{{range $push.Commits}}
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
<div class="flex-text-block">
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
<a class="gt-mono" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
<span class="text truncate light grey">
{{RenderCommitMessage $.Context .Message $repoLink $.ComposeMetas}}
</span>
</div>
{{end}}
{{if and (gt $push.Len 1) $push.CompareURL}}
<a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.locale.Tr "action.compare_commits" $push.Len}} »</a>
{{end}}
{{else if eq .GetOpType 6}}
<span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span>
{{else if eq .GetOpType 7}}
Expand Down
4 changes: 0 additions & 4 deletions web_src/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@
}
}

.feeds .commit-id {
font-family: var(--fonts-monospace);
}

.feeds code {
padding: 2px 4px;
border-radius: 3px;
Expand Down
4 changes: 3 additions & 1 deletion web_src/css/shared/flex-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
display: flex;
flex-direction: column;
flex-grow: 1;
flex-basis: 60%;
flex-basis: 60%; /* avoid wrapping the "flex-item-trailing" too aggressively */
min-width: 0; /* make the "text truncate" work, otherwise the flex axis is not limited and the text just overflows */
}

.flex-item-header {
Expand Down Expand Up @@ -66,6 +67,7 @@
font-size: 16px;
font-weight: var(--font-weight-semibold);
word-break: break-word;
min-width: 0;
}

.flex-item .flex-item-title a {
Expand Down