mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-30 22:11:07 +00: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>
This commit is contained in:
		
					parent
					
						
							
								2c9f272d42
							
						
					
				
			
			
				commit
				
					
						0383e2e15a
					
				
			
		
					 2 changed files with 18 additions and 12 deletions
				
			
		|  | @ -549,18 +549,21 @@ | |||
| 			<div class="timeline-item event" id="{{.HashTag}}"> | ||||
| 				<span class="badge">{{svg "octicon-repo-push"}}</span> | ||||
| 				<span class="text grey muted-links"> | ||||
| 					{{template "shared/user/authorlink" .Poster}} | ||||
| 					{{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}} | ||||
| 						{{template "shared/user/authorlink" .Poster}} | ||||
| 						{{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr}} | ||||
| 					{{end}} | ||||
| 				</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> | ||||
| 			{{if not .IsForcePush}} | ||||
| 				{{template "repo/commits_list_small" dict "comment" . "root" $}} | ||||
|  |  | |||
|  | @ -904,15 +904,18 @@ td .commit-summary { | |||
|   background: var(--color-orange-badge-hover-bg) !important; | ||||
| } | ||||
| 
 | ||||
| .repository.view.issue .comment-list .timeline-item .comparebox { | ||||
|   line-height: 32px; | ||||
|   vertical-align: middle; | ||||
| @media (min-width: 768px) { | ||||
|   .repository.view.issue .comment-list .timeline-item .forced-push { | ||||
|     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; | ||||
|   margin: 0; | ||||
|   border: 1px solid var(--color-light-border); | ||||
|   height: fit-content; | ||||
| } | ||||
| 
 | ||||
| @media (max-width: 767.98px) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue