Browse Source

[api] After fixing search in priv repos re enable

cgars 8 years ago
parent
commit
95cf0ee877
2 changed files with 8 additions and 9 deletions
  1. 1 8
      routes/api/v1/repo/repo.go
  2. 7 1
      templates/explore/search.tmpl

+ 1 - 8
routes/api/v1/repo/repo.go

@@ -48,14 +48,7 @@ func Search(c *context.APIContext) {
 		}
 		}
 	}
 	}
 
 
-	tmprepos, count, err := models.SearchRepositoryByName(opts)
-	var repos []*models.Repository
-
-	for _, repo := range tmprepos {
-		if !repo.IsPrivate {
-			repos = append(repos, repo)
-		}
-	}
+	repos, count, err := models.SearchRepositoryByName(opts)
 	if err != nil {
 	if err != nil {
 		c.JSON(500, map[string]interface{}{
 		c.JSON(500, map[string]interface{}{
 			"ok":    false,
 			"ok":    false,

+ 7 - 1
templates/explore/search.tmpl

@@ -1 +1,7 @@
-
+<form class="ui form">
+	<div class="ui fluid action input">
+		<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
+		<button class="ui blue button">{{.i18n.Tr "explore.search"}}</button>
+	</div>
+</form>
+<div class="ui divider"></div>