Skip to content

Commit

Permalink
fix toggle commit body button ui when latest commit message is long (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
metiftikci and wxiaoguang authored Dec 29, 2024
1 parent a92f505 commit 94048f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions templates/repo/commit_statuses.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{if .Statuses}}
{{if and (eq (len .Statuses) 1) .Status.TargetURL}}
<a class="tw-align-middle {{.AdditionalClasses}} tw-no-underline" data-tippy="commit-statuses" href="{{.Status.TargetURL}}">
<a class="flex-text-inline tw-no-underline {{.AdditionalClasses}}" data-tippy="commit-statuses" href="{{.Status.TargetURL}}">
{{template "repo/commit_status" .Status}}
</a>
{{else}}
<span class="tw-align-middle {{.AdditionalClasses}}" data-tippy="commit-statuses" tabindex="0">
<span class="flex-text-inline {{.AdditionalClasses}}" data-tippy="commit-statuses" tabindex="0">
{{template "repo/commit_status" .Status}}
</span>
{{end}}
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/latest_commit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
{{else}}
{{if .LatestCommitUser}}
{{ctx.AvatarUtils.Avatar .LatestCommitUser 24 "tw-mr-1"}}
{{ctx.AvatarUtils.Avatar .LatestCommitUser 24}}
{{if and .LatestCommitUser.FullName DefaultShowFullName}}
<a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
{{else}}
<a class="muted author-wrapper" title="{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
{{end}}
{{else}}
{{if .LatestCommit.Author}}
{{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24 "tw-mr-1"}}
{{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24}}
<span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span>
{{end}}
{{end}}
Expand Down
10 changes: 10 additions & 0 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ td .commit-summary {
gap: 0.25em;
}

@media (max-width: 767.98px) {
.latest-commit .commit-id-short {
display: none;
}
}

.repo-path {
display: flex;
overflow-wrap: anywhere;
Expand Down Expand Up @@ -1670,6 +1676,10 @@ tbody.commit-list {
white-space: nowrap;
}

.latest-commit .message-wrapper {
max-width: calc(100% - 2.5rem);
}

/* in the commit list, messages can wrap so we can use inline */
.commit-list .message-wrapper {
display: inline;
Expand Down

0 comments on commit 94048f3

Please sign in to comment.