Refactor frontend tw-justify-between layouts to flex-left-right (#37291)
This PR standardizes left/right two-child frontend layouts on `flex-left-right` and removes ad-hoc `tw-justify-between` combinations. The goal is consistent wrapping + spacing behavior under narrow widths with less utility-class churn. Also: remove useless "flex-center-wrap", slightly improve some templates (no visual change, tested) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-container-main">
|
||||
<div class="ui top attached header flex-text-block tw-flex-wrap tw-justify-between">
|
||||
<div class="ui top attached header flex-left-right">
|
||||
<strong>{{ctx.Locale.TrN .Page.Paginater.Total "actions.runs.workflow_run_count_1" "actions.runs.workflow_run_count_n" .Page.Paginater.Total}}</strong>
|
||||
<div class="ui secondary filter menu flex-text-block tw-m-0">
|
||||
<!-- Actor -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{/* "z-index" is used to maintain continuous attached styling and keep the colored border-bottom visible (pre-existing fomantic issue with negative margins) */}}
|
||||
<div class="ui blue info attached message flex-text-block tw-flex-wrap tw-justify-between tw-z-1">
|
||||
<div class="ui blue info attached message flex-left-right tw-z-1">
|
||||
<span>{{ctx.Locale.Tr "actions.workflow.has_workflow_dispatch"}}</span>
|
||||
<div class="flex-text-block tw-bg-box-body tw-rounded">{{/*make the button have correct hovered color */}}
|
||||
<button class="ui mini button show-modal" data-modal="#runWorkflowDispatchModal">{{ctx.Locale.Tr "actions.workflow.run"}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}</button>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div class="{{TabSizeClass .Editorconfig .FileTreePath}} non-diff-file-content">
|
||||
<h4 class="file-header ui top attached header tw-flex tw-items-center tw-justify-between tw-flex-wrap">
|
||||
<h4 class="file-header ui top attached header flex-left-right">
|
||||
<div class="file-header-left tw-flex tw-items-center tw-py-2 tw-pr-4">
|
||||
{{template "repo/file_info" .}}
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<h4 class="ui top attached header tw-flex tw-items-center tw-justify-between">
|
||||
<h4 class="ui top attached header">
|
||||
<div class="flex-text-block">
|
||||
{{ctx.Locale.Tr "repo.branches"}}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h4 class="ui top attached header commits-table tw-flex tw-items-center tw-justify-between">
|
||||
<h4 class="ui top attached header commits-table flex-left-right">
|
||||
<div class="commits-table-left flex-text-block">
|
||||
{{if or .PageIsCommits (gt .CommitCount 0)}}
|
||||
{{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}}
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
{{if .Diff.IsIncomplete}}
|
||||
<div class="diff-file-box file-content tw-mt-2" id="diff-incomplete">
|
||||
<h4 class="ui top attached header tw-font-normal tw-flex tw-items-center tw-justify-between">
|
||||
<h4 class="ui top attached header tw-font-normal flex-left-right">
|
||||
{{ctx.Locale.Tr "repo.diff.too_many_files"}}
|
||||
<a class="ui basic tiny button" id="diff-show-more-files" data-href="?skip-to={{.Diff.End}}&file-only=true">{{ctx.Locale.Tr "repo.diff.show_more"}}</a>
|
||||
</h4>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{{if not .NotEditableReason}}
|
||||
<div class="field">
|
||||
<div class="ui top attached header">
|
||||
<div class="flex-text-block tw-justify-between tw-flex-wrap">
|
||||
<div class="flex-left-right">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu" data-repo-link="{{.RepoLink}}" data-ref-sub-url="{{.RefTypeNameSubURL}}" data-branch-name="{{.BranchName}}">
|
||||
<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
|
||||
<a class="item {{if not .CodeEditorConfig.Previewable}}tw-hidden{{end}}" data-tab="preview">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui top attached header">
|
||||
<div class="flex-text-block tw-justify-between tw-flex-wrap">
|
||||
<div class="flex-left-right">
|
||||
<div class="ui compact small menu small-menu-items repo-editor-menu">
|
||||
<a class="active item" data-tab="write">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
|
||||
</div>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
{{$previousExclusiveScope = $exclusiveScope}}
|
||||
<div class="item issue-action tw-flex tw-justify-between" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
|
||||
<div class="item issue-action flex-left-right" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
|
||||
{{if SliceUtils.Contains $.SelLabelIDs .ID}}{{svg (Iif $exclusiveScope "octicon-dot-fill" "octicon-check")}}{{end}} {{ctx.RenderUtils.RenderLabel .}}
|
||||
{{template "repo/issue/labels/label_archived" .}}
|
||||
</div>
|
||||
@@ -125,4 +125,3 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span>
|
||||
<div class="ui form tw-mt-2">
|
||||
{{if .Issue.DeadlineUnix}}
|
||||
<div class="tw-flex tw-justify-between tw-items-center tw-gap-2">
|
||||
<div class="flex-left-right">
|
||||
<div class="due-date {{if .Issue.IsOverdue}}tw-text-red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}>
|
||||
{{svg "octicon-calendar"}} {{DateUtils.AbsoluteLong .Issue.DeadlineUnix}}
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</span>
|
||||
<div class="ui divided list">
|
||||
{{range .BlockingDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<a class="muted issue-dependency-title gt-ellipsis" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .BlockingDependenciesNotPermitted}}
|
||||
<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
|
||||
<div class="item gt-ellipsis">
|
||||
<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -54,7 +54,7 @@
|
||||
</span>
|
||||
<div class="ui divided list">
|
||||
{{range .BlockedByDependencies}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<a class="muted issue-dependency-title gt-ellipsis" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | ctx.RenderUtils.RenderEmoji}}
|
||||
@@ -76,7 +76,7 @@
|
||||
{{end}}
|
||||
{{if $.CanCreateIssueDependencies}}
|
||||
{{range .BlockedByDependenciesNotPermitted}}
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} tw-flex tw-items-center tw-justify-between">
|
||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} flex-left-right">
|
||||
<div class="item-left tw-flex tw-justify-center tw-flex-col tw-flex-1 gt-ellipsis">
|
||||
<div class="gt-ellipsis">
|
||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{else if .BlockedByDependenciesNotPermitted}}
|
||||
<div class="item tw-flex tw-items-center tw-justify-between gt-ellipsis">
|
||||
<div class="item gt-ellipsis">
|
||||
<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -11,7 +11,7 @@ The variables in "ctx.Data" are different in each case, making this template fra
|
||||
{{$hasReview := and $comment.Review}}
|
||||
{{$isReviewPending := and $hasReview (eq $comment.Review.Type 0)}}
|
||||
<div class="ui segments conversation-holder">
|
||||
<div class="ui segment collapsible-comment-box tw-py-2 tw-flex tw-items-center tw-justify-between">
|
||||
<div class="ui segment collapsible-comment-box tw-py-2 flex-left-right">
|
||||
<div class="tw-flex tw-items-center">
|
||||
<a href="{{$comment.CodeCommentLink ctx}}" class="file-comment tw-ml-2 tw-break-anywhere">{{$comment.TreePath}}</a>
|
||||
{{if $invalid}}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
|
||||
{{if and $statusCheckData $statusCheckData.RequireApprovalRunCount}}
|
||||
<div class="ui attached segment flex-text-block tw-justify-between" id="approve-status-checks">
|
||||
<div class="ui attached segment flex-left-right" id="approve-status-checks">
|
||||
<div>
|
||||
<strong>
|
||||
{{ctx.Locale.Tr "repo.pulls.status_checks_need_approvals" $statusCheckData.RequireApprovalRunCount}}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="ui segment detail">
|
||||
<div class="tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-mb-2">
|
||||
<div class="flex-left-right tw-mb-2">
|
||||
<h4 class="release-list-title tw-break-anywhere">
|
||||
{{if $.PageIsSingleTag}}{{$release.Title}}{{else}}<a class="muted" href="{{$.RepoLink}}/releases/tag/{{$release.TagName | PathEscapeSegments}}">{{$release.Title}}</a>{{end}}
|
||||
{{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit githook")}}
|
||||
<div class="repo-setting-content">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<h4 class="ui top attached header flex-text-block tw-justify-between tw-flex-wrap">
|
||||
<h4 class="ui top attached header flex-left-right">
|
||||
{{.Hook.Name}}
|
||||
<div class="tw-font-normal tw-font-sans tw-text-base">
|
||||
{{template "repo/editor/options" dict "CodeEditorConfig" $.CodeEditorConfig}}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="ui list">
|
||||
{{range .History}}
|
||||
<div class="item">
|
||||
<div class="flex-text-block tw-justify-between">
|
||||
<div class="flex-left-right">
|
||||
<div class="flex-text-inline">
|
||||
{{if .IsSucceed}}
|
||||
<span class="tw-text-green">{{svg "octicon-check"}}</span>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{end}}
|
||||
|
||||
{{if not .ReadmeInList}}
|
||||
<div id="repo-file-commit-box" class="ui segment list-header tw-mb-4 tw-flex tw-justify-between">
|
||||
<div id="repo-file-commit-box" class="ui segment list-header tw-mb-4 flex-left-right">
|
||||
{{template "repo/latest_commit" .}}
|
||||
{{if .LatestCommit}}
|
||||
{{if .LatestCommit.Committer}}
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<h4 class="file-header ui top attached header tw-flex tw-items-center tw-justify-between tw-flex-wrap">
|
||||
<h4 class="file-header ui top attached header flex-left-right">
|
||||
<div class="file-header-left tw-flex tw-items-center tw-py-2 tw-pr-4">
|
||||
{{if .ReadmeInList}}
|
||||
{{svg "octicon-book" 16 "tw-mr-2"}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<div class="ui header flex-text-block tw-justify-between">
|
||||
<div class="ui header flex-left-right">
|
||||
{{ctx.Locale.Tr "repo.wiki.new_page"}}
|
||||
{{if .PageIsWikiEdit}}
|
||||
<a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content repository wiki pages">
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
<h2 class="ui header tw-flex tw-items-center tw-justify-between">
|
||||
<h2 class="ui header flex-left-right">
|
||||
<span>{{ctx.Locale.Tr "repo.wiki.pages"}}</span>
|
||||
<span>
|
||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{template "repo/header" .}}
|
||||
{{$title := .title}}
|
||||
<div class="ui container">
|
||||
<div class="ui dividing header flex-text-block tw-flex-wrap tw-justify-between">
|
||||
<div class="ui dividing header flex-left-right">
|
||||
<div class="flex-text-block">
|
||||
<a class="ui basic button tw-px-3" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}">{{svg "octicon-home"}}</a>
|
||||
<div class="tw-flex-1 gt-ellipsis">
|
||||
|
||||
Reference in New Issue
Block a user