aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-12-09 00:16:32 +0800
committerGitHub <noreply@github.com>2024-12-09 00:16:32 +0800
commitc986718965ae161b153002dbff9f5b39d5227371 (patch)
tree27cdf41934505a24ba49d1ed43ebaa63346ab939 /templates
parent23471e1333b8289063e97cf27b6ad7796f593b47 (diff)
downloadgitea-c986718965ae161b153002dbff9f5b39d5227371.tar.gz
gitea-c986718965ae161b153002dbff9f5b39d5227371.zip
Fix repo home row-right grow (#32763)
Fix #32753
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/home.tmpl4
-rw-r--r--templates/repo/home_sidebar_top.tmpl13
2 files changed, 9 insertions, 8 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 343425134b..46d0398c21 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -102,7 +102,8 @@
{{end}}
</div>
- <div class="repo-button-row-right">
+ {{/* 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 */}}
+ <div class="repo-button-row-right {{if not $isTreePathRoot}}tw-flex-grow-0{{end}}">
<!-- Only show clone panel in repository home page -->
{{if $isTreePathRoot}}
<div class="clone-panel ui action tiny input">
@@ -122,7 +123,6 @@
</button>
{{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}}
</div>
- {{template "repo/cite/cite_modal" .}}
{{end}}
{{if and (not $isTreePathRoot) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}}
<a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">
diff --git a/templates/repo/home_sidebar_top.tmpl b/templates/repo/home_sidebar_top.tmpl
index d36c5b0433..4b0ebcd390 100644
--- a/templates/repo/home_sidebar_top.tmpl
+++ b/templates/repo/home_sidebar_top.tmpl
@@ -43,22 +43,23 @@
{{end}}
{{if .ReadmeExist}}
<div class="flex-item-body tw-mt-2">
- <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.TreeLink}}/{{.FileName}}">
- {{svg "octicon-book"}}{{ctx.Locale.Tr "readme"}}
+ <a class="flex-text-block muted" href="{{.TreeLink}}/{{.FileName}}">
+ {{svg "octicon-book"}} {{ctx.Locale.Tr "readme"}}
</a>
</div>
{{end}}
{{if .DetectedRepoLicenses}}
<div class="flex-item-body">
- <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
- {{svg "octicon-law"}}{{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
+ <a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
+ {{svg "octicon-law"}} {{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
</a>
</div>
{{end}}
{{if .CitiationExist}}
<div class="flex-item-body">
- <a class="tw-flex tw-items-center tw-gap-2 muted" id="cite-repo-button">
- {{svg "octicon-cross-reference"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}
+ {{template "repo/cite/cite_modal" .}}
+ <a class="flex-text-block muted" id="cite-repo-button">
+ {{svg "octicon-cross-reference"}} {{ctx.Locale.Tr "repo.cite_this_repo"}}
</a>
</div>
{{end}}