From 7a3fce175e92b384da9d015be8b843c275bd1903 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Tue, 18 Jan 2022 10:05:58 +0800 Subject: [PATCH 1/4] fix bug --- models/repo_tag.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/models/repo_tag.go b/models/repo_tag.go index 76740bd76..984f9e2db 100644 --- a/models/repo_tag.go +++ b/models/repo_tag.go @@ -28,6 +28,7 @@ type OfficialTagRepos struct { type TagReposBrief struct { RepoID int64 RepoName string + Alias string TagID int64 } @@ -97,7 +98,7 @@ func UpdateTagReposByID(tagID, orgID int64, repoIdList []int64) error { func GetTagRepos(tagID, orgID int64) ([]TagReposSelected, error) { t := make([]TagReposBrief, 0) - const SQLCmd = "select t1.id as repo_id,t1.name as repo_name,t2.id as tag_id from repository t1 left join official_tag_repos t2 on (t1.id = t2.repo_id and t2.tag_id = ?) where t1.owner_id = ? and t1.is_private = false order by t1.updated_unix desc" + const SQLCmd = "select t1.id as repo_id,t1.name as repo_name,t1.alias,t2.id as tag_id from repository t1 left join official_tag_repos t2 on (t1.id = t2.repo_id and t2.tag_id = ?) where t1.owner_id = ? and t1.is_private = false order by t1.updated_unix desc" if err := x.SQL(SQLCmd, tagID, orgID).Find(&t); err != nil { return nil, err @@ -108,9 +109,13 @@ func GetTagRepos(tagID, orgID int64) ([]TagReposSelected, error) { if v.TagID > 0 { selected = true } + repoName := v.Alias + if v.Alias == "" { + repoName = v.RepoName + } r = append(r, TagReposSelected{ RepoID: v.RepoID, - RepoName: v.RepoName, + RepoName: repoName, Selected: selected, }) } From 066b3206b637750dcd747e92ef8bfb1c36a8c5d2 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 18 Jan 2022 15:12:38 +0800 Subject: [PATCH 2/4] fix issue --- templates/org/repo_list.tmpl | 4 ++-- templates/org/select_pro.tmpl | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/org/repo_list.tmpl b/templates/org/repo_list.tmpl index eab03c591..c763f8976 100644 --- a/templates/org/repo_list.tmpl +++ b/templates/org/repo_list.tmpl @@ -33,7 +33,7 @@ {{end}} - {{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}} + {{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{if .Alias}}{{.Alias}}{{else}}{{.Name}}{{end}} {{if .IsArchived}}{{end}} {{if .IsPrivate}} @@ -70,4 +70,4 @@ {{$.i18n.Tr "explore.repo_no_results"}} {{end}} - + \ No newline at end of file diff --git a/templates/org/select_pro.tmpl b/templates/org/select_pro.tmpl index 647bccd57..220dba9a5 100755 --- a/templates/org/select_pro.tmpl +++ b/templates/org/select_pro.tmpl @@ -87,7 +87,7 @@
@@ -165,6 +165,7 @@