my-gitea-templates/templates/user/dashboard/ dashboard.tmpl
117 lines
5.2 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. </a>
  79. </li>
  80. <li v-if="showMoreReposLink">
  81. <a :href="moreReposLink">{{.i18n.Tr "home.show_more_repos"}}</a>
  82. </li>
  83. </ul>
  84. </div>
  85. </div>
  86. <div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list">
  87. <h4 class="ui top attached header">
  88. {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">${organizationsTotalCount}</span>
  89. <div v-if="canCreateOrganization" class="ui right">
  90. <a class="poping up" :href="suburl + '/org/create'" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
  91. <i class="plus icon"></i>
  92. <span class="sr-only">{{.i18n.Tr "new_org"}}</span>
  93. </a>
  94. </div>
  95. </h4>
  96. <div class="ui attached table segment">
  97. <ul class="repo-owner-name-list">
  98. <li v-for="org in organizations">
  99. <a :href="suburl + '/' + org.name">
  100. <i class="octicon octicon-organization"></i>
  101. <strong class="text truncate item-name">${org.name}</strong>
  102. <span class="ui right text light grey">
  103. ${org.num_repos} <i class="octicon octicon-repo rear"></i>
  104. </span>
  105. </a>
  106. </li>
  107. </ul>
  108. </div>
  109. </div>
  110. </div>
  111. </repo-search>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. {{template "base/footer" .}}