diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2017-05-27 17:40:09 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-27 17:40:09 -0300 |
commit | e67ece26f0b97437200998b9b153b4c3a87a65aa (patch) | |
tree | 17532418661ed29a41d8f701c64e29d532a2be15 | |
parent | bafd778c259801f0ceef1f621851afd43eabc3a5 (diff) | |
parent | 12dbdaac76b0eaa625d4e656df725bcd63218420 (diff) | |
download | gitea-e67ece26f0b97437200998b9b153b4c3a87a65aa.tar.gz gitea-e67ece26f0b97437200998b9b153b4c3a87a65aa.zip |
Merge pull request #1750 from andreynering/dashboard-search-org-repos
More fixes for dashboard search
-rw-r--r-- | public/js/index.js | 4 | ||||
-rw-r--r-- | routers/api/v1/repo/repo.go | 3 | ||||
-rw-r--r-- | templates/base/head.tmpl | 3 | ||||
-rw-r--r-- | templates/user/dashboard/dashboard.tmpl | 23 |
4 files changed, 8 insertions, 25 deletions
diff --git a/public/js/index.js b/public/js/index.js index a3e9e99e7a..80d9486fd1 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -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() { @@ -1698,7 +1698,7 @@ function initDashboardSearch() { } else if (repo.mirror) { return 'octicon octicon-repo-clone'; } else if (repo.private) { - return 'octicon octicon-repo-forked'; + return 'octicon octicon-lock'; } else { return 'octicon octicon-repo'; } diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index da4034a0d4..e0b693a4e5 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -33,6 +33,9 @@ func Search(ctx *context.APIContext) { OwnerID: ctx.QueryInt64("uid"), PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")), } + if ctx.User != nil && ctx.User.ID == opts.OwnerID { + opts.Searcher = ctx.User + } // Check visibility. if ctx.IsSigned && opts.OwnerID > 0 { diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 8b6c25c643..f357b95166 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -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}}"> diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index 806f52b51e..7a444c17d2 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -46,29 +46,6 @@ {{end}} </ul> </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> {{if not .ContextUser.IsOrganization}} |