|
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" inline-template v-cloak> |
| 11 | + <repo-search |
| 12 | + :search-limit="searchLimit" |
| 13 | + :suburl="suburl" |
| 14 | + :uid="uid" |
| 15 | + :more-repos-link="'{{.ContextUser.HomeLink}}'" |
| 16 | + {{if not .ContextUser.IsOrganization}} |
| 17 | + :organizations="[ |
| 18 | + {{range .ContextUser.Orgs}} |
| 19 | + {name: '{{.Name}}', num_repos: '{{.NumRepos}}'}, |
| 20 | + {{end}} |
| 21 | + ]" |
| 22 | + :is-organization="false" |
| 23 | + :organizations-total-count="{{.ContextUser.GetOrganizationCount}}" |
| 24 | + :can-create-organization="{{.SignedUser.CanCreateOrganization}}" |
| 25 | + {{end}} |
| 26 | + inline-template |
| 27 | + v-cloak |
| 28 | + > |
12 | 29 | <div>
|
13 |
| - {{if not .ContextUser.IsOrganization}} |
14 |
| - <div class="ui two item stackable tabable menu"> |
| 30 | + <div v-if="!isOrganization" class="ui two item stackable tabable menu"> |
15 | 31 | <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> |
| 32 | + <a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{.i18n.Tr "organization"}}</a> |
17 | 33 | </div>
|
18 |
| - {{end}} |
19 |
| - <div v-if="tab === 'repos'" class="ui tab active list"> |
| 34 | + <div v-show="tab === 'repos'" class="ui tab active list"> |
20 | 35 | <h4 class="ui top attached header">
|
21 |
| - {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">${ reposTotal }</span> |
| 36 | + {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">${reposTotalCount}</span> |
22 | 37 | <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"> |
| 38 | + <a class="poping up" :href="suburl + '/repo/create>'" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center"> |
24 | 39 | <i class="plus icon"></i>
|
25 | 40 | <span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
|
26 | 41 | </a>
|
|
42 | 57 | <div class="ui attached table segment">
|
43 | 58 | <ul class="repo-owner-name-list">
|
44 | 59 | <li v-for="repo in repos" :class="{'private': repo.private}" v-show="showRepo(repo, reposFilter)">
|
45 |
| - <a :href="'{{AppSubUrl}}/' + repo.full_name"> |
| 60 | + <a :href="suburl + '/' + repo.full_name"> |
46 | 61 | <i :class="repoClass(repo)"></i>
|
47 |
| - <strong class="text truncate item-name">${ repo.full_name }</strong> |
| 62 | + <strong class="text truncate item-name">${repo.full_name}</strong> |
48 | 63 | <span class="ui right text light grey">
|
49 |
| - ${ repo.stars_count } <i class="octicon octicon-star rear"></i> |
| 64 | + ${repo.stars_count} <i class="octicon octicon-star rear"></i> |
50 | 65 | </span>
|
51 | 66 | </a>
|
52 | 67 | </li>
|
53 |
| - <li v-if="repos.length < reposTotal"> |
54 |
| - <a href="{{.ContextUser.HomeLink}}">{{.i18n.Tr "home.show_more_repos"}}</a> |
| 68 | + <li v-if="repos.length < reposTotalCount"> |
| 69 | + <a :href="moreReposLink">{{.i18n.Tr "home.show_more_repos"}}</a> |
55 | 70 | </li>
|
56 | 71 | </ul>
|
57 | 72 | </div>
|
58 | 73 | </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> |
| 74 | + <div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list"> |
| 75 | + <h4 class="ui top attached header"> |
| 76 | + {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">${organizationsTotalCount}</span> |
| 77 | + <div v-if="canCreateOrganization" class="ui right"> |
| 78 | + <a class="poping up" :href="suburl + '/org/create'" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center"> |
| 79 | + <i class="plus icon"></i> |
| 80 | + <span class="sr-only">{{.i18n.Tr "new_org"}}</span> |
| 81 | + </a> |
87 | 82 | </div>
|
| 83 | + </h4> |
| 84 | + <div class="ui attached table segment"> |
| 85 | + <ul class="repo-owner-name-list"> |
| 86 | + <li v-for="org in organizations"> |
| 87 | + <a :href="suburl + '/' + org.name"> |
| 88 | + <i class="octicon octicon-organization"></i> |
| 89 | + <strong class="text truncate item-name">${org.name}</strong> |
| 90 | + <span class="ui right text light grey"> |
| 91 | + ${org.num_repos} <i class="octicon octicon-repo rear"></i> |
| 92 | + </span> |
| 93 | + </a> |
| 94 | + </li> |
| 95 | + </ul> |
88 | 96 | </div>
|
89 |
| - {{end}} |
| 97 | + </div> |
90 | 98 | </div>
|
91 | 99 | </repo-search>
|
92 | 100 | </div>
|
|
0 commit comments