|
|
@@ -90,7 +90,16 @@ |
|
|
|
{{ctx.Locale.Tr "repo.use_template"}} |
|
|
|
</a> |
|
|
|
{{end}} |
|
|
|
{{if (not $isHomepage)}} |
|
|
|
{{if $isHomepage}} |
|
|
|
{{/* only show the "code search" on the repo home page, it only does global search, |
|
|
|
so do not show it when viewing file or directory to avoid misleading users (it doesn't search in a directory) */}} |
|
|
|
<form class="ignore-dirty" action="{{.RepoLink}}/search" method="get"> |
|
|
|
<div class="ui small action input"> |
|
|
|
<input name="q" placeholder="{{ctx.Locale.Tr "search.code_kind"}}"> |
|
|
|
{{template "shared/search/button"}} |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
{{else}} |
|
|
|
<span class="breadcrumb repo-path tw-ml-1"> |
|
|
|
<a class="section" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}" title="{{.Repository.Name}}">{{StringUtils.EllipsisString .Repository.Name 30}}</a> |
|
|
|
{{- range $i, $v := .TreeNames -}} |
|
|
@@ -103,13 +112,6 @@ |
|
|
|
{{- 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 --> |
|
|
@@ -136,7 +138,7 @@ |
|
|
|
</div> |
|
|
|
{{template "repo/cite/cite_modal" .}} |
|
|
|
{{end}} |
|
|
|
{{if and (not $isHomepage) (not .IsViewFile) (not .IsBlame)}} |
|
|
|
{{if and (not $isHomepage) (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}}"> |
|
|
|
{{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}} |
|
|
|
</a> |
|
|
@@ -147,7 +149,7 @@ |
|
|
|
{{template "repo/view_file" .}} |
|
|
|
{{else if .IsBlame}} |
|
|
|
{{template "repo/blame" .}} |
|
|
|
{{else}} |
|
|
|
{{else}}{{/* IsViewDirectory */}} |
|
|
|
{{template "repo/view_list" .}} |
|
|
|
{{end}} |
|
|
|
</div> |