Skip to content

Commit 08472f1

Browse files
committed
fix
1 parent ffc9879 commit 08472f1

File tree

3 files changed

+23
-30
lines changed

3 files changed

+23
-30
lines changed

templates/repo/home.tmpl

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
{{template "base/alert" .}}
66
{{template "repo/code/recently_pushed_new_branches" .}}
77
{{if and (not .HideRepoInfo) (not .IsBlame)}}
8-
<div class="repo-description">
9-
<div id="repo-desc" class="gt-word-break tw-text-16">
10-
{{$description := .Repository.DescriptionHTML $.Context}}
11-
{{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}}
12-
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
13-
</div>
14-
<form class="ignore-dirty" action="{{.RepoLink}}/search" method="get">
15-
<div class="ui small action input">
16-
<input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
17-
{{template "shared/search/button"}}
18-
</div>
19-
</form>
8+
<div class="repo-description gt-word-break">
9+
{{- $description := .Repository.DescriptionHTML ctx -}}
10+
{{- if $description -}}
11+
{{- $description | RenderCodeBlock -}}
12+
{{- else if .IsRepositoryAdmin -}}
13+
<span class="no-description text italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>
14+
{{- end -}}
15+
{{- if .Repository.Website}}<a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end -}}
2016
</div>
2117
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics">
2218
{{/* it should match the code in issue-home.js */}}
@@ -54,7 +50,7 @@
5450
{{$l := Eval $n "-" 1}}
5551
{{$isHomepage := (eq $n 0)}}
5652
<div class="repo-button-row">
57-
<div class="tw-flex tw-items-center tw-gap-y-2">
53+
<div class="tw-flex tw-items-center tw-flex-wrap tw-gap-y-2">
5854
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}}
5955
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
6056
{{$cmpBranch := ""}}
@@ -111,6 +107,13 @@
111107
{{- end -}}
112108
</span>
113109
{{end}}
110+
111+
<form class="ignore-dirty" action="{{.RepoLink}}/search" method="get">
112+
<div class="ui small action input">
113+
<input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
114+
{{template "shared/search/button"}}
115+
</div>
116+
</form>
114117
</div>
115118
<div class="tw-flex tw-items-center">
116119
<!-- Only show clone panel in repository home page -->

tests/integration/repo_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestViewRepo(t *testing.T) {
2828
resp := session.MakeRequest(t, req, http.StatusOK)
2929

3030
htmlDoc := NewHTMLParser(t, resp.Body)
31-
noDescription := htmlDoc.doc.Find("#repo-desc").Children()
31+
noDescription := htmlDoc.doc.Find(".repo-description").Children()
3232
repoTopics := htmlDoc.doc.Find("#repo-topics").Children()
3333
repoSummary := htmlDoc.doc.Find(".repository-summary").Children()
3434

@@ -191,7 +191,7 @@ func TestViewAsRepoAdmin(t *testing.T) {
191191
resp := session.MakeRequest(t, req, http.StatusOK)
192192

193193
htmlDoc := NewHTMLParser(t, resp.Body)
194-
noDescription := htmlDoc.doc.Find("#repo-desc").Children()
194+
noDescription := htmlDoc.doc.Find(".repo-description").Children()
195195
repoTopics := htmlDoc.doc.Find("#repo-topics").Children()
196196
repoSummary := htmlDoc.doc.Find(".repository-summary").Children()
197197

@@ -211,7 +211,7 @@ func TestViewFileInRepo(t *testing.T) {
211211
resp := session.MakeRequest(t, req, http.StatusOK)
212212

213213
htmlDoc := NewHTMLParser(t, resp.Body)
214-
description := htmlDoc.doc.Find("#repo-desc")
214+
description := htmlDoc.doc.Find(".repo-description")
215215
repoTopics := htmlDoc.doc.Find("#repo-topics")
216216
repoSummary := htmlDoc.doc.Find(".repository-summary")
217217

@@ -230,7 +230,7 @@ func TestBlameFileInRepo(t *testing.T) {
230230
resp := session.MakeRequest(t, req, http.StatusOK)
231231

232232
htmlDoc := NewHTMLParser(t, resp.Body)
233-
description := htmlDoc.doc.Find("#repo-desc")
233+
description := htmlDoc.doc.Find(".repo-description")
234234
repoTopics := htmlDoc.doc.Find("#repo-topics")
235235
repoSummary := htmlDoc.doc.Find(".repository-summary")
236236

@@ -249,7 +249,7 @@ func TestViewRepoDirectory(t *testing.T) {
249249
resp := session.MakeRequest(t, req, http.StatusOK)
250250

251251
htmlDoc := NewHTMLParser(t, resp.Body)
252-
description := htmlDoc.doc.Find("#repo-desc")
252+
description := htmlDoc.doc.Find(".repo-description")
253253
repoTopics := htmlDoc.doc.Find("#repo-topics")
254254
repoSummary := htmlDoc.doc.Find(".repository-summary")
255255

web_src/css/repo.css

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,11 @@
157157
left: auto !important;
158158
}
159159

160-
.repository.file.list .repo-description {
161-
display: flex;
162-
justify-content: space-between;
163-
align-items: center;
164-
gap: 5px;
160+
.repository .repo-description {
161+
font-size: 16px;
165162
margin-bottom: 5px;
166163
}
167164

168-
@media (max-width: 767.98px) {
169-
.repository.file.list .repo-description {
170-
flex-direction: column;
171-
align-items: stretch;
172-
}
173-
}
174-
175165
.commit-summary {
176166
flex: 1;
177167
overflow-wrap: anywhere;

0 commit comments

Comments
 (0)