Skip to content

Commit dc2b28e

Browse files
committed
Show repos acording to user/organization
1 parent c746875 commit dc2b28e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

public/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ function initDashboardSearch() {
16611661
repos: [],
16621662
searchQuery: '',
16631663
suburl: document.querySelector('meta[name=_suburl]').content,
1664-
uid: document.querySelector('meta[name=_uid]').content
1664+
uid: document.querySelector('meta[name=_context_uid]').content
16651665
},
16661666

16671667
mounted: function() {

routers/api/v1/repo/repo.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ func Search(ctx *context.APIContext) {
3232
Keyword: strings.Trim(ctx.Query("q"), " "),
3333
OwnerID: ctx.QueryInt64("uid"),
3434
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
35-
Searcher: ctx.User,
35+
}
36+
if ctx.User.ID == opts.OwnerID {
37+
opts.Searcher = ctx.User
3638
}
3739

3840
// Check visibility.

templates/base/head.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
{{if .IsSigned}}
1515
<meta name="_uid" content="{{.SignedUser.ID}}" />
1616
{{end}}
17+
{{if .ContextUser}}
18+
<meta name="_context_uid" content="{{.ContextUser.ID}}" />
19+
{{end}}
1720
{{if .GoGetImport}}
1821
<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
1922
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">

0 commit comments

Comments
 (0)