From 7702cf5cbe4d2774e37b5541d1cbf23119972b7c Mon Sep 17 00:00:00 2001 From: liuzx Date: Thu, 30 Jun 2022 11:57:26 +0800 Subject: [PATCH 1/3] fix-2390 --- routers/api/v1/repo/repo_dashbord.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/routers/api/v1/repo/repo_dashbord.go b/routers/api/v1/repo/repo_dashbord.go index b19c93371..b3a01cff1 100644 --- a/routers/api/v1/repo/repo_dashbord.go +++ b/routers/api/v1/repo/repo_dashbord.go @@ -887,19 +887,12 @@ func getTimePeroid(ctx *context.Context, recordBeginTime time.Time) (time.Time, if queryType == "all" { beginTime = recordBeginTimeTemp endTime = now - } else if queryType == "today" { + } else if queryType == "yesterday" { endTime = now beginTime = time.Date(endTime.Year(), endTime.Month(), endTime.Day(), 0, 0, 0, 0, now.Location()) - } else if queryType == "yesterday" { - endTime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) - beginTime = endTime.AddDate(0, 0, -1) - } else if queryType == "last_7day" { - beginTime = now.AddDate(0, 0, -7) - beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) - endTime = now - } else if queryType == "last_30day" { - beginTime = now.AddDate(0, 0, -30) + } else if queryType == "current_week" { + beginTime = now.AddDate(0, 0, -int(time.Now().Weekday())+2) //begin from monday beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) endTime = now } else if queryType == "current_month" { From a57c114b32cc5d1baff2cfcf38460b246446a508 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 1 Jul 2022 16:46:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_zh-CN.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 78d80a6bc..847c7b383 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1473,7 +1473,7 @@ issues.filter_sort.mostforks=派生由多到少 issues.filter_sort.fewestforks=派生由少到多 issues.filter_sort.downloadtimes=下载次数 issues.filter_sort.citations=引用次数 -issues.filter_sort.moststars=收藏数量 +issues.filter_sort.moststars=点赞由多到少 issues.filter_sort.mostusecount=最多引用 issues.filter_sort.fewestusecount=最少引用 From 10be239730706f7d6401d67ffb74cf4b556617ae Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 1 Jul 2022 17:02:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BF=A1=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-CN.ini | 2 +- templates/explore/datasets.tmpl | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 8b465d3e0..da0854ce7 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -902,6 +902,7 @@ unzip_successed=Unzip Successed unzip_failed=Unzip Failed unzip_stared=Unzipping unzip_status=Unzip Status +collection_num=Collection Nums [repo] owner = Owner repo_name = Repository Name diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index ffa757b92..ff3b1eb83 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -907,7 +907,7 @@ unzip_successed=解压成功 unzip_failed=解压失败 unzip_stared=解压中 unzip_status=解压状态 - +collection_num=收藏数量 [repo] owner=拥有者 repo_name=项目名称 diff --git a/templates/explore/datasets.tmpl b/templates/explore/datasets.tmpl index 327c4fb98..17164cfed 100644 --- a/templates/explore/datasets.tmpl +++ b/templates/explore/datasets.tmpl @@ -154,7 +154,7 @@ {{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}} {{.i18n.Tr "repo.issues.filter_sort.moststars"}} + href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "dataset.collection_num"}} {{.i18n.Tr "repo.issues.filter_sort.mostusecount"}}