Merge pull request #1750 from andreynering/dashboard-search-org-repos

More fixes for dashboard search
tokarchuk/v1.17
Andrey Nering 8 years ago committed by GitHub
commit e67ece26f0
  1. 4
      public/js/index.js
  2. 3
      routers/api/v1/repo/repo.go
  3. 3
      templates/base/head.tmpl
  4. 23
      templates/user/dashboard/dashboard.tmpl

@ -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() {
@ -1698,7 +1698,7 @@ function initDashboardSearch() {
} else if (repo.mirror) { } else if (repo.mirror) {
return 'octicon octicon-repo-clone'; return 'octicon octicon-repo-clone';
} else if (repo.private) { } else if (repo.private) {
return 'octicon octicon-repo-forked'; return 'octicon octicon-lock';
} else { } else {
return 'octicon octicon-repo'; return 'octicon octicon-repo';
} }

@ -33,6 +33,9 @@ func Search(ctx *context.APIContext) {
OwnerID: ctx.QueryInt64("uid"), OwnerID: ctx.QueryInt64("uid"),
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")), PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
} }
if ctx.User != nil && ctx.User.ID == opts.OwnerID {
opts.Searcher = ctx.User
}
// Check visibility. // Check visibility.
if ctx.IsSigned && opts.OwnerID > 0 { if ctx.IsSigned && opts.OwnerID > 0 {

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

@ -46,29 +46,6 @@
{{end}} {{end}}
</ul> </ul>
</div> </div>
{{if not .ContextUser.IsOrganization}}
<h4 class="ui top attached header">
{{.i18n.Tr "home.collaborative_repos"}}
</h4>
<div class="ui attached table segment">
<ul id="collaborative-repo-list">
{{range .CollaborativeRepos}}
<li {{if .IsPrivate}}class="private"{{end}}>
<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">
<i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
<span class="text truncate owner-and-repo">
<span class="text truncate owner-name">{{.Owner.Name}}</span> / <strong>{{.Name}}</strong>
</span>
<span class="ui right text light grey">
{{.NumStars}} <i class="octicon octicon-star rear"></i>
</span>
</a>
</li>
{{end}}
</ul>
</div>
{{end}}
</div> </div>
{{if not .ContextUser.IsOrganization}} {{if not .ContextUser.IsOrganization}}

Loading…
Cancel
Save