Display owner of a runner as a tooltip instead of static text (#24377)
Before:  After:   --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>main
parent
4aec1f87a4
commit
49808136c5
@ -0,0 +1,29 @@
|
||||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package types
|
||||
|
||||
import "code.gitea.io/gitea/modules/translation"
|
||||
|
||||
type OwnerType string
|
||||
|
||||
const (
|
||||
OwnerTypeSystemGlobal = "system-global"
|
||||
OwnerTypeIndividual = "individual"
|
||||
OwnerTypeRepository = "repository"
|
||||
OwnerTypeOrganization = "organization"
|
||||
)
|
||||
|
||||
func (o OwnerType) LocaleString(locale translation.Locale) string {
|
||||
switch o {
|
||||
case OwnerTypeSystemGlobal:
|
||||
return locale.Tr("concept_system_global")
|
||||
case OwnerTypeIndividual:
|
||||
return locale.Tr("concept_user_individual")
|
||||
case OwnerTypeRepository:
|
||||
return locale.Tr("concept_code_repository")
|
||||
case OwnerTypeOrganization:
|
||||
return locale.Tr("concept_user_organization")
|
||||
}
|
||||
return locale.Tr("unknown")
|
||||
}
|
Loading…
Reference in New Issue