Browse Source

Merge branch 'V20211018' into fix-455

tags/v1.21.12.1
zhoupzh 4 years ago
parent
commit
b33533692d
4 changed files with 11 additions and 3 deletions
  1. +1
    -1
      models/cloudbrain.go
  2. +1
    -1
      models/repo_list.go
  3. +5
    -1
      templates/repo/cloudbrain/index.tmpl
  4. +4
    -0
      templates/repo/modelarts/index.tmpl

+ 1
- 1
models/cloudbrain.go View File

@@ -687,7 +687,7 @@ func CanDelJob(isSigned bool, user *User, job *CloudbrainInfo) bool {
return false
}

if user.ID == job.UserID || user.IsAdmin || permission.AccessMode >= AccessModeAdmin {
if (user.ID == job.UserID && permission.AccessMode >= AccessModeWrite) || user.IsAdmin || permission.AccessMode >= AccessModeAdmin {
return true
}
return false


+ 1
- 1
models/repo_list.go View File

@@ -331,7 +331,7 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
}
if opts.TopicName != "" {
var subQueryCond = builder.NewCond()
subQueryCond = subQueryCond.Or(builder.Eq{"topic.name": opts.TopicName})
subQueryCond = subQueryCond.Or(builder.Eq{"topic.name": strings.ToLower(opts.TopicName)})
subQuery := builder.Select("repo_topic.repo_id").From("repo_topic").
Join("INNER", "topic", "topic.id = repo_topic.topic_id").
Where(subQueryCond).


+ 5
- 1
templates/repo/cloudbrain/index.tmpl View File

@@ -318,7 +318,11 @@
</div>

<div class="one wide column">
<a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a>
{{if .User.Name}}
<a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a>
{{else}}
<a title="Ghost"><img class="ui avatar image" src="{{AppSubUrl}}/user/avatar/Ghost/-1"></a>
{{end}}
</div>
<div class="seven wide column text right">
<div class="ui compact buttons">


+ 4
- 0
templates/repo/modelarts/index.tmpl View File

@@ -292,7 +292,11 @@
</div>

<div class="one wide column">
{{if .User.Name}}
<a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a>
{{else}}
<a title="Ghost"><img class="ui avatar image" src="{{AppSubUrl}}/user/avatar/Ghost/-1"></a>
{{end}}
</div>

<div class="seven wide column text right">


Loading…
Cancel
Save