Browse Source

增加代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1788/head
zouap 3 years ago
parent
commit
81c7dc3c3f
2 changed files with 7 additions and 1 deletions
  1. +6
    -0
      routers/search.go
  2. +1
    -1
      templates/explore/search_new.tmpl

+ 6
- 0
routers/search.go View File

@@ -31,6 +31,12 @@ func InitESClient() {
}

func Search(ctx *context.Context) {
keyword := strings.Trim(ctx.Query("q"), " ")
ctx.Data["keyword"] = keyword
ctx.HTML(200, "/explore/search_new.tmpl")
}

func SearchApi(ctx *context.Context) {
TableName := ctx.Query("TableName")
Key := ctx.Query("Key")
Page := ctx.QueryInt("Page")


+ 1
- 1
templates/explore/search_new.tmpl View File

@@ -6,7 +6,7 @@
<div class="ui two column centered grid">
<form class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin-top:1.2rem">
<div class="ui fluid action input">
<input name="q" value="openi" placeholder="搜索..." autofocus="">
<input name="q" value="{{.keyword}}" placeholder="搜索..." autofocus="">
<input type="hidden" name="topic" value="">
<input type="hidden" name="tab" value="">
<input type="hidden" name="sort" value="hot">


Loading…
Cancel
Save