Skip to content

Commit e67ece2

Browse files
authored
Merge pull request #1750 from andreynering/dashboard-search-org-repos
More fixes for dashboard search
2 parents bafd778 + 12dbdaa commit e67ece2

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

public/js/index.js

Lines changed: 2 additions & 2 deletions
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() {
@@ -1698,7 +1698,7 @@ function initDashboardSearch() {
16981698
} else if (repo.mirror) {
16991699
return 'octicon octicon-repo-clone';
17001700
} else if (repo.private) {
1701-
return 'octicon octicon-repo-forked';
1701+
return 'octicon octicon-lock';
17021702
} else {
17031703
return 'octicon octicon-repo';
17041704
}

routers/api/v1/repo/repo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ func Search(ctx *context.APIContext) {
3333
OwnerID: ctx.QueryInt64("uid"),
3434
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
3535
}
36+
if ctx.User != nil && ctx.User.ID == opts.OwnerID {
37+
opts.Searcher = ctx.User
38+
}
3639

3740
// Check visibility.
3841
if ctx.IsSigned && opts.OwnerID > 0 {

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}}">

templates/user/dashboard/dashboard.tmpl

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,6 @@
4646
{{end}}
4747
</ul>
4848
</div>
49-
50-
{{if not .ContextUser.IsOrganization}}
51-
<h4 class="ui top attached header">
52-
{{.i18n.Tr "home.collaborative_repos"}}
53-
</h4>
54-
<div class="ui attached table segment">
55-
<ul id="collaborative-repo-list">
56-
{{range .CollaborativeRepos}}
57-
<li {{if .IsPrivate}}class="private"{{end}}>
58-
<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">
59-
<i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
60-
<span class="text truncate owner-and-repo">
61-
<span class="text truncate owner-name">{{.Owner.Name}}</span> / <strong>{{.Name}}</strong>
62-
</span>
63-
<span class="ui right text light grey">
64-
{{.NumStars}} <i class="octicon octicon-star rear"></i>
65-
</span>
66-
</a>
67-
</li>
68-
{{end}}
69-
</ul>
70-
</div>
71-
{{end}}
7249
</div>
7350

7451
{{if not .ContextUser.IsOrganization}}

0 commit comments

Comments
 (0)