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 12 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
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
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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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.tag-active {
  69. background-color: #0366d6;
  70. color: #ffffff;
  71. }
  72. .tag-gray {
  73. background-color: #f8f9fa;
  74. color: #415058;
  75. }
  76. .tag {
  77. align-items: center;
  78. display: inline-flex;
  79. flex: none;
  80. height: 2rem;
  81. margin-bottom: 0.35rem;
  82. margin-right: 0.35rem;
  83. max-width: 100%;
  84. }
  85. .tag>span {
  86. padding: 0.75rem;
  87. font-size: 14px;
  88. }
  89. .repo_dataset_header {
  90. font-size: 12px;
  91. color: #3291F8;
  92. }
  93. .heart-stroke {
  94. stroke: #FA8C16;
  95. stroke-width: 2;
  96. fill: #fff
  97. }
  98. .stars_active {
  99. fill: #FA8C16 !important;
  100. stroke: #FA8C16 !important
  101. }
  102. </style>
  103. <div class="explore repositories">
  104. {{template "explore/dataset_search" .}}
  105. <div>
  106. <div class="ui container">
  107. <div class="ui grid">
  108. {{template "explore/dataset_left" .}}
  109. <div class="ui sixteen wide mobile sixteen wide tablet twelve wide computer column">
  110. <div class="ui row">
  111. <h2 class="ui left floated medium header">
  112. {{.i18n.Tr "datasets"}}
  113. </h2>
  114. <div class="ui right floated secondary filter menu">
  115. <!-- Sort -->
  116. <div class="ui right dropdown type jump item">
  117. <span class="text">
  118. {{.i18n.Tr "repo.issues.filter_sort"}}
  119. <i class="dropdown icon"></i>
  120. </span>
  121. <div class="menu">
  122. <a class="{{if eq .SortType "default"}}active{{end}} item"
  123. href="{{$.Link}}?sort=default&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.default"}}</a>
  124. <a class="{{if eq .SortType "newest"}}active{{end}} item"
  125. href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  126. <a class="{{if eq .SortType "oldest"}}active{{end}} item"
  127. href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  128. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item"
  129. href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  130. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item"
  131. href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  132. <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item"
  133. href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a>
  134. <a class="{{if eq .SortType "moststars"}}active{{end}} item"
  135. href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "dataset.collection_num"}}</a>
  136. <a class="{{if eq .SortType "mostusecount"}}active{{end}} item"
  137. href="{{$.Link}}?sort=mostusecount&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.mostusecount"}}</a>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. {{if .Datasets}}
  143. <div id="datasets-square-range-value" style="display: none;">
  144. {{range .Datasets}}
  145. <div class="item" data-num-stars="{{.NumStars}}" data-star-active="{{.IsStaring}}"></div>
  146. {{end}}
  147. </div>
  148. {{end}}
  149. <div class="ui row" style="clear: both;" id="dataset-base">
  150. <el-checkbox v-model="checked" style="padding: 0.5rem 1rem;" @change="handleCheckedChange">
  151. 仅显示平台推荐</el-checkbox>
  152. <div class="ui two cards">
  153. {{range $k, $v :=.Datasets}}
  154. <div class="ui card" @click="gotoDataset('{{.Repo.Link}}/datasets')"
  155. style="cursor: pointer;box-shadow: 0px 4px 4px 0px rgba(232,232,232,0.6);border: 1px solid rgba(232, 232, 232, 1);">
  156. <div class="content" style="border-bottom: none;">
  157. <div
  158. style="font-size: 16px;color:#0366D6;font-family: SourceHanSansSC-medium;height: 34px;font-weight: bold;display: flex;align-items: center">
  159. <span title="{{.Title}}" class="nowrap"
  160. style="display: inline-block;">{{.Title}}</span>{{if .Recommend}}<img
  161. src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}
  162. {{if $.IsSigned}}
  163. <span
  164. style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;font-size: 12px;font-weight: normal;flex: 1;margin-left: 1.5rem;"
  165. @click.stop="postSquareStar({{.ID}},'{{.Repo.Link}}/datasets',{{$k}})">
  166. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
  167. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32"
  168. class="heart-stroke" :class='{stars_active:starActives[{{$k}}]}'>
  169. <path
  170. 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">
  171. </path>
  172. </svg>
  173. </div>
  174. <span style="line-height: 1;color: #101010;">${starItems[{{$k}}]}</span>
  175. </span>
  176. {{else}}
  177. <span
  178. style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;font-size: 12px;font-weight: normal;flex: 1;margin-left: 1.5rem;">
  179. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
  180. <svg width="1.4em" height="1.4em" viewBox="0 0 32 32"
  181. class="heart-stroke" :class='{stars_active:starActives[{{$k}}]}'>
  182. <path
  183. 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">
  184. </path>
  185. </svg>
  186. </div>
  187. <span style="line-height: 1;color: #101010;">${starItems[{{$k}}]}</span>
  188. </span>
  189. {{end}}
  190. </div>
  191. {{if or (.Category) (.Task) (.License)}}
  192. <div style="font-size: 12px;margin-top: 5px;">
  193. {{if .Category}}
  194. {{$category := .Category}}
  195. <a class="ui repo-topic label topic"
  196. href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{.Category}}&task={{$.Task}}&license={{$.License}}">{{$.i18n.Tr (printf "dataset.category.%s" $category)}}</a>
  197. {{end}}
  198. {{if .Task}}
  199. {{$task := .Task}}
  200. <a class="ui repo-topic label topic"
  201. href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{.Task}}&license={{$.License}}">{{$.i18n.Tr (printf "dataset.task.%s" $task)}}</a>
  202. {{end}}
  203. {{if .License}}
  204. <a class="ui repo-topic label topic"
  205. href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.License}}">{{.License}}</a>
  206. {{end}}
  207. </div>
  208. {{end}}
  209. <div class="description"
  210. style="-webkit-box-orient: vertical;-webkit-line-clamp: 2;display: -webkit-box;overflow: hidden;color:#999999;font-size: 14px;margin-top: 10px;">
  211. <p>{{.Description}}</p>
  212. </div>
  213. </div>
  214. <div class="extra content" style="border-top: none !important;">
  215. <div style="display: flex;align-items: center;">
  216. {{if eq .UserID 0}}
  217. <a href="{{AppSubUrl}}/{{.Repo.OwnerName}}" title="{{.Repo.OwnerName}}">
  218. <img class="ui avatar image" style="width: 22px;height:22px;"
  219. src="/user/avatar/{{.Repo.OwnerName}}/-1">
  220. </a>
  221. {{else}}
  222. <a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}">
  223. <img class="ui avatar image" style="width: 22px;height:22px;"
  224. src="/user/avatar/{{.User.Name}}/-1">
  225. </a>
  226. {{end}}
  227. <span
  228. style="color: #999999;font-size: 12px;margin-left: 0.5rem;">{{TimeSinceUnixShort .CreatedUnix}}</span>
  229. <span
  230. style="display: flex;align-items: center;justify-content: center;margin: 0 1rem;"
  231. title="{{$.i18n.Tr "repo.issues.filter_sort.citations"}}">
  232. <i class="ri-link"></i>
  233. <span
  234. style="color: #101010; font-size: 12px;margin-left: 0.2rem;">{{.UseCount}}</span>
  235. </span>
  236. <span style=" display: flex;align-items: center;justify-content: center;"
  237. title='{{$.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}'>
  238. <i class="ri-download-line"></i>
  239. <span
  240. style="color: #101010;font-size: 12px;margin-left: 0.2rem;">{{.DownloadTimes}}</span>
  241. </span>
  242. </div>
  243. </div>
  244. </div>
  245. {{end}}
  246. </div>
  247. </div>
  248. <div id="app" style="margin-top: 2rem;">
  249. <div class="center">
  250. <el-pagination background @current-change="handleCurrentChange" :current-page="page"
  251. :page-sizes="[30]" :page-size="30" layout="total, sizes, prev, pager, next, jumper"
  252. :total="{{.Page.Paginater.Total}}">
  253. </el-pagination>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. {{template "base/footer" .}}