|
8 | 8 | {{template "user/dashboard/feeds" .}}
|
9 | 9 | </div>
|
10 | 10 | <div id="app" class="six wide column">
|
11 |
| - <repo-search :search-limit="searchLimit" :suburl="suburl" :uid="uid"><i class="fa fa-spinner fa-spin"></i></repo-search> |
12 |
| - </div> |
| 11 | + <repo-search :search-limit="searchLimit" :suburl="suburl" :uid="uid" inline-template v-cloak> |
| 12 | + <div> |
| 13 | + {{if not .ContextUser.IsOrganization}} |
| 14 | + <div class="ui two item stackable tabable menu"> |
| 15 | + <a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{.i18n.Tr "repository"}}</a> |
| 16 | + <a :class="{item: true, active: tab === 'orgs'}" @click="changeTab('orgs')">{{.i18n.Tr "organization"}}</a> |
| 17 | + </div> |
| 18 | + {{end}} |
| 19 | + <div v-if="tab === 'repos'" class="ui tab active list"> |
| 20 | + <h4 class="ui top attached header"> |
| 21 | + {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">${ reposTotal }</span> |
| 22 | + <div class="ui right"> |
| 23 | + <a class="poping up" href="{{AppSubUrl}}/repo/create" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center"> |
| 24 | + <i class="plus icon"></i> |
| 25 | + <span class="sr-only">{{.i18n.Tr "new_repo"}}</span> |
| 26 | + </a> |
| 27 | + </div> |
| 28 | + </h4> |
| 29 | + <div class="ui attached secondary segment repos-search"> |
| 30 | + <div class="ui fluid icon input" :class="{loading: isLoading}"> |
| 31 | + <input @input="searchRepos" v-model="searchQuery" ref="search" placeholder="{{.i18n.Tr "home.search_repos"}}"> |
| 32 | + <i class="search icon"></i> |
| 33 | + </div> |
| 34 | + <div class="ui secondary tiny pointing borderless menu center aligned grid repos-filter"> |
| 35 | + <a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">{{.i18n.Tr "all"}}</a> |
| 36 | + <a class="item" :class="{active: reposFilter === 'sources'}" @click="changeReposFilter('sources')">{{.i18n.Tr "sources"}}</a> |
| 37 | + <a class="item" :class="{active: reposFilter === 'forks'}" @click="changeReposFilter('forks')">{{.i18n.Tr "forks"}}</a> |
| 38 | + <a class="item" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')">{{.i18n.Tr "mirrors"}}</a> |
| 39 | + <a class="item" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')">{{.i18n.Tr "collaborative"}}</a> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + <div class="ui attached table segment"> |
| 43 | + <ul class="repo-owner-name-list"> |
| 44 | + <li v-for="repo in repos" :class="{'private': repo.private}" v-show="showRepo(repo, reposFilter)"> |
| 45 | + <a :href="'{{AppSubUrl}}/' + repo.full_name"> |
| 46 | + <i :class="repoClass(repo)"></i> |
| 47 | + <strong class="text truncate item-name">${ repo.full_name }</strong> |
| 48 | + <span class="ui right text light grey"> |
| 49 | + ${ repo.stars_count } <i class="octicon octicon-star rear"></i> |
| 50 | + </span> |
| 51 | + </a> |
| 52 | + </li> |
| 53 | + <li v-if="repos.length < reposTotal"> |
| 54 | + <a href="{{.ContextUser.HomeLink}}">{{.i18n.Tr "home.show_more_repos"}}</a> |
| 55 | + </li> |
| 56 | + </ul> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + |
| 60 | + {{if not .ContextUser.IsOrganization}} |
| 61 | + <div v-if="tab === 'orgs'" class="ui tab active list"> |
| 62 | + <h4 class="ui top attached header"> |
| 63 | + {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">{{.ContextUser.GetOrganizationCount}}</span> |
| 64 | + <div class="ui right"> |
| 65 | + {{if .SignedUser.CanCreateOrganization}} |
| 66 | + <a class="poping up" href="{{AppSubUrl}}/org/create" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center"> |
| 67 | + <i class="plus icon"></i> |
| 68 | + <span class="sr-only">{{.i18n.Tr "new_org"}}</span> |
| 69 | + </a> |
| 70 | + {{end}} |
| 71 | + </div> |
| 72 | + </h4> |
| 73 | + <div class="ui attached table segment"> |
| 74 | + <ul class="repo-owner-name-list"> |
| 75 | + {{range .ContextUser.Orgs}} |
| 76 | + <li> |
| 77 | + <a href="{{AppSubUrl}}/{{.Name}}"> |
| 78 | + <i class="octicon octicon-organization"></i> |
| 79 | + <strong class="text truncate item-name">{{.Name}}</strong> |
| 80 | + <span class="ui right text light grey"> |
| 81 | + {{.NumRepos}} <i class="octicon octicon-repo rear"></i> |
| 82 | + </span> |
| 83 | + </a> |
| 84 | + </li> |
| 85 | + {{end}} |
| 86 | + </ul> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + {{end}} |
| 90 | + </div> |
| 91 | + </div> |
| 92 | + </repo-search> |
13 | 93 | </div>
|
14 | 94 | </div>
|
15 | 95 | </div>
|
16 |
| -{{template "user/dashboard/repo-search" .}} |
17 | 96 | {{template "base/footer" .}}
|
0 commit comments