Skip to content
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

Add wrapper to author to avoid long name ui problem #23030

Merged
merged 15 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions templates/repo/view_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
{{if .LatestCommitUser}}
{{avatar $.Context .LatestCommitUser 24}}
{{if .LatestCommitUser.FullName}}
<a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
<span class="author-wrapper" title="{{.LatestCommitUser.FullName}}"><a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put these styles and title on <a> directly?

Copy link
Contributor Author

@HesterG HesterG Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put these styles and title on <a> directly?

Yes that is better putting them directly on <a> tag here. Changed that.

{{else}}
<a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
<span class="author-wrapper" title="{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}"><a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a></span>
{{end}}
{{else}}
{{if .LatestCommit.Author}}
{{avatarByEmail $.Context .LatestCommit.Author.Email .LatestCommit.Author.Name 24}}
<strong>{{.LatestCommit.Author.Name}}</strong>
<span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span>
{{end}}
{{end}}
<a rel="nofollow" class="ui sha label {{if .LatestCommit.Signature}} isSigned {{if .LatestCommitVerification.Verified}} isVerified{{if eq .LatestCommitVerification.TrustStatus "trusted"}}{{else if eq .LatestCommitVerification.TrustStatus "untrusted"}}Untrusted{{else}}Unmatched{{end}}{{else if .LatestCommitVerification.Warning}} isWarning{{end}}{{end}}" href="{{.RepoLink}}/commit/{{PathEscape .LatestCommit.ID.String}}">
Expand Down
10 changes: 9 additions & 1 deletion web_src/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -2914,14 +2914,18 @@ tbody.commit-list {
vertical-align: baseline;
}

.message-wrapper {
.message-wrapper, .author-wrapper {
overflow: hidden;
text-overflow: ellipsis;
max-width: calc(100% - 50px);
display: inline-block;
vertical-align: middle;
}

.author-wrapper {
max-width: 200px;
}

// in the commit list, messages can wrap so we can use inline
.commit-list .message-wrapper {
display: inline;
Expand All @@ -2941,6 +2945,10 @@ tbody.commit-list {
display: block;
max-width: calc(100vw - 70px);
}

.author-wrapper {
max-width: 100px;
}
}

@media @mediaMd {
Expand Down