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

datasets.tmpl 8.6 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. {{template "base/head" .}}
  2. <style>
  3. .mg-b-1{
  4. margin-bottom: 1rem;
  5. }
  6. .mg-b-2{
  7. margin-bottom: 2rem;
  8. }
  9. .mg-l-1{
  10. margin-left: 1rem;
  11. }
  12. .text-gray-400 {
  13. --tw-text-opacity: 1;
  14. color: rgba(156,163,175,var(--tw-text-opacity));
  15. }
  16. .text-sm {
  17. font-size: .875rem;
  18. line-height: 1.25rem;
  19. }
  20. .underline {
  21. text-decoration: underline;
  22. }
  23. .flex{
  24. display: flex;
  25. }
  26. .font-medium{
  27. font-weight: 500;
  28. }
  29. .flex-wrap{
  30. flex-wrap: wrap;
  31. }
  32. .tag {
  33. background-image: linear-gradient(to bottom,var(--tw-gradient-stops));
  34. border-color: transparent;
  35. border-radius: 0.5rem;
  36. border-width: 1px;
  37. font-size: .875rem;
  38. line-height: 1.25rem;
  39. overflow: hidden;
  40. text-overflow: ellipsis;
  41. white-space: nowrap;
  42. }
  43. .tag-red {
  44. --tw-gradient-from: #fef2f2;
  45. --tw-gradient-stops: var(--tw-gradient-from),var(--tw-gradient-to,hsla(0,86%,97%,0));
  46. --tw-gradient-to: #fef2f2;
  47. --tw-text-opacity: 1;
  48. color: rgba(153,27,27,var(--tw-text-opacity));
  49. }
  50. .tag-purple {
  51. --tw-gradient-from: #f5f3ff;
  52. --tw-gradient-stops: var(--tw-gradient-from),var(--tw-gradient-to,rgba(245,243,255,0));
  53. --tw-gradient-to: #f5f3ff;
  54. --tw-text-opacity: 1;
  55. color: rgba(91,33,182,var(--tw-text-opacity));
  56. }
  57. .tag-blue {
  58. --tw-gradient-from: #eff6ff;
  59. --tw-gradient-stops: var(--tw-gradient-from),var(--tw-gradient-to,rgba(239,246,255,0));
  60. --tw-gradient-to: #eff6ff;
  61. --tw-text-opacity: 1;
  62. color: rgba(30,64,175,var(--tw-text-opacity));
  63. }
  64. .tag.inactive {
  65. filter: grayscale(100%);
  66. opacity: .5;
  67. }
  68. .tag {
  69. align-items: center;
  70. display: inline-flex;
  71. flex: none;
  72. height: 2rem;
  73. margin-bottom: 0.35rem;
  74. margin-right: 0.35rem;
  75. max-width: 100%;
  76. }
  77. .tag>span {
  78. padding: 0.75rem;
  79. font-size: 14px;
  80. }
  81. .repo_dataset_header{
  82. font-size: 12px;
  83. color: #3291F8;
  84. }
  85. .heart-stroke{
  86. stroke: #666;
  87. stroke-width: 2;
  88. fill: #fff
  89. }
  90. .stars_active{
  91. fill: #FA8C16 !important;
  92. stroke:#FA8C16 !important
  93. }
  94. </style>
  95. <div class="explore repositories">
  96. {{template "explore/dataset_search" .}}
  97. <div>
  98. <div class="ui container">
  99. <div class="ui grid">
  100. {{template "explore/dataset_left" .}}
  101. <div class="ui sixteen wide mobile sixteen wide tablet twelve wide computer column">
  102. <div class="ui row">
  103. <h2 class="ui left floated medium header">
  104. {{.i18n.Tr "datasets"}}
  105. </h2>
  106. <div class="ui right floated secondary filter menu">
  107. <!-- Sort -->
  108. <div class="ui right dropdown type jump item">
  109. <span class="text">
  110. {{.i18n.Tr "repo.issues.filter_sort"}}
  111. <i class="dropdown icon"></i>
  112. </span>
  113. <div class="menu">
  114. <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  115. <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  116. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  117. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  118. <!-- <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a> -->
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. {{if .Datasets}}
  124. <div id="datasets-square-range-value" style="display: none;">
  125. {{range .Datasets}}
  126. <div class="item" data-num-stars="{{.NumStars}}" data-star-active="{{.IsStaring}}"></div>
  127. {{end}}
  128. </div>
  129. {{end}}
  130. <div class="ui row" style="clear: both;" id="dataset-base">
  131. <div class="ui two cards">
  132. {{range $k, $v :=.Datasets}}
  133. <div class="ui card" @click="gotoDataset('{{.Repo.Link}}/datasets')" style="cursor: pointer;">
  134. <div class="content">
  135. <div class="repo_dataset_header" style="display: flex;align-items: center;justify-content: space-between;">
  136. <a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}</a>
  137. {{if $.IsSigned}}
  138. <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;" @click.stop="postSquareStar({{.ID}},'{{.Repo.Link}}/datasets',{{$k}})">
  139. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
  140. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:starActives[{{$k}}]}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg>
  141. </div>
  142. <span style="line-height: 1;color: #101010;">${starItems[{{$k}}]}</span>
  143. </span>
  144. {{else}}
  145. <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;">
  146. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
  147. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:starActives[{{$k}}]}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg>
  148. </div>
  149. <span style="line-height: 1;color: #101010;">${starItems[{{$k}}]}</span>
  150. </span>
  151. {{end}}
  152. </div>
  153. <div style="font-size: 16px;color:#0366D6;font-family: SourceHanSansSC-medium;height: 27px;">{{.Title}}</div>
  154. <div style="font-size: 12px;margin-top: 5px;height: 24px;">
  155. {{if .Category}}
  156. {{$category := .Category}}
  157. <a class="ui repo-topic label topic" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{.Category}}&task={{$.Task}}&license={{$.License}}">{{$.i18n.Tr (printf "dataset.category.%s" $category)}}</a>
  158. {{end}}
  159. {{if .Task}}
  160. {{$task := .Task}}
  161. <a class="ui repo-topic label topic" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{.Task}}&license={{$.License}}">{{$.i18n.Tr (printf "dataset.task.%s" $task)}}</a>
  162. {{end}}
  163. {{if .License}}
  164. <a class="ui repo-topic label topic" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.License}}">{{.License}}</a>
  165. {{end}}
  166. </div>
  167. <div class="description" style="-webkit-box-orient: vertical;-webkit-line-clamp: 2;display: -webkit-box;overflow: hidden;color:#999999;font-size: 14px;margin-top: 10px;">
  168. <p>{{.Description}}</p>
  169. </div>
  170. </div>
  171. <div class="extra content">
  172. <div style="display: flex;align-items: center;">
  173. <a href="{{AppSubUrl}}/{{.Repo.OwnerName}}" title="{{.Repo.OwnerName}}">
  174. <img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.Repo.OwnerName}}/-1">
  175. </a>
  176. <span style="color: #999999;font-size: 14px;;">创建于:{{TimeSinceUnix1 .CreatedUnix}}</span>
  177. </div>
  178. </div>
  179. </div>
  180. {{end}}
  181. </div>
  182. </div>
  183. <div id="app" style="margin-top: 2rem;">
  184. <div class="center">
  185. <el-pagination
  186. background
  187. @current-change="handleCurrentChange"
  188. :current-page="page"
  189. :page-sizes="[30]"
  190. :page-size="30"
  191. layout="total, sizes, prev, pager, next, jumper"
  192. :total="{{.Page.Paginater.Total}}">
  193. </el-pagination>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. {{template "base/footer" .}}
  202. <script>
  203. console.log({{.Total}})
  204. </script>