my-gitea-templates/templates/user/dashboard/ dashboard.tmpl
127 lines
5.6 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. {{if .EnableHeatmap}}
  9. <div id="user-heatmap" style="padding-right: 40px">
  10. <activity-heatmap :locale="locale" :suburl="suburl" :user="heatmapUser">
  11. <div slot="loading">
  12. <div class="ui active centered inline indeterminate text loader" id="loading-heatmap">{{.i18n.Tr "user.heatmap.loading"}}</div>
  13. </div>
  14. </activity-heatmap>
  15. </div>
  16. <div class="ui divider"></div>
  17. {{end}}
  18. {{template "user/dashboard/feeds" .}}
  19. </div>
  20. <div id="app" class="six wide column">
  21. <repo-search
  22. :search-limit="searchLimit"
  23. :suburl="suburl"
  24. :uid="uid"
  25. :more-repos-link="'{{.ContextUser.HomeLink}}'"
  26. {{if not .ContextUser.IsOrganization}}
  27. :organizations="[
  28. {{range .ContextUser.Orgs}}
  29. {name: '{{.Name}}', num_repos: '{{.NumRepos}}'},
  30. {{end}}
  31. ]"
  32. :is-organization="false"
  33. :organizations-total-count="{{.ContextUser.GetOrganizationCount}}"
  34. :can-create-organization="{{.SignedUser.CanCreateOrganization}}"
  35. {{end}}
  36. inline-template
  37. v-cloak
  38. >
  39. <div>
  40. <div v-if="!isOrganization" class="ui two item tabable menu">
  41. <a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{.i18n.Tr "repository"}}</a>
  42. <a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{.i18n.Tr "organization"}}</a>
  43. </div>
  44. <div v-show="tab === 'repos'" class="ui tab active list dashboard-repos">
  45. <h4 class="ui top attached header">
  46. {{.i18n.Tr "home.my_repos"}} <span class="ui grey label">${reposTotalCount}</span>
  47. <div class="ui right">
  48. <a class="poping up" :href="suburl + '/repo/create'" data-content="{{.i18n.Tr "new_repo"}}" data-variation="tiny inverted" data-position="left center">
  49. <i class="plus icon"></i>
  50. <span class="sr-only">{{.i18n.Tr "new_repo"}}</span>
  51. </a>
  52. </div>
  53. </h4>
  54. <div class="ui attached secondary segment repos-search">
  55. <div class="ui fluid icon input" :class="{loading: isLoading}">
  56. <input @input="searchRepos(reposFilter)" v-model="searchQuery" ref="search" placeholder="{{.i18n.Tr "home.search_repos"}}">
  57. <i class="search icon"></i>
  58. </div>
  59. <div class="ui secondary tiny pointing borderless menu center aligned grid repos-filter">
  60. <a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
  61. {{.i18n.Tr "all"}}
  62. <div v-show="reposFilter === 'all'" class="ui circular mini grey label">${repoTypeCount}</div>
  63. </a>
  64. <a class="item" :class="{active: reposFilter === 'sources'}" @click="changeReposFilter('sources')">
  65. {{.i18n.Tr "sources"}}
  66. <div v-show="reposFilter === 'sources'" class="ui circular mini grey label">${repoTypeCount}</div>
  67. </a>
  68. <a class="item" :class="{active: reposFilter === 'forks'}" @click="changeReposFilter('forks')">
  69. {{.i18n.Tr "forks"}}
  70. <div v-show="reposFilter === 'forks'" class="ui circular mini grey label">${repoTypeCount}</div>
  71. </a>
  72. <a class="item" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')">
  73. {{.i18n.Tr "mirrors"}}
  74. <div v-show="reposFilter === 'mirrors'" class="ui circular mini grey label">${repoTypeCount}</div>
  75. </a>
  76. <a class="item" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')">
  77. {{.i18n.Tr "collaborative"}}
  78. <div v-show="reposFilter === 'collaborative'" class="ui circular mini grey label">${repoTypeCount}</div>
  79. </a>
  80. </div>
  81. </div>
  82. <div class="ui attached table segment">
  83. <ul class="repo-owner-name-list">
  84. <li v-for="repo in repos" :class="{'private': repo.private}" v-show="showRepo(repo, reposFilter)">
  85. <a :href="suburl + '/' + repo.full_name">
  86. <i :class="repoClass(repo)"></i>
  87. <strong class="text truncate item-name">${repo.full_name}</strong>
  88. </a>
  89. </li>
  90. <li v-if="showMoreReposLink">
  91. <a :href="moreReposLink">{{.i18n.Tr "home.show_more_repos"}}</a>
  92. </li>
  93. </ul>
  94. </div>
  95. </div>
  96. <div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list">
  97. <h4 class="ui top attached header">
  98. {{.i18n.Tr "home.my_orgs"}} <span class="ui grey label">${organizationsTotalCount}</span>
  99. <div v-if="canCreateOrganization" class="ui right">
  100. <a class="poping up" :href="suburl + '/org/create'" data-content="{{.i18n.Tr "new_org"}}" data-variation="tiny inverted" data-position="left center">
  101. <i class="plus icon"></i>
  102. <span class="sr-only">{{.i18n.Tr "new_org"}}</span>
  103. </a>
  104. </div>
  105. </h4>
  106. <div class="ui attached table segment">
  107. <ul class="repo-owner-name-list">
  108. <li v-for="org in organizations">
  109. <a :href="suburl + '/' + org.name">
  110. <i class="octicon octicon-organization"></i>
  111. <strong class="text truncate item-name">${org.name}</strong>
  112. <span class="ui right text light grey">
  113. ${org.num_repos} <i class="octicon octicon-repo rear"></i>
  114. </span>
  115. </a>
  116. </li>
  117. </ul>
  118. </div>
  119. </div>
  120. </div>
  121. </repo-search>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. {{template "base/footer" .}}