Skip to content

Commit 311f526

Browse files
silverwindGiteaBot
andauthored
Fix and tweak pull request commit list (#30528)
Fixes #30493, regression from #30374. Also did the flexbox convertion as suggested by the existing comment. <img width="850" alt="Screenshot 2024-04-16 at 22 28 48" src="https://github.com/go-gitea/gitea/assets/115237/e8905944-620a-4211-b5c5-53ed3b3ee23e"> Co-authored-by: Giteabot <[email protected]>
1 parent 3e2e76e commit 311f526

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

templates/repo/commits_list_small.tmpl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,23 @@
66
<div class="singular-commit" id="{{$tag}}">
77
<span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
88
{{if .User}}
9-
<a class="avatar" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User}}</a>
9+
<a class="avatar" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User 20}}</a>
1010
{{else}}
11-
{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name}}
11+
{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 20}}
1212
{{end}}
1313

1414
{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}
1515

16-
<span class="shabox tw-flex tw-items-center tw-float-right">
16+
<span class="tw-flex-1 gt-ellipsis tw-font-mono{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</span>
17+
18+
{{if IsMultilineCommitMessage .Message}}
19+
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
20+
{{end}}
21+
{{if IsMultilineCommitMessage .Message}}
22+
<pre class="commit-body tw-hidden">{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</pre>
23+
{{end}}
24+
25+
<span class="shabox tw-flex tw-items-center">
1726
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
1827
{{$class := "ui sha label"}}
1928
{{if .Signature}}
@@ -37,14 +46,6 @@
3746
{{end}}
3847
</a>
3948
</span>
40-
41-
<span class="tw-font-mono commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</span>
42-
{{if IsMultilineCommitMessage .Message}}
43-
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
44-
{{end}}
45-
{{if IsMultilineCommitMessage .Message}}
46-
<pre class="commit-body tw-hidden">{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}</pre>
47-
{{end}}
4849
</div>
4950
{{end}}
5051
</div>

web_src/css/repo.css

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -832,55 +832,53 @@ td .commit-summary {
832832
margin-right: 0.25em;
833833
}
834834

835-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit {
836-
line-height: 34px; /* this must be same as .badge height, to avoid overflow */
837-
clear: both; /* reset the "float right shabox", in the future, use flexbox instead */
835+
.singular-commit {
836+
display: flex;
837+
align-items: center;
838838
}
839839

840-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit > img.avatar,
841-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit > .avatar img {
842-
position: relative;
843-
top: -2px;
840+
.singular-commit .badge {
841+
height: 30px !important;
844842
}
845843

846-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label {
844+
.singular-commit .shabox .sha.label {
847845
margin: 0;
848846
border: 1px solid var(--color-light-border);
849847
}
850848

851-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isWarning {
849+
.singular-commit .shabox .sha.label.isSigned.isWarning {
852850
border: 1px solid var(--color-red-badge);
853851
background: var(--color-red-badge-bg);
854852
}
855853

856-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isWarning:hover {
854+
.singular-commit .shabox .sha.label.isSigned.isWarning:hover {
857855
background: var(--color-red-badge-hover-bg) !important;
858856
}
859857

860-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isVerified {
858+
.singular-commit .shabox .sha.label.isSigned.isVerified {
861859
border: 1px solid var(--color-green-badge);
862860
background: var(--color-green-badge-bg);
863861
}
864862

865-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isVerified:hover {
863+
.singular-commit .shabox .sha.label.isSigned.isVerified:hover {
866864
background: var(--color-green-badge-hover-bg) !important;
867865
}
868866

869-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isVerifiedUntrusted {
867+
.singular-commit .shabox .sha.label.isSigned.isVerifiedUntrusted {
870868
border: 1px solid var(--color-yellow-badge);
871869
background: var(--color-yellow-badge-bg);
872870
}
873871

874-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isVerifiedUntrusted:hover {
872+
.singular-commit .shabox .sha.label.isSigned.isVerifiedUntrusted:hover {
875873
background: var(--color-yellow-badge-hover-bg) !important;
876874
}
877875

878-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isVerifiedUnmatched {
876+
.singular-commit .shabox .sha.label.isSigned.isVerifiedUnmatched {
879877
border: 1px solid var(--color-orange-badge);
880878
background: var(--color-orange-badge-bg);
881879
}
882880

883-
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit .shabox .sha.label.isSigned.isVerifiedUnmatched:hover {
881+
.singular-commit .shabox .sha.label.isSigned.isVerifiedUnmatched:hover {
884882
background: var(--color-orange-badge-hover-bg) !important;
885883
}
886884

0 commit comments

Comments
 (0)