diff --git a/routers/search.go b/routers/search.go index 5ed46eb77..5a04c682f 100644 --- a/routers/search.go +++ b/routers/search.go @@ -32,7 +32,9 @@ func InitESClient() { func Search(ctx *context.Context) { keyword := strings.Trim(ctx.Query("q"), " ") - ctx.Data["keyword"] = keyword + ctx.Data["Keyword"] = keyword + ctx.Data["SortType"] = "newest" + ctx.HTML(200, "explore/search_new") } diff --git a/templates/explore/search_new.tmpl b/templates/explore/search_new.tmpl index a063449e3..a4d2dee3d 100644 --- a/templates/explore/search_new.tmpl +++ b/templates/explore/search_new.tmpl @@ -6,7 +6,7 @@
@@ -78,83 +69,14 @@
- {{if .RelAvatarLink}} - - {{end}} -
-
- - - - {{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} - {{if .IsArchived}}{{end}} - - {{if .IsPrivate}} - {{svg "octicon-lock" 16}} - {{else if .IsFork}} - {{svg "octicon-repo-forked" 16}} - {{else if .IsMirror}} - {{svg "octicon-repo-clone" 16}} - {{else if .Owner}} - {{if .Owner.Visibility.IsPrivate}} - {{svg "octicon-lock" 16}} - {{end}} - {{end}} -
- -
- {{if .DescriptionHTML}}

{{.DescriptionHTML}}

{{end}} - {{if .Topics }} -
- {{range .Topics}} - {{if ne . "" }}
{{.}}
{{end}} - {{end}} -
- {{end}} -

- {{svg "octicon-eye" 16}} {{.NumWatches}} - - {{svg "octicon-git-branch" 16}} {{.NumForks}} - - {{svg "octicon-star" 16}} {{.NumStars}} - - {{$.i18n.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.i18n.Lang}} - {{if .PrimaryLanguage }} - {{ .PrimaryLanguage.Language }} - {{end}} -

-
-
+ +
-
-
- {{if .Task}} - {{svg "octicon-tasklist" 16}} {{$.i18n.Tr (printf "dataset.task.%s" .Task)}} - {{end}} - {{if .Category}} - {{svg "octicon-tag" 16}}{{$.i18n.Tr (printf "dataset.category.%s" .Category)}} - {{end}} - {{svg "octicon-flame" 16}} {{.DownloadTimes}} -
- - -
- {{if .Description}} -

{{.Description}}

- {{else if .Repo.DescriptionHTML}} -

{{.Repo.DescriptionHTML}}

- {{end}} -

{{$.i18n.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.i18n.Lang}}

-
-
+