Skip to content

Commit 23ec305

Browse files
committed
clarify sidebar logic
1 parent ad0556d commit 23ec305

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
{{$treeNamesLen := len .TreeNames}}
2020
{{$isTreePathRoot := eq $treeNamesLen 0}}
21-
{{$showSidebar := $isTreePathRoot}}
21+
{{$showSidebar := and $isTreePathRoot (not .HideRepoInfo) (not .IsBlame)}}
2222
<div class="{{Iif $showSidebar "repo-grid-filelist-sidebar" "repo-grid-filelist-only"}}">
2323
<div class="repo-home-filelist">
2424
{{template "repo/sub_menu" .}}

templates/repo/home_sidebar_top.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<form class="ignore-dirty tw-flex tw-flex-1 tw-mt-1" action="{{.RepoLink}}/search" method="get">
22
<div class="ui small action input tw-flex-1">
3-
<input name="q" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}">
4-
{{template "shared/search/button"}}
3+
<input name="q" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}"> {{template "shared/search/button"}}
54
</div>
65
</form>
76

@@ -10,22 +9,24 @@
109
<div class="flex-item-main">
1110
<div class="flex-item-title">{{ctx.Locale.Tr "repo.repo_desc"}}</div>
1211
<div class="flex-item-body">
13-
{{if and (not .HideRepoInfo) (not .IsBlame)}}
14-
<div class="repo-description tw-break-anywhere tw-gap-2 tw-my-2">
12+
<div class="tw-flex tw-flex-col tw-gap-1 tw-mt-2">
13+
<div class="repo-description tw-break-anywhere tw-gap-2">
1514
{{- $description := .Repository.DescriptionHTML ctx -}}
1615
{{if $description}}{{$description | RenderCodeBlock}}{{else}}{{ctx.Locale.Tr "repo.repo_no_desc"}}{{end}}
1716
</div>
17+
1818
{{if .Repository.Website}}
1919
<a class="flex-text-block" href="{{.Repository.Website}}">
2020
{{svg "octicon-link" 16 "tw-text-text"}} <span class="tw-text-primary">{{.Repository.Website}}</span>
2121
</a>
2222
{{end}}
23+
2324
<div id="repo-topics" class="flex-text-block tw-flex-wrap tw-gap-1 tw-my-2 tw-text-text">
2425
{{/* !!!! it SHOULD and MUST match the code in repo-home.ts */}}
2526
{{range .Topics}}<a class="repo-topic ui large label gt-ellipsis" title={{.Name}} href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
2627
</div>
2728
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
28-
<button id="manage_topic" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>
29+
<button id="manage_topic" class="btn interact-fg tw-text-12 tw-mb-2">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>
2930
<div class="ui form tw-hidden tw-my-2" id="topic_edit">
3031
<div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1">
3132
<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}">
@@ -41,20 +42,19 @@
4142
</div>
4243
</div>
4344
{{end}}
44-
{{end}}
45-
</div>
46-
<div class="flex-item-body">
47-
<div class="tw-flex tw-flex-col tw-gap-1 tw-mt-2">
45+
4846
{{if .ReadmeExist}}
4947
<a class="flex-text-block muted" href="{{.TreeLink}}/{{.FileName}}">
5048
{{svg "octicon-book"}} {{ctx.Locale.Tr "readme"}}
5149
</a>
5250
{{end}}
51+
5352
{{if .DetectedRepoLicenses}}
5453
<a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
5554
{{svg "octicon-law"}} {{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
5655
</a>
5756
{{end}}
57+
5858
{{if .CitiationExist}}
5959
{{template "repo/cite/cite_modal" .}}
6060
<a class="flex-text-block muted" id="cite-repo-button">

0 commit comments

Comments
 (0)