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.

repolist.tmpl 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <div id="app" class="six wide column">
  2. <repo-search
  3. :search-limit="searchLimit"
  4. :suburl="suburl"
  5. :uid="uid"
  6. {{if .Team}}
  7. :team-id="{{.Team.ID}}"
  8. {{end}}
  9. :more-repos-link="'{{.ContextUser.HomeLink}}'"
  10. {{if not .ContextUser.IsOrganization}}
  11. :organizations="[
  12. {{range .ContextUser.Orgs}}
  13. {name: '{{.Name}}', num_repos: '{{.NumRepos}}'},
  14. {{end}}
  15. ]"
  16. :is-organization="false"
  17. :organizations-total-count="{{.ContextUser.GetOrganizationCount}}"
  18. :can-create-organization="{{.SignedUser.CanCreateOrganization}}"
  19. {{end}}
  20. inline-template
  21. v-cloak
  22. >
  23. <div>
  24. <div v-if="!isOrganization" class="ui two item tabable menu">
  25. <a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{.i18n.Tr "repository"}}</a>
  26. <a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{.i18n.Tr "organization"}}</a>
  27. </div>
  28. <div v-show="tab === 'repos'" class="ui tab active list dashboard-repos">
  29. <h4 class="ui top attached header df ac">
  30. <div class="f1 df ac">
  31. {{.i18n.Tr "home.my_repos"}}
  32. <span class="ui grey label ml-3">${reposTotalCount}</span>
  33. </div>
  34. <a class="poping up" :href="suburl + '/repo/create'" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center">
  35. {{svg "octicon-plus"}}
  36. <span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
  37. </a>
  38. </h4>
  39. <div class="ui attached segment repos-search">
  40. <div class="ui fluid right action left icon input" :class="{loading: isLoading}">
  41. <input @input="changeReposFilter(reposFilter)" v-model="searchQuery" ref="search" placeholder="{{.i18n.Tr "home.search_repos"}}">
  42. <i class="icon df ac jc">{{svg "octicon-search" 16}}</i>
  43. <div class="ui dropdown icon button" title="{{.i18n.Tr "home.filter"}}">
  44. <i class="icon df ac jc m-0">{{svg "octicon-filter" 16}}</i>
  45. <div class="menu">
  46. <div class="item">
  47. <a @click="toggleArchivedFilter()">
  48. <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_both_archived_unarchived"}}" v-if="archivedFilter === 'both'">
  49. <input type="checkbox">
  50. <label>
  51. {{svg "octicon-archive" 16 "mr-2"}}
  52. {{.i18n.Tr "home.show_archived"}}
  53. </label>
  54. </div>
  55. <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_only_unarchived"}}" v-if="archivedFilter === 'unarchived'">
  56. <input type="checkbox">
  57. <label>
  58. {{svg "octicon-archive" 16 "mr-2"}}
  59. {{.i18n.Tr "home.show_archived"}}
  60. </label>
  61. </div>
  62. <div class="ui checkbox" id="archivedFilterCheckbox" title="{{.i18n.Tr "home.show_only_archived"}}" v-if="archivedFilter === 'archived'">
  63. <input type="checkbox">
  64. <label>
  65. {{svg "octicon-archive" 16 "mr-2"}}
  66. {{.i18n.Tr "home.show_archived"}}
  67. </label>
  68. </div>
  69. </a>
  70. </div>
  71. <div class="item">
  72. <a @click="togglePrivateFilter()">
  73. <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_both_private_public"}}" v-if="privateFilter === 'both'">
  74. <input type="checkbox">
  75. <label>
  76. {{svg "octicon-lock" 16 "mr-2"}}
  77. {{.i18n.Tr "home.show_private"}}
  78. </label>
  79. </div>
  80. <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_only_public"}}" v-if="privateFilter === 'public'">
  81. <input type="checkbox">
  82. <label>
  83. {{svg "octicon-lock" 16 "mr-2"}}
  84. {{.i18n.Tr "home.show_private"}}
  85. </label>
  86. </div>
  87. <div class="ui checkbox" id="privateFilterCheckbox" title="{{.i18n.Tr "home.show_only_private"}}" v-if="privateFilter === 'private'">
  88. <input type="checkbox">
  89. <label>
  90. {{svg "octicon-lock" 16 "mr-2"}}
  91. {{.i18n.Tr "home.show_private"}}
  92. </label>
  93. </div>
  94. </a>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <div class="ui secondary tiny pointing borderless menu center aligned grid repos-filter">
  100. <a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
  101. {{.i18n.Tr "all"}}
  102. <div v-show="reposFilter === 'all'" class="ui circular mini grey label">${repoTypeCount}</div>
  103. </a>
  104. <a class="item" :class="{active: reposFilter === 'sources'}" @click="changeReposFilter('sources')">
  105. {{.i18n.Tr "sources"}}
  106. <div v-show="reposFilter === 'sources'" class="ui circular mini grey label">${repoTypeCount}</div>
  107. </a>
  108. <a class="item" :class="{active: reposFilter === 'forks'}" @click="changeReposFilter('forks')">
  109. {{.i18n.Tr "forks"}}
  110. <div v-show="reposFilter === 'forks'" class="ui circular mini grey label">${repoTypeCount}</div>
  111. </a>
  112. <a class="item" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')">
  113. {{.i18n.Tr "mirrors"}}
  114. <div v-show="reposFilter === 'mirrors'" class="ui circular mini grey label">${repoTypeCount}</div>
  115. </a>
  116. <a class="item" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')">
  117. {{.i18n.Tr "collaborative"}}
  118. <div v-show="reposFilter === 'collaborative'" class="ui circular mini grey label">${repoTypeCount}</div>
  119. </a>
  120. </div>
  121. </div>
  122. <div v-if="repos.length" class="ui attached table segment rounded-bottom">
  123. <ul class="repo-owner-name-list">
  124. <li v-for="repo in repos" :class="{'private': repo.private || repo.internal}">
  125. <a class="repo-list-link df ac sb" :href="suburl + '/' + repo.full_name">
  126. <div class="text truncate item-name f1">
  127. <component v-bind:is="repoIcon(repo)" size="16"></component>
  128. <strong>${repo.full_name}</strong>
  129. <span v-if="repo.archived">
  130. {{svg "octicon-archive" 16 "ml-2"}}
  131. </span>
  132. </div>
  133. <div class="text light grey df ac">
  134. ${repo.stars_count}
  135. {{svg "octicon-star" 16 "ml-2"}}
  136. </div>
  137. </a>
  138. </li>
  139. </ul>
  140. <div v-if="showMoreReposLink" class="center py-3 border-secondary-top">
  141. <div class="ui borderless pagination menu narrow">
  142. <a class="item navigation py-2" :class="{'disabled': page === 1}"
  143. @click="changePage(1)" title="{{$.i18n.Tr "admin.first_page"}}">
  144. {{svg "gitea-double-chevron-left" 16 "mr-2"}}
  145. </a>
  146. <a class="item navigation py-2" :class="{'disabled': page === 1}"
  147. @click="changePage(page - 1)" title="{{$.i18n.Tr "repo.issues.previous"}}">
  148. {{svg "octicon-chevron-left" 16 "mr-2"}}
  149. </a>
  150. <a class="active item py-2">${page}</a>
  151. <a class="item navigation" :class="{'disabled': page === finalPage}"
  152. @click="changePage(page + 1)" title="{{$.i18n.Tr "repo.issues.next"}}">
  153. {{svg "octicon-chevron-right" 16 "ml-2"}}
  154. </a>
  155. <a class="item navigation py-2" :class="{'disabled': page === finalPage}"
  156. @click="changePage(finalPage)" title="{{$.i18n.Tr "admin.last_page"}}">
  157. {{svg "gitea-double-chevron-right" 16 "ml-2"}}
  158. </a>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. <div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list dashboard-orgs">
  164. <h4 class="ui top attached header df ac">
  165. <div class="f1 df ac">
  166. {{.i18n.Tr "home.my_orgs"}}
  167. <span class="ui grey label ml-3">${organizationsTotalCount}</span>
  168. </div>
  169. <a v-if="canCreateOrganization" class="poping up" :href="suburl + '/org/create'" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
  170. {{svg "octicon-plus"}}
  171. <span class="sr-only">{{.i18n.Tr "new_org"}}</span>
  172. </a>
  173. </h4>
  174. <div v-if="organizations.length" class="ui attached table segment rounded-bottom">
  175. <ul class="repo-owner-name-list">
  176. <li v-for="org in organizations">
  177. <a class="repo-list-link df ac sb" :href="suburl + '/' + org.name">
  178. <div class="text truncate item-name f1">
  179. {{svg "octicon-organization" 16 "mr-2"}}
  180. <strong>${org.name}</strong>
  181. </div>
  182. <div class="text light grey df ac">
  183. ${org.num_repos}
  184. {{svg "octicon-repo" 16 "ml-2 mt-1"}}
  185. </div>
  186. </a>
  187. </li>
  188. </ul>
  189. </div>
  190. </div>
  191. </div>
  192. </repo-search>
  193. </div>