Add link to job details and tooltip to commit status in repo list in dashboard (#26326)
Tooltip:  Link to the target job: 
This commit is contained in:
parent
3be80a863b
commit
f6e7798405
6 changed files with 36 additions and 10 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/setting"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/modules/translation"
|
||||
|
||||
"xorm.io/builder"
|
||||
"xorm.io/xorm"
|
||||
|
@ -191,6 +192,11 @@ func (status *CommitStatus) APIURL(ctx context.Context) string {
|
|||
return status.Repo.APIURL() + "/statuses/" + url.PathEscape(status.SHA)
|
||||
}
|
||||
|
||||
// LocaleString returns the locale string name of the Status
|
||||
func (status *CommitStatus) LocaleString(lang translation.Locale) string {
|
||||
return lang.Tr("repo.commitstatus." + status.State.String())
|
||||
}
|
||||
|
||||
// CalcCommitStatus returns commit status state via some status, the commit statues should order by id desc
|
||||
func CalcCommitStatus(statuses []*CommitStatus) *CommitStatus {
|
||||
var lastStatus *CommitStatus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue