Skip to content

Commit

Permalink
Show repos acording to user/organization
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynering committed May 18, 2017
1 parent c746875 commit dc2b28e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ function initDashboardSearch() {
repos: [],
searchQuery: '',
suburl: document.querySelector('meta[name=_suburl]').content,
uid: document.querySelector('meta[name=_uid]').content
uid: document.querySelector('meta[name=_context_uid]').content
},

mounted: function() {
Expand Down
4 changes: 3 additions & 1 deletion routers/api/v1/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func Search(ctx *context.APIContext) {
Keyword: strings.Trim(ctx.Query("q"), " "),
OwnerID: ctx.QueryInt64("uid"),
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
Searcher: ctx.User,
}
if ctx.User.ID == opts.OwnerID {
opts.Searcher = ctx.User
}

// Check visibility.
Expand Down
3 changes: 3 additions & 0 deletions templates/base/head.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
{{if .IsSigned}}
<meta name="_uid" content="{{.SignedUser.ID}}" />
{{end}}
{{if .ContextUser}}
<meta name="_context_uid" content="{{.ContextUser.ID}}" />
{{end}}
{{if .GoGetImport}}
<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
Expand Down

0 comments on commit dc2b28e

Please sign in to comment.