Skip to content

Commit c986718

Browse files
authored
Fix repo home row-right grow (#32763)
Fix #32753
1 parent 23471e1 commit c986718

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Diff for: templates/repo/home.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
{{end}}
103103
</div>
104104

105-
<div class="repo-button-row-right">
105+
{{/* by default, the row-right flex grows, but on non-root tree path, it should not because the row-left might contain a long path */}}
106+
<div class="repo-button-row-right {{if not $isTreePathRoot}}tw-flex-grow-0{{end}}">
106107
<!-- Only show clone panel in repository home page -->
107108
{{if $isTreePathRoot}}
108109
<div class="clone-panel ui action tiny input">
@@ -122,7 +123,6 @@
122123
</button>
123124
{{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}}
124125
</div>
125-
{{template "repo/cite/cite_modal" .}}
126126
{{end}}
127127
{{if and (not $isTreePathRoot) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}}
128128
<a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">

Diff for: templates/repo/home_sidebar_top.tmpl

+7-6
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,23 @@
4343
{{end}}
4444
{{if .ReadmeExist}}
4545
<div class="flex-item-body tw-mt-2">
46-
<a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.TreeLink}}/{{.FileName}}">
47-
{{svg "octicon-book"}}{{ctx.Locale.Tr "readme"}}
46+
<a class="flex-text-block muted" href="{{.TreeLink}}/{{.FileName}}">
47+
{{svg "octicon-book"}} {{ctx.Locale.Tr "readme"}}
4848
</a>
4949
</div>
5050
{{end}}
5151
{{if .DetectedRepoLicenses}}
5252
<div class="flex-item-body">
53-
<a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
54-
{{svg "octicon-law"}}{{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
53+
<a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
54+
{{svg "octicon-law"}} {{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
5555
</a>
5656
</div>
5757
{{end}}
5858
{{if .CitiationExist}}
5959
<div class="flex-item-body">
60-
<a class="tw-flex tw-items-center tw-gap-2 muted" id="cite-repo-button">
61-
{{svg "octicon-cross-reference"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}
60+
{{template "repo/cite/cite_modal" .}}
61+
<a class="flex-text-block muted" id="cite-repo-button">
62+
{{svg "octicon-cross-reference"}} {{ctx.Locale.Tr "repo.cite_this_repo"}}
6263
</a>
6364
</div>
6465
{{end}}

0 commit comments

Comments
 (0)