You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
5.3 KiB

  1. {{template "base/head" .}}
  2. <div class="dashboard feeds">
  3. {{template "user/dashboard/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <div class="ui mobile reversed stackable grid">
  7. <div class="ten wide column">
  8. {{template "user/dashboard/feeds" .}}
  9. </div>
  10. <div id="app" class="six wide column">
  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. >
  29. <div>
  30. <div v-if="!isOrganization" class="ui two item tabable menu">
  31. <a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{.i18n.Tr "repository"}}</a>
  32. <a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{.i18n.Tr "organization"}}</a>
  33. </div>
  34. <div v-show="tab === 'repos'" class="ui tab active list dashboard-repos">
  35. <h4 class="ui top attached header">
  36. {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">${reposTotalCount}</span>
  37. <div class="ui right">
  38. <a class="poping up" :href="suburl + '/repo/create'" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center">
  39. <i class="plus icon"></i>
  40. <span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
  41. </a>
  42. </div>
  43. </h4>
  44. <div class="ui attached secondary segment repos-search">
  45. <div class="ui fluid icon input" :class="{loading: isLoading}">
  46. <input @input="searchRepos(reposFilter)" v-model="searchQuery" ref="search" placeholder="{{.i18n.Tr "home.search_repos"}}">
  47. <i class="search icon"></i>
  48. </div>
  49. <div class="ui secondary tiny pointing borderless menu center aligned grid repos-filter">
  50. <a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
  51. {{.i18n.Tr "all"}}
  52. <div v-show="reposFilter === 'all'" class="ui circular mini grey label">${repoTypeCount}</div>
  53. </a>
  54. <a class="item" :class="{active: reposFilter === 'sources'}" @click="changeReposFilter('sources')">
  55. {{.i18n.Tr "sources"}}
  56. <div v-show="reposFilter === 'sources'" class="ui circular mini grey label">${repoTypeCount}</div>
  57. </a>
  58. <a class="item" :class="{active: reposFilter === 'forks'}" @click="changeReposFilter('forks')">
  59. {{.i18n.Tr "forks"}}
  60. <div v-show="reposFilter === 'forks'" class="ui circular mini grey label">${repoTypeCount}</div>
  61. </a>
  62. <a class="item" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')">
  63. {{.i18n.Tr "mirrors"}}
  64. <div v-show="reposFilter === 'mirrors'" class="ui circular mini grey label">${repoTypeCount}</div>
  65. </a>
  66. <a class="item" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')">
  67. {{.i18n.Tr "collaborative"}}
  68. <div v-show="reposFilter === 'collaborative'" class="ui circular mini grey label">${repoTypeCount}</div>
  69. </a>
  70. </div>
  71. </div>
  72. <div class="ui attached table segment">
  73. <ul class="repo-owner-name-list">
  74. <li v-for="repo in repos" :class="{'private': repo.private}" v-show="showRepo(repo, reposFilter)">
  75. <a :href="suburl + '/' + repo.full_name">
  76. <i :class="repoClass(repo)"></i>
  77. <strong class="text truncate item-name">${repo.full_name}</strong>
  78. <span class="ui right text light grey">
  79. ${repo.stars_count} <i class="octicon octicon-star rear"></i>
  80. </span>
  81. </a>
  82. </li>
  83. <li v-if="showMoreReposLink">
  84. <a :href="moreReposLink">{{.i18n.Tr "home.show_more_repos"}}</a>
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. <div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list">
  90. <h4 class="ui top attached header">
  91. {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">${organizationsTotalCount}</span>
  92. <div v-if="canCreateOrganization" class="ui right">
  93. <a class="poping up" :href="suburl + '/org/create'" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
  94. <i class="plus icon"></i>
  95. <span class="sr-only">{{.i18n.Tr "new_org"}}</span>
  96. </a>
  97. </div>
  98. </h4>
  99. <div class="ui attached table segment">
  100. <ul class="repo-owner-name-list">
  101. <li v-for="org in organizations">
  102. <a :href="suburl + '/' + org.name">
  103. <i class="octicon octicon-organization"></i>
  104. <strong class="text truncate item-name">${org.name}</strong>
  105. <span class="ui right text light grey">
  106. ${org.num_repos} <i class="octicon octicon-repo rear"></i>
  107. </span>
  108. </a>
  109. </li>
  110. </ul>
  111. </div>
  112. </div>
  113. </div>
  114. </repo-search>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. {{template "base/footer" .}}