Browse Source

Merge branch 'V20220428' into fix-1481

pull/2036/head
zhoupzh 3 years ago
parent
commit
b04dac8a0e
5 changed files with 13 additions and 3 deletions
  1. +1
    -0
      models/repo_list.go
  2. +1
    -0
      options/locale/locale_en-US.ini
  3. +2
    -1
      options/locale/locale_zh-CN.ini
  4. +4
    -2
      routers/home.go
  5. +5
    -0
      templates/explore/datasets.tmpl

+ 1
- 0
models/repo_list.go View File

@@ -221,6 +221,7 @@ const (
SearchOrderByHot SearchOrderBy = "(num_watches + num_stars + num_forks + clone_cnt) DESC" SearchOrderByHot SearchOrderBy = "(num_watches + num_stars + num_forks + clone_cnt) DESC"
SearchOrderByActive SearchOrderBy = "(num_issues + num_pulls + num_commit) DESC" SearchOrderByActive SearchOrderBy = "(num_issues + num_pulls + num_commit) DESC"
SearchOrderByWatches SearchOrderBy = "num_watches DESC" SearchOrderByWatches SearchOrderBy = "num_watches DESC"
SearchOrderByDefault SearchOrderBy = "recommend desc,num_stars DESC,updated_unix DESC"
) )


// SearchRepositoryCondition creates a query condition according search repository options // SearchRepositoryCondition creates a query condition according search repository options


+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -1392,6 +1392,7 @@ issues.filter_type.assigned_to_you = Assigned to you
issues.filter_type.created_by_you = Created by you issues.filter_type.created_by_you = Created by you
issues.filter_type.mentioning_you = Mentioning you issues.filter_type.mentioning_you = Mentioning you
issues.filter_sort = Sort issues.filter_sort = Sort
issues.filter_sort.default = Default
issues.filter_sort.latest = Newest issues.filter_sort.latest = Newest
issues.filter_sort.oldest = Oldest issues.filter_sort.oldest = Oldest
issues.filter_sort.recentupdate = Recently updated issues.filter_sort.recentupdate = Recently updated


+ 2
- 1
options/locale/locale_zh-CN.ini View File

@@ -1377,7 +1377,7 @@ issues.remove_milestone_at=`%[2]s 删除了里程碑 <b>%[1]s</b>`


issues.add_branch_at=` %[2]s 添加了分支 <b>%[1]s</b>` issues.add_branch_at=` %[2]s 添加了分支 <b>%[1]s</b>`
issues.add_tag_at =` %[2]s 添加了标签 <b>%[1]s</b>` issues.add_tag_at =` %[2]s 添加了标签 <b>%[1]s</b>`
issues.change_branch_tag_at=`%[3]s 修改了标签/分支从 <b>%[1]s</b> 到 <b>%[2]s</b>`
issues.change_branch_tag_at=`%[3]s 修改了分支/标签从 <b>%[1]s</b> 到 <b>%[2]s</b>`
issues.remove_branch_at=`%[2]s 删除了分支 <b>%[1]s</b>` issues.remove_branch_at=`%[2]s 删除了分支 <b>%[1]s</b>`
issues.remove_tag_at=`%[2]s 删除了标签 <b>%[1]s</b>` issues.remove_tag_at=`%[2]s 删除了标签 <b>%[1]s</b>`


@@ -1404,6 +1404,7 @@ issues.filter_type.assigned_to_you=指派给您的
issues.filter_type.created_by_you=由您创建的 issues.filter_type.created_by_you=由您创建的
issues.filter_type.mentioning_you=提及您的 issues.filter_type.mentioning_you=提及您的
issues.filter_sort=排序 issues.filter_sort=排序
issues.filter_sort.default=默认排序
issues.filter_sort.latest=最新创建 issues.filter_sort.latest=最新创建
issues.filter_sort.oldest=最早创建 issues.filter_sort.oldest=最早创建
issues.filter_sort.recentupdate=最近更新 issues.filter_sort.recentupdate=最近更新


+ 4
- 2
routers/home.go View File

@@ -309,9 +309,11 @@ func ExploreDatasets(ctx *context.Context) {
orderBy = models.SearchOrderByStarsReverse orderBy = models.SearchOrderByStarsReverse
case "feweststars": case "feweststars":
orderBy = models.SearchOrderByStars orderBy = models.SearchOrderByStars
case "default":
orderBy = models.SearchOrderByDefault
default: default:
ctx.Data["SortType"] = "recentupdate"
orderBy = models.SearchOrderByRecentUpdated
ctx.Data["SortType"] = "default"
orderBy = models.SearchOrderByDefault
} }


keyword := strings.Trim(ctx.Query("q"), " ") keyword := strings.Trim(ctx.Query("q"), " ")


+ 5
- 0
templates/explore/datasets.tmpl View File

@@ -121,6 +121,7 @@
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
</span> </span>
<div class="menu"> <div class="menu">
<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>
<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> <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>
<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> <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>
<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> <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>
@@ -149,6 +150,8 @@
<a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}</a> <a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}</a>
{{if $.IsSigned}} {{if $.IsSigned}}
<span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;" @click.stop="postSquareStar({{.ID}},'{{.Repo.Link}}/datasets',{{$k}})"> <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;" @click.stop="postSquareStar({{.ID}},'{{.Repo.Link}}/datasets',{{$k}})">
<span style="line-height: 1;color: #101010;margin-bottom: -2px;"><i class="ri-download-line" style="font-size: 1.3em;"></i></span>
<span style="line-height: 1;color: #101010;margin-right: 0.6rem;">{{.DownloadTimes}}</span>
<div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;"> <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
<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> <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>
</div> </div>
@@ -156,6 +159,8 @@
</span> </span>
{{else}} {{else}}
<span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;"> <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;">
<span style="line-height: 1;color: #101010;margin-bottom: -2px;"><i class="ri-download-line" style="font-size: 1.3em;"></i></span>
<span style="line-height: 1;color: #101010;margin-right: 0.6rem;">{{.DownloadTimes}}</span>
<div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;"> <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;">
<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> <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>
</div> </div>


Loading…
Cancel
Save