aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-04-22 07:47:31 +0800
committerGitHub <noreply@github.com>2024-04-21 23:47:31 +0000
commitf4a1cf7eab674e3c1589a7ecef015ff64e441946 (patch)
tree467f4229cfae119e98536df39c80592e44ccfe47 /templates
parent1e4867730b261352d63098b85cf53ca05867c8c2 (diff)
downloadgitea-f4a1cf7eab674e3c1589a7ecef015ff64e441946.tar.gz
gitea-f4a1cf7eab674e3c1589a7ecef015ff64e441946.zip
Fix repo home UI when there is no repo description (#30552)
Fix #30502 by a new approach. ![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76)
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/home.tmpl25
1 files changed, 12 insertions, 13 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index e18a0aec17..7b37ac1011 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -5,18 +5,10 @@
{{template "base/alert" .}}
{{template "repo/code/recently_pushed_new_branches" .}}
{{if and (not .HideRepoInfo) (not .IsBlame)}}
- <div class="repo-description">
- <div id="repo-desc" class="gt-word-break tw-text-16">
- {{$description := .Repository.DescriptionHTML $.Context}}
- {{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}}
- <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
- </div>
- <form class="ignore-dirty" action="{{.RepoLink}}/search" method="get">
- <div class="ui small action input">
- <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
- {{template "shared/search/button"}}
- </div>
- </form>
+ <div class="repo-description gt-word-break">
+ {{- $description := .Repository.DescriptionHTML ctx -}}
+ {{if $description}}{{$description | RenderCodeBlock}}{{end}}
+ {{if .Repository.Website}}<a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}
</div>
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics">
{{/* it should match the code in issue-home.js */}}
@@ -54,7 +46,7 @@
{{$l := Eval $n "-" 1}}
{{$isHomepage := (eq $n 0)}}
<div class="repo-button-row">
- <div class="tw-flex tw-items-center tw-gap-y-2">
+ <div class="tw-flex tw-items-center tw-flex-wrap tw-gap-y-2">
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
{{$cmpBranch := ""}}
@@ -111,6 +103,13 @@
{{- end -}}
</span>
{{end}}
+
+ <form class="ignore-dirty" action="{{.RepoLink}}/search" method="get">
+ <div class="ui small action input">
+ <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
+ {{template "shared/search/button"}}
+ </div>
+ </form>
</div>
<div class="tw-flex tw-items-center">
<!-- Only show clone panel in repository home page -->