Browse Source

Merge branch 'V20220110.patch' into computing

merge
tags/v1.22.1.3^2
ychao_1983 4 years ago
parent
commit
f08e5a6715
5 changed files with 14 additions and 8 deletions
  1. +7
    -2
      models/repo_tag.go
  2. +1
    -1
      modules/repository/init.go
  3. +2
    -2
      options/locale/locale_zh-CN.ini
  4. +2
    -2
      templates/org/repo_list.tmpl
  5. +2
    -1
      templates/org/select_pro.tmpl

+ 7
- 2
models/repo_tag.go View File

@@ -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,
})
}


+ 1
- 1
modules/repository/init.go View File

@@ -51,7 +51,7 @@ func prepareRepoCommit(ctx models.DBContext, repo *models.Repository, tmpDir, re

cloneLink := repo.CloneLink()
match := map[string]string{
"Name": repo.Name,
"Name": repo.DisplayName(),
"Description": repo.Description,
"CloneURL.SSH": cloneLink.SSH,
"CloneURL.HTTPS": cloneLink.HTTPS,


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

@@ -380,8 +380,8 @@ SSPIDefaultLanguage=默认语言
require_error=不能为空。
alpha_dash_error=应该只包含字母数字、破折号 ('-') 和下划线 ('_') 字符。
alpha_dash_dot_error=应该只包含字母数字, 破折号 ('-'), 下划线 ('_') 和点 ('. ') 。
reponame_dash_dot_error=请输入中文、字母、数字和-_.、最多100个字符。
repoadd_dash_dot_error=路径只允许字母、数字和-_.,最多100个字符。
reponame_dash_dot_error=请输入中文、字母、数字和-_ .,最多100个字符。
repoadd_dash_dot_error=路径只允许字母、数字和-_ .,最多100个字符。
git_ref_name_error=` 必须是格式良好的 git 引用名称。`
alpha_dash_dot_chinese_error=应该只包含字母数字中文, 破折号 ('-'), 下划线 ('_') 和点 ('. ') 。
size_error=长度必须为 %s。


+ 2
- 2
templates/org/repo_list.tmpl View File

@@ -33,7 +33,7 @@
<img class="ui avatar image" src="{{.RelAvatarLink}}">
{{end}}
<a class="name" href="{{.Link}}">
{{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}}<i class="archive icon archived-icon"></i>{{end}}
</a>
{{if .IsPrivate}}
@@ -70,4 +70,4 @@
{{$.i18n.Tr "explore.repo_no_results"}}
</div>
{{end}}
</div>
</div>

+ 2
- 1
templates/org/select_pro.tmpl View File

@@ -87,7 +87,7 @@
<div class="extra full_height cor" >
<div class=" header header_card omit" >
<a class="header_card image poping up " href="{{.Link}}" data-content="{{.Name}}" data-position="top left" data-variation="tiny inverted"> {{.Name}}</a>
<a class="header_card image poping up " href="{{.Link}}" data-content="{{if .Alias}}{{.Alias}}{{else}}{{.Name}}{{end}}" data-position="top left" data-variation="tiny inverted">{{if .Alias}}{{.Alias}}{{else}}{{.Name}}{{end}}</a>
</div>
<div class='content descript_height nowrap-2'>
@@ -165,6 +165,7 @@
</div>

<script>
console.log({{.tags}})
var data;
var filterData=[];
var num=0;


Loading…
Cancel
Save