Show repos acording to user/organization
This commit is contained in:
parent
c746875fcf
commit
dc2b28ed76
3 changed files with 7 additions and 2 deletions
|
@ -1661,7 +1661,7 @@ function initDashboardSearch() {
|
||||||
repos: [],
|
repos: [],
|
||||||
searchQuery: '',
|
searchQuery: '',
|
||||||
suburl: document.querySelector('meta[name=_suburl]').content,
|
suburl: document.querySelector('meta[name=_suburl]').content,
|
||||||
uid: document.querySelector('meta[name=_uid]').content
|
uid: document.querySelector('meta[name=_context_uid]').content
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
|
|
|
@ -32,7 +32,9 @@ func Search(ctx *context.APIContext) {
|
||||||
Keyword: strings.Trim(ctx.Query("q"), " "),
|
Keyword: strings.Trim(ctx.Query("q"), " "),
|
||||||
OwnerID: ctx.QueryInt64("uid"),
|
OwnerID: ctx.QueryInt64("uid"),
|
||||||
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
|
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
|
||||||
Searcher: ctx.User,
|
}
|
||||||
|
if ctx.User.ID == opts.OwnerID {
|
||||||
|
opts.Searcher = ctx.User
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check visibility.
|
// Check visibility.
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
{{if .IsSigned}}
|
{{if .IsSigned}}
|
||||||
<meta name="_uid" content="{{.SignedUser.ID}}" />
|
<meta name="_uid" content="{{.SignedUser.ID}}" />
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{if .ContextUser}}
|
||||||
|
<meta name="_context_uid" content="{{.ContextUser.ID}}" />
|
||||||
|
{{end}}
|
||||||
{{if .GoGetImport}}
|
{{if .GoGetImport}}
|
||||||
<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
|
<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
|
||||||
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
|
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
|
||||||
|
|
Reference in a new issue