1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 09:55:20 +02:00

fix(ui): improve force-push compare line layout (#7746)

On large screens, use grid to force right position of the button.

On small screens, just left it hang out wherever it fits. It's not possible to not make it hide behind mergebox while keeping `float`, and with grid it would overflow too much.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7746
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
(cherry picked from commit 0383e2e15a)
This commit is contained in:
0ko 2025-05-14 23:13:50 +00:00 committed by forgejo-backport-action
parent 738ec94b8f
commit fe55ddcdaf
2 changed files with 18 additions and 12 deletions

View file

@ -549,18 +549,21 @@
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-repo-push"}}</span> <span class="badge">{{svg "octicon-repo-push"}}</span>
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}}
{{if .IsForcePush}} {{if .IsForcePush}}
{{ctx.Locale.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr "ui sha"}} <span class="forced-push">
<span>
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr "ui sha"}}
</span>
{{if $.Issue.PullRequest.BaseRepo.Name}}
<a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{ctx.Locale.Tr "repo.issues.force_push_compare"}}</a>
{{end}}
</span>
{{else}} {{else}}
{{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr}} {{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr}}
{{end}} {{end}}
</span> </span>
{{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}}
<span class="tw-float-right comparebox">
<a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{ctx.Locale.Tr "repo.issues.force_push_compare"}}</a>
</span>
{{end}}
</div> </div>
{{if not .IsForcePush}} {{if not .IsForcePush}}
{{template "repo/commits_list_small" dict "comment" . "root" $}} {{template "repo/commits_list_small" dict "comment" . "root" $}}

View file

@ -904,15 +904,18 @@ td .commit-summary {
background: var(--color-orange-badge-hover-bg) !important; background: var(--color-orange-badge-hover-bg) !important;
} }
.repository.view.issue .comment-list .timeline-item .comparebox { @media (min-width: 768px) {
line-height: 32px; .repository.view.issue .comment-list .timeline-item .forced-push {
vertical-align: middle; display: grid;
grid-auto-flow: column;
column-gap: 1rem;
}
} }
.repository.view.issue .comment-list .timeline-item .comparebox .compare.label { .repository.view.issue .comment-list .timeline-item .compare.label {
font-size: 1rem; font-size: 1rem;
margin: 0;
border: 1px solid var(--color-light-border); border: 1px solid var(--color-light-border);
height: fit-content;
} }
@media (max-width: 767.98px) { @media (max-width: 767.98px) {