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 11 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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: #666;
  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" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.default"}}</a>
  123. <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  124. <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  125. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  126. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  127. <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a>
  128. <a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. {{if .Datasets}}
  134. <div id="datasets-square-range-value" style="display: none;">
  135. {{range .Datasets}}
  136. <div class="item" data-num-stars="{{.NumStars}}" data-star-active="{{.IsStaring}}"></div>
  137. {{end}}
  138. </div>
  139. {{end}}
  140. <div class="ui row" style="clear: both;" id="dataset-base">
  141. <el-checkbox v-model="checked" style="padding: 0.5rem 1rem;" @change="handleCheckedChange" >仅显示平台推荐</el-checkbox>
  142. <div class="ui two cards">
  143. {{range $k, $v :=.Datasets}}
  144. <div class="ui card" @click="gotoDataset('{{.Repo.Link}}/datasets')" style="cursor: pointer;box-shadow: 0px 4px 4px 0px rgba(232,232,232,0.6);border: 1px solid rgba(232, 232, 232, 1);">
  145. <div class="content" style="border-bottom: none;">
  146. <div class="repo_dataset_header" style="display: flex;align-items: center;justify-content: space-between;">
  147. <a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}</a>
  148. {{if $.IsSigned}}
  149. <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;" @click.stop="postSquareStar({{.ID}},'{{.Repo.Link}}/datasets',{{$k}})">
  150. <span style="line-height: 1;color: #101010;margin-bottom: -2px;"><i class="ri-download-line" style="font-size: 1.3em;"></i></span>
  151. <span style="line-height: 1;color: #101010;margin-right: 0.6rem;">{{.DownloadTimes}}</span>
  152. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
  153. <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>
  154. </div>
  155. <span style="line-height: 1;color: #101010;">${starItems[{{$k}}]}</span>
  156. </span>
  157. {{else}}
  158. <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;">
  159. <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
  160. <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>
  161. </div>
  162. <span style="line-height: 1;color: #101010;">${starItems[{{$k}}]}</span>
  163. </span>
  164. {{end}}
  165. </div>
  166. <div style="font-size: 16px;color:#0366D6;font-family: SourceHanSansSC-medium;height: 27px;font-weight: bold;display: flex;align-items: center"><span title="{{.Title}}" class="nowrap" style="display: inline-block;">{{.Title}}</span>{{if .Recommend}}<img src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}</div>
  167. {{if or (.Category) (.Task) (.License)}}
  168. <div style="font-size: 12px;margin-top: 5px;">
  169. {{if .Category}}
  170. {{$category := .Category}}
  171. <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>
  172. {{end}}
  173. {{if .Task}}
  174. {{$task := .Task}}
  175. <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>
  176. {{end}}
  177. {{if .License}}
  178. <a class="ui repo-topic label topic" href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{.License}}">{{.License}}</a>
  179. {{end}}
  180. </div>
  181. {{end}}
  182. <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;">
  183. <p>{{.Description}}</p>
  184. </div>
  185. </div>
  186. <div class="extra content" style="border-top: none !important;">
  187. <div style="display: flex;align-items: center;">
  188. {{if eq .UserID 0}}
  189. <a href="{{AppSubUrl}}/{{.Repo.OwnerName}}" title="{{.Repo.OwnerName}}">
  190. <img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.Repo.OwnerName}}/-1">
  191. </a>
  192. {{else}}
  193. <a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}">
  194. <img class="ui avatar image" style="width: 22px;height:22px;" src="/user/avatar/{{.User.Name}}/-1">
  195. </a>
  196. {{end}}
  197. <span style="color: #999999;font-size: 14px;;">创建于:{{TimeSinceUnix1 .CreatedUnix}}</span>
  198. </div>
  199. </div>
  200. </div>
  201. {{end}}
  202. </div>
  203. </div>
  204. <div id="app" style="margin-top: 2rem;">
  205. <div class="center">
  206. <el-pagination
  207. background
  208. @current-change="handleCurrentChange"
  209. :current-page="page"
  210. :page-sizes="[30]"
  211. :page-size="30"
  212. layout="total, sizes, prev, pager, next, jumper"
  213. :total="{{.Page.Paginater.Total}}">
  214. </el-pagination>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. {{template "base/footer" .}}