|
16 | 16 | {{end}} |
17 | 17 | </div> |
18 | 18 | {{end}} |
19 | | - {{template "repo/sub_menu" .}} |
20 | 19 | {{$n := len .TreeNames}} |
21 | 20 | {{$l := Eval $n "-" 1}} |
22 | 21 | {{$isHomepage := (eq $n 0)}} |
| 22 | + |
| 23 | + {{if $isHomepage}} |
| 24 | + <div class="mobile"> |
| 25 | + {{template "repo/home_search_code" .}} |
| 26 | + </div> |
| 27 | + <div class="flex-list mobile"> |
| 28 | + {{template "repo/home_share_sidebar" .}} |
| 29 | + </div> |
| 30 | + {{end}} |
| 31 | + {{template "repo/sub_menu" .}} |
| 32 | + |
23 | 33 | <div class="repo-button-row" data-is-homepage="{{$isHomepage}}"> |
24 | 34 | <div class="repo-button-row-left"> |
25 | 35 | {{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}} |
|
119 | 129 |
|
120 | 130 | {{if $isHomepage}} |
121 | 131 | <div class="flex-container-repo"> |
122 | | - <form class="ignore-dirty tw-flex tw-flex-1 tw-mt-1" action="{{.RepoLink}}/search" method="get"> |
123 | | - <div class="ui small action input tw-flex-1"> |
124 | | - <input name="q" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}"> |
125 | | - {{template "shared/search/button"}} |
126 | | - </div> |
127 | | - </form> |
| 132 | + <div class="not-mobile"> |
| 133 | + {{template "repo/home_search_code" .}} |
| 134 | + </div> |
128 | 135 |
|
129 | 136 | <div class="flex-list"> |
130 | | - <div class="flex-item"> |
131 | | - <div class="flex-item-main"> |
132 | | - <div class="flex-item-title"> |
133 | | - {{ctx.Locale.Tr "repo.repo_desc"}} |
134 | | - </div> |
135 | | - {{if and (not .HideRepoInfo) (not .IsBlame)}} |
136 | | - <div class="flex-item-body repo-description tw-break-anywhere tw-gap-2 tw-mt-2"> |
137 | | - {{- $description := .Repository.DescriptionHTML ctx -}} |
138 | | - {{if $description}}{{$description | RenderCodeBlock}}{{else}}{{ctx.Locale.Tr "repo.repo_no_desc"}}{{end}} |
139 | | - {{if .Repository.Website}}{{svg "octicon-link"}}<a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}} |
140 | | - </div> |
141 | | - <div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics"> |
142 | | - {{/* it should match the code in issue-home.js */}} |
143 | | - {{range .Topics}}<a class="repo-topic ui large label" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}} |
144 | | - </div> |
145 | | - {{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg tw-text-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}} |
146 | | - {{end}} |
147 | | - {{if and .Permission.IsAdmin (not .Repository.IsArchived)}} |
148 | | - <div class="ui form tw-hidden flex-item-body tw-gap-2 tw-my-2" id="topic_edit"> |
149 | | - <div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1"> |
150 | | - <input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}"> |
151 | | - {{range .Topics}} |
152 | | - {{/* keep the same layout as Fomantic UI generated labels */}} |
153 | | - <a class="ui label transition visible tw-cursor-default tw-inline-block repo-topic" data-value="{{.Name}}">{{.Name}}{{svg "octicon-x" 16 "delete icon"}}</a> |
154 | | - {{end}} |
155 | | - <div class="text"></div> |
156 | | - </div> |
157 | | - <div> |
158 | | - <button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button> |
159 | | - <button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button> |
160 | | - </div> |
161 | | - </div> |
162 | | - {{end}} |
163 | | - {{if .ReadmeExist}} |
164 | | - <div class="flex-item-body tw-mt-2"> |
165 | | - <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.TreeLink}}/{{.FileName}}"> |
166 | | - {{svg "octicon-book"}}{{ctx.Locale.Tr "readme"}} |
167 | | - </a> |
168 | | - </div> |
169 | | - {{end}} |
170 | | - {{if .DetectedRepoLicenses}} |
171 | | - <div class="flex-item-body"> |
172 | | - <a class="tw-flex tw-items-center tw-gap-2 muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" data-tooltip-placement="top" data-tooltip-content="{{StringUtils.Join .DetectedRepoLicenses ", "}}"> |
173 | | - {{svg "octicon-law"}}{{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}} |
174 | | - </a> |
175 | | - </div> |
176 | | - {{end}} |
177 | | - {{if .CitiationExist}} |
178 | | - <div class="flex-item-body"> |
179 | | - <a class="tw-flex tw-items-center tw-gap-2 muted" id="cite-repo-button"> |
180 | | - {{svg "octicon-cross-reference"}}{{ctx.Locale.Tr "repo.cite_this_repo"}} |
181 | | - </a> |
182 | | - </div> |
183 | | - {{end}} |
184 | | - </div> |
| 137 | + <div class="flex-item not-mobile"> |
| 138 | + {{template "repo/home_share_sidebar" .}} |
185 | 139 | </div> |
186 | 140 |
|
187 | 141 | {{if .LatestRelease}} |
|
0 commit comments